How To Install OCS Inventory NG Server 2 On CentOS 5.5

Want to support HowtoForge? Become a subscriber!
 
Submitted by rafatmb (Contact Author) (Forums) on Mon, 2011-01-24 19:24. :: CentOS

How To Install OCS Inventory NG Server 2 On CentOS 5.5

This article explains how to install OCS Inventory NG Server 2 on Linux Server. Prepared by Rafael Marangoni, from BRLink Consultoria Linux Team.

 

Introduction

OCS Inventory is a great software to make inventories. The NG Server is formed by: communication server, deployment server, and administration console. Click here to know how it works.

The computers that will be inventoried must run an agent (installed on each computer), to connect to the OCS NG Server. We are using the CentOS 5.5 (64bits) distribution, but it will probably work on Fedora (and Red Hat, for sure).

 

1 Some Prerequisites

Installing MySQL Server

We need to install it (if it's not already installed):

yum install mysql-server php-mysql php-pecl-zip php-gd

Starting MySQL:

/etc/init.d/mysqld start
chkconfig --level 35 mysqld on

Setting a root password on mysql:

/usr/bin/mysqladmin -u root password 'secret'

 

Starting Apache:

We need to start Apache (OCS uses it):

/etc/init.d/httpd start
chkconfig --level 35 httpd on

 

Installing Packages

Next, we need to install EPEL repository:

rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

Afterwards, let's install the packages:

yum install -y perl-XML-Simple perl-Compress-Zlib perl-DBI perl-DBD-MySQL perl-Net-IP perl-XML-Entities perl-Apache-DBI perl-Apache2-SOAP perl-SOAP-Lite mod_perl

 

Configure PHP

Edit the /etc/php.ini file, and change the following lines:

vi /etc/php.ini

post_max_size = 200M
upload_max_filesize = 200M

Restart Apache:

/etc/init.d/httpd restart

 

2 Installing OCS Inventory NG Server 2

First, we need to download the tarball from OCS Inventory website. Click here.

mkdir /download
cd /download
wget http://launchpad.net/ocsinventory-server/stable-2.0/2.0rc1/+download/OCSNG_UNIX_SERVER-2.0rc1.tar.gz

Initiate the installer:

tar -zxvf OCSNG_UNIX_SERVER-2.0rc1.tar.gz
cd /download/OCSNG_UNIX_SERVER-2.0rc1
sh setup.sh

The install script is very simple, it's a wizard. Almost all the options, we'll select the default option.
These are the questions:

If you leave the question in blank, it will select the default option.

Do you wish to continue ([y]/n)?y

Your MySQL client seems to be part of MySQL version 5.0.
Your computer seems to be running MySQL 4.1 or higher, good ;-)
Which host is running database server [localhost] ?localhost

On which port is running database server [3306] ? 3306

Where is Apache daemon binary [/usr/sbin/httpd] ?

Where is Apache main configuration file [/etc/httpd/conf/httpd.conf] ?

Which user account is running Apache web server [apache] ?

Which user group is running Apache web server [apache] ?

Where is Apache Include configuration directory [/etc/httpd/conf.d/] ?

Where is PERL Intrepreter binary [/usr/bin/perl] ?

Do you wish to setup Communication server on this computer ([y]/n)?y

Where to put Communication server log directory [/var/log/ocsinventory-server] ?

OCS setup.sh can install perl module from packages for you
The script will use the native package from your operating system like apt or rpm
Do you wish to continue (y/[n])? y

To ensure Apache loads mod_perl before OCS Inventory NG Communication Server,

Setup can name Communication Server Apache configuration file
'z-ocsinventory-server.conf' instead of 'ocsinventory-server.conf'.
Do you allow Setup renaming Communication Server Apache configuration file
to 'z-ocsinventory-server.conf' ([y]/n) ?y

Do you wish to setup Administration Server (Web Administration Console)
on this computer ([y]/n)?y

CAUTION: Setup now install files in accordance with Filesystem Hierarchy
Standard. So, no file is installed under Apache root document directory
(Refer to Apache configuration files to locate it).
If you're upgrading from OCS Inventory NG Server 1.01 and previous, YOU
MUST REMOVE (or move) directories 'ocsreports' and 'download' from Apache
root document directory.
If you choose to move directory, YOU MUST MOVE 'download' directory to
Administration Server writable/cache directory (by default
/var/lib/ocsinventory-reports), especialy if you use deployement feature.
Do you wish to continue ([y]/n)?y

Where to copy Administration Server static files for PHP Web Console
[/usr/share/ocsinventory-reports] ?

Where to create writable/cache directories for deployement packages,
IPDiscover and SNMP [/var/lib/ocsinventory-reports] ?

 

3 Configuring OCS Inventory NG Server 2

Creating a MySQL database:

First, we need to open mysql shell:

mysql -u root -p"secret"

Then create the database named ocsweb, and grant permissions to user ocs, with password ocs:

CREATE DATABASE ocsweb;
GRANT ALL ON ocsweb.* to 'ocs'@'localhost' identified by 'ocs';

If you want, you can change these parameters (database name, username or password). This is the default of ocs.

Now, point your browser to ocsreports interface, to manage the server with the administration tool:

http://server-ip/ocsreports/

The default user is "admin" and password is "admin".

Finally, we must delete the install script:

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

Now, all you have to do is configure the server with the machine options. Install the agents on the network computers pointing the server ip on them.
For more information, take a look at the wiki of OCS clicking here.

 

References

OCS Inventory: http://wiki.ocsinventory-ng.org/index.php/Documentation:Main


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by A Niny Mouse (not registered) on Fri, 2014-07-18 17:37.

This tutorials almost completely works however it neglects to let you know you need to install PHP and Apache, also the epel 5 repo doesn't allow you to install a few of the other services this guide wants you to install.

 Solution: INSTALL EPEL 6 NOT 5 one link that works for now is this

www.mirrorservice.org/sites/download.fedora.redhat.com/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

 DO NOT FORGET to "yum install -y php httpd"

 also as noted below by Younten Jamtsho php-mbstring is also required

"yum install -y php-mbstring" will fix this issue

Any other issues can usually be solved by disabling SELINUX and IPTABLES

and now this tutorial is up to date and I confirm I have OCS running on CentOS 6.5 64bit

Submitted by Joey (not registered) on Wed, 2013-07-03 01:53.

Hi,

 

I installed and configured this using the documentation / wiki that you post here but When i try to restart the httpd this error came :

 

[root@localhost OCSNG_UNIX_SERVER-2.0rc1]# systemctl status httpd.service
httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
   Active: failed (Result: exit-code) since Wed 2013-07-03 08:27:14 PHT; 1min 27s ago
  Process: 7951 ExecStop=/usr/sbin/httpd $OPTIONS -k graceful-stop (code=exited, status=1/FAILURE)
  Process: 7949 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
   Status: "Total requests: 1; Current requests/sec: 0; Current traffic:   0 B/sec"

Jul 03 08:27:14 localhost.localdomain httpd[7949]: AH00526: Syntax error on line 303 of /etc/httpd/conf.d/z-ocsinventory-server.conf:
Jul 03 08:27:14 localhost.localdomain httpd[7949]: Unknown Authz provider: SOAP_USER
Jul 03 08:27:14 localhost.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Jul 03 08:27:14 localhost.localdomain httpd[7951]: [Wed Jul 03 08:27:14.874718 2013] [so:warn] [pid 7951] AH01574: module dav_svn_module is ...kipping
Jul 03 08:27:14 localhost.localdomain httpd[7951]: [Wed Jul 03 08:27:14.874784 2013] [so:warn] [pid 7951] AH01574: module authz_svn_module i...kipping
Jul 03 08:27:14 localhost.localdomain httpd[7951]: AH00526: Syntax error on line 303 of /etc/httpd/conf.d/z-ocsinventory-server.conf:
Jul 03 08:27:14 localhost.localdomain httpd[7951]: Unknown Authz provider: SOAP_USER
Jul 03 08:27:14 localhost.localdomain systemd[1]: httpd.service: control process exited, code=exited status=1
Jul 03 08:27:14 localhost.localdomain systemd[1]: Failed to start The Apache HTTP Server.
Jul 03 08:27:14 localhost.localdomain systemd[1]: Unit httpd.service entered failed state.

 

Can you please help me solve this? Thanks in advance

Submitted by Rene Barbier (not registered) on Wed, 2013-11-06 13:31.

Syntax for require has been changed for Apache 2.4.

Change the line that reads
require "SOAP_USER"
into
require user "SOAP_USER"

HTH

Submitted by Anonymous (not registered) on Wed, 2012-04-04 16:55.

For those out there who are unbale to get it for 64-bit systems

$rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm

 

Submitted by Amit Joshi (not registered) on Thu, 2013-04-25 13:32.
Try this URL for RHEL 6: http://ftp.riken.jp/Linux/fedora/epel/6/i386/epel-release-6-8.noarch.rpm
Submitted by Younten Jamtsho (not registered) on Sat, 2012-03-24 08:15.
we also need to install php-mbstring
yum install php-mbstring -y
Submitted by Anonymous (not registered) on Wed, 2011-08-31 09:46.

ERROR: can't write in directory (on dbconfig.inc.php), please set the required rights in order to install ocsinventory (you should remove the write mode after the installation is successfull)

 how can i solve this

Submitted by teleconet (registered user) on Sun, 2013-02-03 09:48.
para ese error, tienes que deshabilitar el SELINUX,  yo tuve el mismo problema y luego de realizar el cambio, me funciona perfectamente.
Submitted by Jonny (not registered) on Sun, 2012-04-01 23:31.

 If anyone gets this error after setting the file permissions correctly, try disabling SELinux; that is what worked for me ;-)

setenforce 0

Submitted by Anonymous (not registered) on Wed, 2011-03-23 20:20.

DearTeam,

Now we facing the beow error please help me 

Syntax error on line 38 of /etc/httpd/conf.d/ocsinventory-reports.conf:
Invalid command 'php_flag', perhaps misspelled or defined by a module not included in the server configuration
 

 THANKS IN ADVANCE.

PLEASE HELP ME.

 

Submitted by azafefo (not registered) on Tue, 2011-04-19 15:10.

Try this:

yum install php

Good luck!

Submitted by Anonymous (not registered) on Wed, 2011-03-23 19:50.

   Dear Team,

 we follow you all given steps but we not able to access ocsreports interface.

We getting 404 Not Fount error.

My apache log details given below.

192.168.137.1 - - [24/Mar/2011:23:53:00 +0530] "GET /ocsreports/ HTTP/1.1" 404 2                                                                                        89 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110                                                                                        303 Firefox/3.6.15"
192.168.137.1 - - [24/Mar/2011:23:53:00 +0530] "GET /favicon.ico HTTP/1.1" 404 2                                                                                        89 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110                                                                                        303 Firefox/3.6.15"
192.168.137.1 - - [24/Mar/2011:23:53:00 +0530] "GET /favicon.ico HTTP/1.1" 404 2                                                                                        89 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110                                                                                        303 Firefox/3.6.15"
192.168.137.1 - - [24/Mar/2011:23:53:03 +0530] "GET /favicon.ico HTTP/1.1" 404 2                                                                                        89 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110                                                                                        303 Firefox/3.6.15"
192.168.137.1 - - [25/Mar/2011:00:07:06 +0530] "GET /ocsreports/ HTTP/1.1" 404 2                                                                                        89 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110                                                                                        303 Firefox/3.6.15"
192.168.137.1 - - [25/Mar/2011:00:07:09 +0530] "GET /ocsreports/ HTTP/1.1" 404 2                                                                                        89 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110                                                                                        303 Firefox/3.6.15"
192.168.137.1 - - [25/Mar/2011:00:11:05 +0530] "GET /ocsreports/ HTTP/1.1" 404 2                                                                                        89 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110                                                                                        303 Firefox/3.6.15"

^E192.168.137.1 - - [25/Mar/2011:00:14:06 +0530] "GET /ocsreports/ HTTP/1.1" 404 289 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110303 Firefox/3.6.15"

please help me.

Submitted by Anonymous (not registered) on Thu, 2011-05-19 13:22.
restart Apache daemon
Submitted by Nur (not registered) on Wed, 2011-11-16 08:54.
i already restart apache. no error come out. but only white screen appear. .... plz help me
Submitted by Kapil Ahire (not registered) on Wed, 2013-06-26 11:55.

I am also facing same error, i have  installed php again eoor gone  But now apache is not starting up .please suggest on the same