Install OCSInventory on Debian 10

  1. Install Apache ,ngnix or any your favourite web server, also install MariaDB. I prefer Apache2 so let’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 database, the user and the permissions on it.
> CREATE DATABASE ocsdb; 
> GRANT ALL PRIVILEGES ON ocsdb.* TO 'ocsuser'@'localhost' IDENTIFIED BY 'ocspassword'; > FLUSH PRIVILEGES; exit;
3.  Install some Perl modules
 The OCSInventory server is made with PERL. That’s why you have to install many modules of this language.
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

cpan install XML::Entities Apache2::SOAP Net::IP Apache::DBI Mojolicious Switch Plack::Handler Archive::Zip

4. Download and install OCSInventory on Debian 10
wget -c https://github.com/OCSInventory-NG/OCSInventory-ocsreports/releases/download/2.8/OCSNG_UNIX_SERVER_2.8.tar.gz -O ocs.tar.gz
Now proceed to decompress it: tar -xvzf ocs.tar.gz

Then go to the generated folder and edit the installation script to add our database credentials.
cd OCSNG_UNIX_SERVER_2.8/ 
nano setup.sh
 And leave it the following way:
DB_SERVER_HOST="localhost" 
DB_SERVER_PORT="3306" 
DB_SERVER_USER="ocsuser" 
DB_SERVER_PWD="ocspassword"
 4.- Configuring OCSInventory on Debian 105 Configuring OCSInventory on Debian 10
 Remember, you have to place the data from the database you have defined. These are the ones I used as an example.
 So, save the changes and close the file. Now we have to run the installation script.
./setup.sh

Follow on screen guidance, but if you not doing changes, just hit "ENTER" button and move on.
Even though the installation has been successfully completed there are still some extra settings to be made.
 First enable the newly installed Apache settings for OCSInventory(this create symlinks):
 ln -s /etc/apache2/conf-available/ocsinventory-reports.conf /etc/apache2/conf-enabled/ocsinventory-reports.conf
ln -s /etc/apache2/conf-available/z-ocsinventory-server.conf /etc/apache2/conf-enabled/z-ocsinventory-server.conf

These settings are for the OCSInventory web interface to be properly processed by Apache2.
 Then, change the execution permissions of the OCSInventory folder so that there are no problems with the graphical interface.
  chown -R www-data:www-data /var/lib/ocsinventory-reports/
 After that, you have to write the database parameters to another configuration file:
  nano /etc/apache2/conf-available/z-ocsinventory-server.conf
As in the previous configuration file, you have to write the name of the database, the MariaDB user and the password.
 Save the changes and close the file.
 After that, restart Apache.
  systemctl restart apache2
 Now all you have to do is complete the installation through the web interface.
 To do this open your favorite web browser and go to http://your-server/ocsreports/ and you will see a screen where you have to place your MariaDB credentials.

There you will see the default credentials which are user:admin and password:admin.

There you go. OCSInventory is ready for use. Now we need to install the agents on the computers.


This information found here: https://www.osradar.com/install-ocsinventory-debian-10/

Leave a Reply