5. OCS Inventory NG Installation

Like I mentioned at the beginning there are two separate roles for OCS NG server:

  • OCS Inventory NG Inventory which collects data from computers and manages tchem
  • OCS Inventory NG Reports which present all data to the end user

I remember that install script was supposed to be one days ago. Recently when I was installing the server I noticed that you need to create links to both ocsreports and z-ocsinventory-server file.

5.1  Installing OCS NG Reports

Navigate to /tmp and download ocsreports package from github:

cd /tmp
wget https://github.com/OCSInventory-NG/OCSInventory-ocsreports/releases/download/2.3/OCSNG_UNIX_SERVER-2.3.tar.gz

unpack it and browse inside

tar zxf OCSNG_UNIX_SERVER-2.3.tar.gz
cd OCSNG_UNIX_SERVER-2.3 

run setup

./setup.sh

Install Steps below, ENTER means I just pressed Enter button on keyboard

Do you wish to continue ([y]/n)? ENTER
Which host is running database server [localhost] ? ENTER
On which port is running database server [3306] ? ENTER
Where is Apache daemon binary [/usr/sbin/apache2ctl] ? ENTER
Where is Apache main configuration file [/etc/apache2/apache2.conf] ? ENTER
Which user account is running Apache web server [www-data] ? ENTER
Which user group is running Apache web server [www-data] ? ENTER
Where is Apache Include configuration directory [/etc/apache2/conf-available] ? ENTER
Where is PERL Intrepreter binary [/usr/bin/perl] ? ENTER
Do you wish to setup Communication server on this computer ([y]/n)? ENTER
Where to put Communication server log directory [/var/log/ocsinventory-server] ? ENTER
Where to put Communication server plugins configuration files [/etc/ocsinventory-server/plugins] ? ENTER
Where to put Communication server plugins Perl modules files [/etc/ocsinventory-server/perl] ? ENTER
Checking for Apache2::SOAP PERL module...
*** Warning: PERL module Apache2::SOAP is not installed !
This module is only required by OCS Inventory NG SOAP Web Service.
Do you wish to continue ([y]/n] ? ENTER

Do you allow Setup renaming Communication Server Apache configuration file
to 'z-ocsinventory-server.conf' ([y]/n) ? ENTER
Do you wish to setup Administration Server (Web Administration Console)
on this computer ([y]/n)? ENTER
Administration Server writable/cache directory (by default
/var/lib/ocsinventory-reports), especially if you use deployment feature.

Do you wish to continue ([y]/n)? ENTER
Where to copy Administration Server static files for PHP Web Console
[/usr/share/ocsinventory-reports] ? ENTER
Where to create writable/cache directories for deployment packages,
administration console logs, IPDiscover and SNMP [/var/lib/ocsinventory-reports] ? ENTER
VOILA!
+----------------------------------------------------------------------+
|        OK, Administration server installation finished ;-)           |
|                                                                      |
| Please, review /etc/apache2/conf-available/ocsinventory-reports.conf
|          to ensure all is good and restart Apache daemon.            |
|                                                                      |
| Then, point your browser to http://server//ocsreports
|        to configure database server and create/update schema.        |
+----------------------------------------------------------------------+

Now, create sym links to ocs server config files:

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

And a final touch:

chown www-data:www-data -R /var/lib/ocsinventory-reports

edit z-ocsinventory-server.conf and provide correct db, db_host, user and pwd for OCS NG Database

nano /etc/apache2/conf-enabled/z-ocsinventory-server.conf
PerlSetEnv OCS_DB_NAME DB_NAME_HERE
PerlSetEnv OCS_DB_LOCAL DB_NAME_HERE
# User allowed to connect to database
PerlSetEnv OCS_DB_USER DB_USER_HERE
# Password for user
PerlSetVar OCS_DB_PWD DB_PASSWORD_HERE
service apache2 restart

restart Apache one more time and….

Navigate to http://ocsng_ip/ocsreports

You have the DB password noted somewhere, right :) ?

Fill in all info and press Next:

If you land on setup Page just refresh It, login and you will see the magic!

Remove the install file:

rm /usr/share/ocsinventory-reports/ocsreports/install.php

At this point OCS NG server is functional.

Now, check if http://ocsng_ip/ocsinventory you should get something like below:

It’s normal since your web browser doesn’t know how to talk to inventory service J Keep it in mind, that “Internal Server Error 500” here means that ocs inventory (z-ocsinventory-server.conf) cannot talk to the database

We need to fine tune it, however, to make most of it!

Loading