Install ocs ubuntu server

From OCS Inventory NG
Jump to: navigation, search


This documentation is outdated. Some of the instructions may not be correct with latest version of OCS Inventory NG and Ubuntu. Please read it with care and refert to the main documentation :

Install Apache

apt-get install apache2 apache2-doc

Add this at the last line of /etc/apache2/apache2.conf

ServerName $hostname_do_seu_servidor

On /etc/apache2/httpd.conf, add the following line to add UTF-8 support

AddDefaultCharset utf-8

Install MySQL

apt-get install mysql-server

Should you install the web and database servers in more than one machine, run the following command in order to allow a remote connection to MySQL.


To allow for remote database access, you’ll also need to comment the following line in /etc/mysql/my.cnf

#bind-address           =

Install PHP

apt-get install php5 php5-mysql php5-gd

To do a simple PHP test, run the following commands then load http://$seu_servidor/info.php on your browser

echo "<?" > /var/www/info.php
echo "  phpinfo()" >> /var/www/info.php
echo "?>" >> /var/www/info.php
sudo /etc/init.d/apache2 restart

Install Perl

apt-get install libapache2-mod-perl2 libxml-simple-perl libcompress-zlib-perl libapache-dbi-perl libnet-ip-perl libsoap-lite-perl

Install prerequisites for the IPDISCOVER feature

apt-get install libc6-dev

Install OCS Server version 2.0

Download the tarball

Decompress the tarball and run the installation script

tar -zxvf OCSNG_UNIX_SERVER-2.0.tar.gz

Answer the installer questions

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/apache2] ? <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 [1] ? <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>

You can ignore the followinf error message, as per

Checking for XML::Entities PERL module...
*** Warning: PERL module XML::Entities is not installed !
This module is only required by OCS Inventory NG SOAP Web Service.

Finish the installation by answering the following questions

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>
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 deployement packages and IPDiscover [/var/lib/ocsinventory-reports] ? <ENTER>

Configure the servers

Create a VirtualHost for OCS. Add the following lines to the end of /etc/apache2/sites-available/default

Alias / "/usr/share/ocsinventory-reports/ocsreports/" 
   <Directory "/usr/share/ocsinventory-reports/ocsreports/"> 
       Options Indexes MultiViews FollowSymLinks 
       AllowOverride None 
       Order allow,deny 
       Allow from all 

Reboot the Apache server

/etc/init.d/apache2 restart

Edit /usr/share/ocsinventory-reports/ocsreports/ and add the name and password for the user created for MySQL


Open the following URL in your browser, check the information and click Send


For secutiry reasons, move the following to some web-inaccessible location


To make administrative TAGs updateable by the client edit /etc/apache2/conf.d/z-ocsinventory-server.conf and alter the following directive from 0 to 1


Installation successful

Load the following URL and enter admin in both username and password fields