Setup OCS Inventory 2.1.2 on CentOS 6


System:
CentOS 6.6,ip address: 192.168.99.30, SELINUX=disabled

1.Install Apache,PHP,MySQL and pre-requisite packages.
# yum groupinstall -y "Development tools"
# yum groupinstall -y "Web Server"
# yum groupinstall -y "MySQL Database server"

2.Install EPEL Repository and set enabled=0
# cd /opt
# wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm --import https://fedoraproject.org/static/0608B895.txt
# rpm -ivh epel-release-6-8.noarch.rpm
# vi /etc/yum.repos.d/epel.repo

3.Iptables add ports 80 for Apache & 3306 for MySql
# iptables -I INPUT -m multiport -p tcp --dport 80,3306 -j ACCEPT
# service iptables save
# service iptables restart

or set firewall using command system-config-firewall-tui

4.Start Apache and MySQL service and set to start on boot
# service httpd start && service mysqld start
# chkconfig httpd on && chkconfig mysqld on

5.Secure MySQL root user
# /usr/bin/mysql_secure_installation

6.Install PhpMyAdmin in order to easy manage MySql (Optional)
# yum --enablerepo=epel -y install phpmyadmin

Add my subnet to access phpMyAdmin:
# vi /etc/httpd/conf.d/phpMyAdmin.conf

7.Install OCS Inventory pre-requisite packages
# yum install -y php php-gd php-mysql php-mbstring perl-XML-Simple perl-Net-IP perl-SOAP-Lite httpd-devel
# yum install -y --enablerepo=epel perl-Apache-DBI perl-Apache2-SOAP perl-XML-Entities

8.Download and setup OCS Inventory
# cd /opt
# wget https://launchpad.net/ocsinventory-server/stable-2.1/2.1.2/+download/OCSNG_UNIX_SERVER-2.1.2.tar.gz
# tar –xvzf OCSNG_UNIX_SERVER-2.1.2.tar.gz
# cd OCSNG_UNIX_SERVER-2.1.2
# sh setup.sh

# service httpd restart

9.Perform initial OCS config then login to OCS (Note: It automatically create database ocsweb, with login: ocs,password: ocs)
setup-ocs-1

setup-ocs-2

setup-ocs-3

setup-ocs-4

10. Clear up OCS Inventory security warning
setup-ocs-5
Delete install.php (or can rename it)
# rm /usr/share/ocsinventory-reports/ocsreports/install.php

Change default admin password
setup-ocs-6

setup-ocs-7

Change default MySQL ocs password
-Using phpMyAdmin find user ocs then change the password.
-Change MySQL user ocs password in /usr/share/ocsinventory-reports/ocsreports/dbconfig.inc.php
# vi /usr/share/ocsinventory-reports/ocsreports/dbconfig.inc.php

-Change MySQL user ocs password in /etc/httpd/conf.d/z-ocsinventory-server.conf

Repair error below
setup-ocs-8

# chmod -R 777 /usr/share/ocsinventory-reports/ocsreports/plugins/main_sections/conf/old_conf/
# chmod -R 777 /usr/share/ocsinventory-reports/ocsreports/plugins/main_sections/conf/sadmin_config.txt

Finish!!

References:
http://www.ocsinventory-ng.org/en/
http://wiki.ocsinventory-ng.org/index.php/Documentation:Server
http://phreek.org/guides/install-ocs-inventory-ng-20-on-centos-6
http://www.vr4servers.com/how-to-install-configure-ocsinventory-2-1-server-on-centos-6-5-64bit/
https://www.howtoforge.com/how-to-install-ocs-inventory-ng-server-2-on-centos-5.5

 


Related posts:

1 Comment

Leave a Reply

Your email address will not be published. Required fields are marked *