{"id":36,"date":"2021-04-29T13:32:31","date_gmt":"2021-04-29T13:32:31","guid":{"rendered":"https:\/\/untanux.lt\/?p=36"},"modified":"2021-04-29T13:32:31","modified_gmt":"2021-04-29T13:32:31","slug":"install-ocsinventory-on-debian-10","status":"publish","type":"post","link":"https:\/\/untanux.lt\/?p=36","title":{"rendered":"Install OCSInventory on Debian 10"},"content":{"rendered":"\n<ol class=\"wp-block-list\"><li>Install Apache ,ngnix or any your favourite web server, also install MariaDB. I prefer Apache2 so let&#8217;s go: <\/li><\/ol>\n\n\n\n<pre class=\"wp-block-preformatted\">apt install apache2 libapache2-mod-php libapache2-mod-perl2 libapache-dbi-perl libapache-db-perl php-soap php-curl php-json php-xml php-mbstring php-gd php-pclzip php-xmlrpc\n2. Creating a new database for OCSInventory\nFirst access the MariaDB shell:\n<strong>mysql -u root -p<\/strong>\nAnd then, it creates the new database, the user and the permissions on it.\n> <strong>CREATE DATABASE ocsdb;<\/strong> \n> <strong>GRANT ALL PRIVILEGES ON ocsdb.* TO 'ocsuser'@'localhost' IDENTIFIED BY 'ocspassword'; <\/strong>> <strong>FLUSH PRIVILEGES; exit;<\/strong>\n3.  Install some Perl modules\n The OCSInventory server is made with PERL. That\u2019s why you have to install many modules of this language.\n<strong>apt install perl libnet-ip-perl libxml-simple-perl libarchive-zip-perl libxml-simple-perl libcompress-zlib-perl libdbi-perl libdbd-mysql-perl libnet-ip-perl libsoap-lite-perl libio-compress-perl libapache-dbi-perl libapache2-mod-perl2 libapache2-mod-perl2-dev libdbd-mysql-perl<\/strong>\n\n<strong>cpan install XML::Entities Apache2::SOAP Net::IP Apache::DBI Mojolicious Switch Plack::Handler Archive::Zip<\/strong>\n\n4. Download and install OCSInventory on Debian 10\n<strong>wget -c https:\/\/github.com\/OCSInventory-NG\/OCSInventory-ocsreports\/releases\/download\/2.8\/OCSNG_UNIX_SERVER_2.8.tar.gz -O ocs.tar.gz<\/strong>\nNow proceed to decompress it: <strong>tar -xvzf ocs.tar.gz<\/strong>\n\nThen go to the generated folder and edit the installation script to add our database credentials.\n<strong>cd OCSNG_UNIX_SERVER_2.8\/ \nnano setup.sh\n<\/strong> And leave it the following way:\n<strong>DB_SERVER_HOST=\"localhost\" \nDB_SERVER_PORT=\"3306\" \nDB_SERVER_USER=\"ocsuser\" \nDB_SERVER_PWD=\"ocspassword\"<\/strong>\n <img loading=\"lazy\" decoding=\"async\" srcset=\"\/\/1081754738.rsc.cdn77.org\/wp-content\/uploads\/2020\/01\/4-16.png 859w, \/\/1081754738.rsc.cdn77.org\/wp-content\/uploads\/2020\/01\/4-16-300x138.png 300w, \/\/1081754738.rsc.cdn77.org\/wp-content\/uploads\/2020\/01\/4-16-768x352.png 768w, \/\/1081754738.rsc.cdn77.org\/wp-content\/uploads\/2020\/01\/4-16-696x319.png 696w\" width=\"859\" height=\"394\" src=\"file:\/\/1081754738.rsc.cdn77.org\/wp-content\/uploads\/2020\/01\/4-16.png\" alt=\"4.- Configuring OCSInventory on Debian 10\">5 Configuring OCSInventory on Debian 10\n Remember, you have to place the data from the database you have defined. These are the ones I used as an example.\n So, save the changes and close the file. Now we have to run the installation script.\n<strong>.\/setup.sh<\/strong>\n\nFollow on screen guidance, but if you not doing changes, just hit \"ENTER\" button and move on.\nEven though the installation has been successfully completed there are still some extra settings to be made.\n First enable the newly installed Apache settings for OCSInventory(this create symlinks):\n <strong>ln -s \/etc\/apache2\/conf-available\/ocsinventory-reports.conf \/etc\/apache2\/conf-enabled\/ocsinventory-reports.conf\nln -s \/etc\/apache2\/conf-available\/z-ocsinventory-server.conf \/etc\/apache2\/conf-enabled\/z-ocsinventory-server.conf<\/strong>\n\nThese settings are for the OCSInventory web interface to be properly processed by Apache2.\n Then, change the execution permissions of the OCSInventory folder so that there are no problems with the graphical interface.\n  <strong>chown -R www-data:www-data \/var\/lib\/ocsinventory-reports\/<\/strong>\n After that, you have to write the database parameters to another configuration file:\n  <strong>nano \/etc\/apache2\/conf-available\/z-ocsinventory-server.conf<\/strong>\nAs in the previous configuration file, you have to write the name of the database, the MariaDB user and the password.\n Save the changes and close the file.\n After that, restart Apache.\n <strong> systemctl restart apache2<\/strong>\n Now all you have to do is complete the installation through the web interface.\n To do this open your favorite web browser and go to<strong> <code>http:\/\/your-server\/ocsreports\/<\/code><\/strong> and you will see a screen where you have to place your MariaDB credentials.\n\nThere you will see the default credentials which are <strong>user:admin<\/strong> and <strong>password:admin<\/strong>.\n\nThere you go. OCSInventory is ready for use. Now we need to install the agents on the computers.\n\n\nThis information found here: <a href=\"https:\/\/www.osradar.com\/install-ocsinventory-debian-10\/\">https:\/\/www.osradar.com\/install-ocsinventory-debian-10\/<\/a>\n<\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Install Apache ,ngnix or any your favourite web server, also install MariaDB. I prefer Apache2 so let&#8217;s go: apt install apache2 libapache2-mod-php libapache2-mod-perl2 libapache-dbi-perl libapache-db-perl php-soap php-curl php-json php-xml php-mbstring php-gd php-pclzip php-xmlrpc 2. Creating a new database for OCSInventory First access the MariaDB shell: mysql -u root -p And then, it creates the new [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-36","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/untanux.lt\/index.php?rest_route=\/wp\/v2\/posts\/36","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/untanux.lt\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/untanux.lt\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/untanux.lt\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/untanux.lt\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=36"}],"version-history":[{"count":0,"href":"https:\/\/untanux.lt\/index.php?rest_route=\/wp\/v2\/posts\/36\/revisions"}],"wp:attachment":[{"href":"https:\/\/untanux.lt\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=36"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/untanux.lt\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=36"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/untanux.lt\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=36"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}