安装说明
系统环境:Centos6.4X64
安装方式:yum安装和源码安装
年底激将到来,公司又开始盘点资产。当初购买的软件的版权现在用了多少套了呢?公司那些电脑配置已经变更了呢?现在新版本的windows 8已经上市,公司需要windows 8作为测试平台,那些电脑可以升级为window 8呢?如何快速统计公司一千多台电脑的资产呢?这不仅对资产管理员的考验,更是对系统管理员的考验。
为了能够快速盘点公司的资产,能够快速完成资产的统计,资产管理软件将必不可少。用什么资产管理软件呢?
有微软System Center Configuration Manager,在软件方面和硬件管理方面都做的很不错,缺点就是要收费
免费软件适合比较小型企业,而且良莠不齐。
开源软件,在centos 安装GLPI+OCS Inventory,不仅成本投入比较少,而且还适合大型企业使用,缺点是要自己维护
我们就在centos 6.4安装和配置GLPI+OCS Inventory
1.安装Centos扩展
[root@CentOS ~]# rpm -ivh http://mirrors.sohu.com/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm
2.配置LAMP环境
[root@CentOS ~]# yum -y install glibc-devel glibc-headers autoconf automake bzip2-devel zlib-devel ncurses-devel libjpeg-devel libpng-devel libtiff-devel freetype-devel pam-devel openssl-devel libXpm libX11 libxml2-devel gettext-devel pcre-devel mysql mysql-server httpd php php-devel php-gd php-pecl-zip php-mysql php-devel php-pear php-imap php-ldap php-odbc php-xml php-xmlrpc mod_perl httpd mysql mysql-server php-mysql perl mod_perl perl-XML-Simple perl-Compress-Zlib perl-DBI perl-DBD-MySQL perl-Net-IP php-mbstring perl-CPAN
[root@CentOS ~]# wget http://www.cpan.org/authors/id/G/GA/GAAS/Digest-SHA1-2.13.tar.gz
[root@CentOS ~]# tar -zxvf Digest-SHA1-2.13.tar.gz
[root@CentOS ~]# cd Digest-SHA1-2.13
[root@CentOS Digest-SHA1-2.13]# perl Makefile.PL
[root@CentOS Digest-SHA1-2.13]# make && make install
[root@CentOS Digest-SHA1-2.13]# cd ~
[root@CentOS ~]# wget http://www.cpan.org/authors/id/P/PH/PHRED/Apache-DBI-1.12.tar.gz
[root@CentOS ~]# tar -zxvf Apache-DBI-1.12.tar.gz
[root@CentOS ~]# cd Apache-DBI-1.12
[root@CentOS Apache-DBI-1.12]# perl Makefile.PL
[root@CentOS Apache-DBI-1.12]# make && make install
[root@CentOS Apache-DBI-1.12]# cd ~
[root@CentOS ~]# wget http://www.cpan.org/authors/id/S/SI/SIXTEASE/XML-Entities-1.0001.tar.gz
[root@CentOS ~]# tar -zxvf XML-Entities-1.0001.tar.gz
[root@CentOS ~]# cd XML-Entities
[root@CentOS XML-Entities]# perl Makefile.PL
[root@CentOS XML-Entities]# make && make install
[root@CentOS ~]# wget http://www.cpan.org/authors/id/A/AD/ADAMK/Class-Inspector-1.28.tar.gz
[root@CentOS ~]# tar -zxvf Class-Inspector-1.28.tar.gz
[root@CentOS ~]# cd Class-Inspector-1.28
[root@CentOS Class-Inspector-1.28]# perl Makefile.PL
[root@CentOS Class-Inspector-1.28]# make && make install
[root@CentOS Class-Inspector-1.28]# cd ~
[root@CentOS ~]# wget http://www.cpan.org/authors/id/P/PH/PHRED/IO-SessionData-1.03.tar.gz
[root@CentOS ~]# cd IO-SessionData-1.03
[root@CentOS IO-SessionData-1.03]#perl Makefile.PL
[root@CentOS IO-SessionData-1.03]#make && make install
[root@CentOS IO-SessionData-1.03]# cd ~
[root@CentOS ~]# wget http://www.cpan.org/authors/id/A/AD/ADAMK/Task-Weaken-1.04.tar.gz
[root@CentOS ~]# cd Task-Weaken-1.04
[root@CentOS Task-Weaken-1.04]# perl Makefile.PL
[root@CentOS Task-Weaken-1.04]# make && make install
[root@CentOS Task-Weaken-1.04]# cd ~
[root@CentOS ~]# wget http://www.cpan.org/authors/id/P/PH/PHRED/SOAP-Lite-1.08.tar.gz
[root@CentOS ~]# tar -zxvf SOAP-Lite-1.08.tar.gz
[root@CentOS ~]# cd SOAP-Lite-1.08
[root@CentOS SOAP-Lite-1.08]#perl Makefile.PL
[root@CentOS SOAP-Lite-1.08]#make && make install
[root@CentOS SOAP-Lite-1.08]# cd ~
[root@CentOS ~]# service mysqld start
[root@CentOS ~]# service httpd start
[root@CentOS ~]# chkconfig mysqld on
[root@CentOS ~]# chkconfig httpd on
3.配置数据库
把max_allowed_packet设置为20M
[root@CentOS ~]# vi /etc/my.cnf
在[mysqld]下加上max_allowed_packet=20M,保存重启mysql
max_allowed_packet = 20M
[root@CentOS ~]# mysql
mysql> create database ocs charset utf8;
mysql> grant all on ocs.* to 'ocs'@'localhost' identified by 'arthur';
4.配置web
[root@CentOS ~]# vi /etc/httpd/conf/httpd.conf
注:设置一个ServerName,启动http服务的时候就不会有提示
ServerName ocs.ocs.com:80
5.配置php
[root@CentOS ~]# vi /etc/php.ini
把post_max_size和upload_max_filesize大小更改为100M
post_max_size = 100M
upload_max_filesize = 100M
date.timezone = Asia/Chongqing
session.save_path = /var/lib/php/session
[root@CentOS ~]# chown -R apache.apache /var/lib/php/session/
6.配置防火墙
1.关闭selinux
[root@CentOS ~]# vi /etc/selinux/config
把SELINUX= enforcing更改为SELINUX=disable
如果要selinux马上生效,需要输入
[root@CentOS ~]# setenforce 0
2.设置iptable
[root@CentOS ~]# vi /etc/sysconfig/iptables
增加
-AINPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
7.安装OCSNG
[root@CentOS ~]# tar -zxvf OCSNG_UNIX_SERVER-2.1rc1.tar.gz
[root@CentOS ~]# cd OCSNG
[root@CentOS OCSNG]# chmod 755 setup.sh
[root@CentOS OCSNG]# ./setup.sh
脚本一路回车即可,如有错误请检查所有Perl模块是否都安装好
提示如下信息证明已经安装成功
DON'T FORGET TO RESTART APACHE DAEMON !
Enjoy OCS Inventory NG ;-)
8.重启服务
[root@CentOS ~]# service httpd restart
[root@CentOS ~]# service mysqld restart
9.配置OCS
在浏览器输入http://IP//ocsreports/install.php
输入数据库的名称,点击提交
没有问题点击提交数据
10.删除install.php文件
[root@CentOS ~]# rm /var/www/html/ocsreports/install.php
至此整个ocs服务端安装完成,后续将安装GLPI
本文出自 “谢海棠” 博客,转载请与作者联系!