Professional Documents
Culture Documents
CentOS 7
By cr00t - February 6, 2022
In this tutorial, you will learn how to install and setup OCS NG Inventory Server on CentOS 7. OCS
(Open Computers and Software Inventory Next Generation) is an opensource assets inventory
management solution. It is used to inventor hardware and software details of IT assets either
using the OCS Inventory Agent or SNMP polling for assets that the agent cannot be deployed (e.g
routers, switches, printers. Inventoried results can be visualized through a web interface.
x
Install cPanel on Oracle FREE HOSTING, Resize Storage, Update RDNS & Open Por…
To begin with, update the system
yum update -y
x
systemctl enable --now httpd
Run MySQL initial security script and set root user password:
mysql_secure_installation
Cleaning up...
Login to database as root user and create OCS-NG user and database and assign all rights on
OCS-NG database to the user.
Replace the names of the database with the one set for your environment.
mysql -u root -p
flush privileges;
exit;
wget http://rpm.ocsinventory-ng.org/enterprise/7/x86_64/perl-Apache-
DBI-1.12-2.el7.ocs.noarch.rpm
yum install ./perl-Apache-DBI-1.12-2.el7.ocs.noarch.rpm -y
Since Apache Web server is already installed, proceed and install install php 7.2, PHP Zip support
and dependacies
wget https://github.com/OCSInventory-NG/OCSInventory-
ocsreports/releases/download/2.9.2/OCSNG_UNIX_SERVER-2.9.2.tar.gz
x
tar xzf OCSNG_UNIX_SERVER-2.9.2.tar.gz
cd OCSNG_UNIX_SERVER-2.9.2
sh setup.sh
Follow through the prompts to install OCS-NG inventory accordingly. Press ENTER to accept the
defaults.
+----------------------------------------------------------+
| |
| Welcome to OCS Inventory NG Management server setup ! |
| |
+----------------------------------------------------------+
+----------------------------------------------------------+
| Checking for database server properties... |
+----------------------------------------------------------+
+----------------------------------------------------------+
| Checking for Apache web server daemon... |
+----------------------------------------------------------+
+----------------------------------------------------------+
| Checking for Apache main configuration file... |
+----------------------------------------------------------+
Where is Apache main configuration file
[/etc/httpd/conf/httpd.conf] ?
OK, using Apache main configuration file /etc/httpd/conf/httpd.conf ;-)
+----------------------------------------------------------+
| Checking for Apache user account... |
+----------------------------------------------------------+
+----------------------------------------------------------+
| Checking for Apache group...
+----------------------------------------------------------+
+----------------------------------------------------------+
| Checking for Apache Include configuration directory... |
+----------------------------------------------------------+
+----------------------------------------------------------+
| Checking for Make utility... |
+----------------------------------------------------------+
+----------------------------------------------------------+
| Checking for Apache mod_perl version... |
+----------------------------------------------------------+
+----------------------------------------------------------+
| Checking for Communication server log directory... |
+----------------------------------------------------------+
Communication server can create detailed logs. This logs can be enabled
by setting integer value of LOGLEVEL to 1 in Administration console
menu Configuration.
Where to put Communication server log directory [/var/log/ocsinventory-serv
OK, Communication server will put logs into directory /var/log/ocsinventory
+-------------------------------------------------------------------------
| Checking for Communication server plugins configuration directory...
+-------------------------------------------------------------------------
+-------------------------------------------------------------------+
| Checking for Communication server plugins perl directory... |
+-------------------------------------------------------------------+ x
+----------------------------------------------------------+
| Checking for required Perl Modules... |
+----------------------------------------------------------+
+----------------------------------------------------------+
| Checking for REST API Dependencies ... |
+----------------------------------------------------------+
+----------------------------------------------------------+
| Configuring REST API Server files ... |
+----------------------------------------------------------+
Where do you want the API code to be store [/usr/lib64/perl5/vendor_perl] ?
+----------------------------------------------------------+
| OK, looks good ;-) |
| |
| Configuring Communication server Perl modules... |
+----------------------------------------------------------+
Checking if your kit is complete...
Looks good
Writing Makefile for Apache::Ocsinventory
+----------------------------------------------------------+ x
| OK, looks good ;-) |
| |
| Preparing Communication server Perl modules... |
+----------------------------------------------------------+
+----------------------------------------------------------+
| OK, prepare finshed ;-) |
| |
| Installing Communication server Perl modules... |
+----------------------------------------------------------+
+----------------------------------------------------------+
| OK, Communication server Perl modules install finished;-)|
| |
| Creating Communication server log directory... |
+----------------------------------------------------------+
+----------------------------------------------------------------------+
| OK, Communication server log directory created ;-) |
| |
| Creating Communication server plugins configuration directory... |
+----------------------------------------------------------------------+
+----------------------------------------------------------------------+
| OK, Communication server plugins configuration directory created ;-) |
| |
| Creating Communication server plugins Perl directory... |
+----------------------------------------------------------------------+
+----------------------------------------------------------------------+
| OK, Communication server plugins Perl directory created ;-) |
| |
| Now configuring Apache web server... |
+----------------------------------------------------------------------+ x
+----------------------------------------------------------------------+
| OK, Communication server setup successfully finished ;-) |
| |
| Please, review /etc/httpd/conf.d/z-ocsinventory-server.conf |
| to ensure all is good. Then restart Apache daemon. |
+----------------------------------------------------------------------+
+----------------------------------------------------------+
| Checking for Administration Server directories... |
+----------------------------------------------------------+
Where to copy Administration Server static files for PHP Web Console
[/usr/share/ocsinventory-reports] ?
OK, using directory /usr/share/ocsinventory-reports to install static file
+----------------------------------------------------------+
| Checking for required Perl Modules... | x
+----------------------------------------------------------+
+----------------------------------------------------------+
| Installing files for Administration server... |
+----------------------------------------------------------+
+----------------------------------------------------------------------+
| OK, Administration server installation finished ;-) |
| |
| Please, review /etc/httpd/conf.d/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. |
+----------------------------------------------------------------------+
vim /etc/httpd/conf.d/z-ocsinventory-server.conf
configs
...
# Master Database settings
# Replace localhost by hostname or ip of MySQL server for WRITE
PerlSetEnv OCS_DB_HOST localhost
# Replace 3306 by port where running MySQL server, generally 3306
PerlSetEnv OCS_DB_PORT 3306
# Name of database
PerlSetEnv OCS_DB_NAME ocsweb
PerlSetEnv OCS_DB_LOCAL ocsweb
# User allowed to connect to database
PerlSetEnv OCS_DB_USER ocs
# Password for user
PerlSetVar OCS_DB_PWD ocs
...
vim /etc/httpd/conf.d/zz-ocsinventory-restapi.conf x
vim /usr/share/ocsinventory-reports/ocsreports/dbconfig.inc.php
Database configs
...
<?php
$_SESSION["SERVEUR_SQL"]="localhost";
$_SESSION["COMPTE_BASE"]="ocsweb";
$_SESSION["PSWD_BASE"]="ocs";
?>
Save and exit the configs file after making the changes.
x
chcon -R -t httpd_sys_rw_content_t /usr/share/ocsinventory-reports
Edit the PHP php.ini to optimize certain settings for OSC best suited for your env.
vim /etc/php.ini
max_execution_time = -1
max_input_time = -1
These settings define the maximum life time of the script and the time that the script should
spend in accepting input.
upload_max_filesize = 50M
post_max_size = 51M
memory_limit = 256M
You might get a warning message about file upload size depending on the size limit set on
php.ini file. This can be ignored or increase the size if you will be uploading packages greater
than 100MB as stated in the warning message.
Next, click Click here to enter OCS-NG GUI to login to OCS web interface.
login: admin
password: admin
x
If prompted to run a database update, click update and proceed to OCS login interface.
mv /usr/share/ocsinventory-reports/ocsreports/install.php
/usr/share/ocsinventory-reports/ocsreports/install.php.old
That marks the end of our guide on how to install and setup OCS NG Inventory server on CentOS
7.
cr00t
https://kifarunix.com