installocsinventory2.1

4
INSTALL OCS INVENTORY2.1.DOCX 26 de octubre de 2013 Ocs Inventory Página 1 Install OCS Inventory-NG 2.0 on CentOS 6 This guide is based on a fresh install of CentOS 6.2 from the Minimal ISO. It assumes you have already performed basic system configuration steps such as setting up networking, time synchronisation, etc. 1. Install the EPEL repo for some pre-requisites 1. rpm -ivH http://mirror.globo.com/epel/6/i386/epel-release-6- 8.noarch.rpm 2. Edit '/etc/yum.repos.d/epel.repo' and inside the [epel] stanza, set enabled=0 3. Update the base system 1. yum update -y 4. Install pre-requisite packages 1. yum install -y make wget httpd mysql mysql-server php php-gd php- mysql php-mbstring mod_perl perl-XML-Simple perl-Net-IP perl- SOAP-Lite perl-DBI perl-DBD-MySQL 2. yum install -y --enablerepo=epel perl-Apache-DBI perl-Apache2- SOAP perl-XML-Entities 3. yum install php-pecl-zip (igual a php-common) 5. Perform the initial MySQL setup 1. mysql_install_db 2. chkconfig --level 345 mysqld on 3. service mysqld start 4. mysql_secure_installation o Press Enter for current password o Type a password for the 'root' user o Re-enter your new 'root' password o Y to remove anonymous user o Y to disallow remote logon o Y to remove the test database o Y to reload the privilege tables

Upload: anderson-vasquez

Post on 01-Jan-2016

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: InstallOCSInventory2.1

INSTALL OCS INVENTORY2.1.DOCX 26 de octubre de 2013

Ocs Inventory Página 1

Install OCS Inventory-NG 2.0 on CentOS 6

This guide is based on a fresh install of CentOS 6.2 from the Minimal ISO. It assumes you have already performed basic system configuration steps such as setting up networking, time synchronisation, etc.

1. Install the EPEL repo for some pre-requisites

1. rpm -ivH http://mirror.globo.com/epel/6/i386/epel-release-6-8.noarch.rpm

2. Edit '/etc/yum.repos.d/epel.repo' and inside the [epel] stanza, set enabled=0

3. Update the base system

1. yum update -y

4. Install pre-requisite packages

1. yum install -y make wget httpd mysql mysql-server php php-gd php-mysql php-mbstring mod_perl perl-XML-Simple perl-Net-IP perl-SOAP-Lite perl-DBI perl-DBD-MySQL

2. yum install -y --enablerepo=epel perl-Apache-DBI perl-Apache2-SOAP perl-XML-Entities

3. yum install php-pecl-zip (igual a php-common)

5. Perform the initial MySQL setup

1. mysql_install_db

2. chkconfig --level 345 mysqld on

3. service mysqld start

4. mysql_secure_installation

o Press Enter for current password

o Type a password for the 'root' user

o Re-enter your new 'root' password

o Y to remove anonymous user

o Y to disallow remote logon

o Y to remove the test database

o Y to reload the privilege tables

Page 2: InstallOCSInventory2.1

INSTALL OCS INVENTORY2.1.DOCX 26 de octubre de 2013

Ocs Inventory Página 2

2. Create the database for OCS. Replace <somepassword> with your own password (Hint: Don't use 'ocs')

1. mysql -u root -p

2. CREATE DATABASE ocs;

3. GRANT ALL PRIVILEGES ON ocs.* to ocs@localhost IDENTIFIED BY '<somepassword>';

4. FLUSH PRIVILEGES;

5. QUIT

2. Install OCS (Based on OCS 2.0.4)

1. cd ~

2. wget http://launchpad.net/ocsinventory-server/stable-2.0/2.0.4/+download/OCSNG_UNIX_SERVER-2.0.4.tar.gz

3. tar -xvzf OCSNG_UNIX_SERVER*.tar.gz

4. cd OCSNG_UNIX_SERVER*

5. sh ./setup.sh

o Y to continue

o Enter to accept 'localhost' as MySQL server

o Enter to accept '3306' as MySQL port

o Enter to accept '/usr/sbin/httpd' as Apache binary

o Enter to accept '/etc/httpd/conf/httpd.conf' as Apache config file

o Enter to accept 'apache' as Apache user

o Enter to accept 'apache' as Apache group

o Enter to accept '/etc/httpd/conf.d/' as Apache include directory

o Enter to accept '/usr/bin/perl' as Perl interpreter

o Y to install Communication server

o Enter to accept '/var/log/ocsinventory-server' as log directory

o Y to continue with installation

o Y to rename OCS server config to 'z-ocsinventory-server.conf'

o Y to installation Administration server

o Y to continue

o Enter '/var/www' as location for Administration Server static files location

o Enter '/var/www' as location for Download location

Page 3: InstallOCSInventory2.1

INSTALL OCS INVENTORY2.1.DOCX 26 de octubre de 2013

Ocs Inventory Página 3

2. Update database settings for OCS Server

o Edit '/etc/httpd/conf.d/z-ocsinventory-server.conf'

▪ Change line 26 (OCS_DB_NAME) from 'ocsweb' to 'ocs'

▪ Change line 27 (OCS_DB_LOCAL) from 'ocsweb' to 'ocs'

▪ Change line 31 (OCS_DB_PWD) from 'ocs' to whatever you chose for your MySQL 'ocs' user password

3. Update IPTables config to allow HTTP on port 80

o Edit '/etc/sysconfig/iptables'

▪ At line 11 (or just before the final 3 lines) insert

1. -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

o Save the file and exit then run

1. service iptables restart

2. Start Apache

1. chkconfig --level 345 httpd on

2. service httpd start

2. Perform initial OCS config

Page 4: InstallOCSInventory2.1

INSTALL OCS INVENTORY2.1.DOCX 26 de octubre de 2013

Ocs Inventory Página 4

o Visit http://yourserver/ocsreports

o You will be shown the database configuration page

▪ Database: ocs

▪ Username: ocs

▪ Password: <somepassword>

▪ Hostname: localhost

o Click submit and wait a few seconds while the database is setup by the installation script

o You will get a page which should show that everything was successful. You will be prompted to enter a string to show an agent the first time it contacts the OCS server. I leave it blank and click submit.

o You will get a page informing you that installation is complete.

o Delete the installation script

1. rm -f /var/www/ocsreports/install.php

o Visit http://yourserver/ocsreports to login

▪ Username: admin

▪ Password: admin

o You should change your 'admin' password after logging in.

o OCS Server installation is complete. You can now begin deploying your agents.