分类: LINUX
2014-08-07 16:25:33
OCS inventory NG + GLPI 是一款好用的资产管理系统,但是网上的安装教程不太完整,因此,特写此文,方便查阅。
因为ocsng安装时需要写权限,所以我们需要先关闭CentOS的selinux;因为ocsng运行时网络数据会被iptables阻挡,所以我们需要先关闭CentOS的iptalbes。
编辑/etc/selinux/config文档,把第6行的enforcing改为disabled,保存,重启。
点击(此处)折叠或打开
- # This file controls the state of SELinux on the system.
- # SELINUX= can take one of these three values:
- # enforcing - SELinux security policy is enforced.
- # permissive - SELinux prints warnings instead of enforcing.
- # disabled - SELinux is fully disabled.
- SELINUX=enforcing
- # SELINUXTYPE= type of policy in use. Possible values are:
- # targeted - Only targeted network daemons are protected.
- # strict - Full SELinux protection.
- SELINUXTYPE=strict
关闭iptalbes,命令行输入:(2).install mysql
点击(此处)折叠或打开
- #关闭iptables
- service iptables stop;
- #开机不启动iptables
- chkconfig iptables off;
在命令行中输入:(3).install apache
点击(此处)折叠或打开
- #安装mysqld
- yum -y install mysql mysql-server;
- #设置开机启动
- chkconfig --levels 235 mysqld on;
- #运行
- /etc/init.d/mysqld start;
- #设置密码
- mysql_secure_installation;
- #重启
- service mysqld restart;
在命令行中输入:(4).install php
点击(此处)折叠或打开
- #安装apache
- yum –y install httpd;
- #设置开机启动
- chkconfig --levels 235 httpd on;
- #运行
- /etc/init.d/httpd start;
在命令行中输入:
点击(此处)折叠或打开
- #查看php是否已安装
- rpm -qa php;
- #安装php
- yum –y install php;
- #重启apache
- /etc/init.d/httpd restart;
- #安装php支持
- yum install php-mysql php-common php-mbstring php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc;
- #重启apache
- /etc/init.d/httpd restart;
在命令行输入:(2).install other
点击(此处)折叠或打开
- #查看perl是否已安装
- rpm -qa perl;
- #安装perl
- yum –y install perl;
- #安装perl-CPAN
- yum –y install perl-CPAN;
- #重启apache
- /etc/init.d/httpd restart;
搭建安装环境,在命令行输入:
点击(此处)折叠或打开
- #搭建安装环境
- yum install -y gcc gcc-c++ 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;
- #重启apache
- service httpd restart
安装Digest-SHA1-2.02,在命令行输入:
安装Apache-DBI,在命令行输入:点击(此处)折叠或打开
- #安装Digest-SHA1-2.02
- tar -zxvf Digest-SHA1-2.02.tar.gz&&
- cd Digest-SHA1-2.02 &&
- perl Makefile.PL &&
- make test &&
- make &&
- make install &&
- cd ..;
配置Perl mod_perl环境:点击(此处)折叠或打开
- #Apache需要手动装的模块:Apache-DBI
- tar -zxvf Apache-DBI-1.12.tar.gz &&
- cd Apache-DBI-1.12 &&
- perl Makefile.PL &&
- make test &&
- make &&
- make install &&
- cd ..;
安装SOAP-Lite,在命令行输入:点击(此处)折叠或打开
- #配置Perl mod_perl环境
- yum install –y perl mod_perl &&
- yum install perl-XML-Simple perl-Compress-Zlib perl-DBI perl-DBD-MySQL perl-Net-IP ;
安装XML-Entities,在命令行输入点击(此处)折叠或打开
- #perl需要手动安装的模块: SOAP-Lite
- tar -zxvf soap-lite_0.69.orig.tar.gz&&
- cd SOAP-Lite-0.69 &&
- perl Makefile.PL &&
- make &&
- make test &&
- make install &&
- cd ..;
点击(此处)折叠或打开
- #perl需要手动安装的模块: XML-Entities
- tar -zxvf XML-Entities-1.0001.tar.gz&&
- cd XML-Entities &&
- perl Makefile.PL &&
- make &&
- make test &&
- make install &&
- cd ..;
在命令行输入:
一路回车,安装。点击(此处)折叠或打开
- #安装ocsng
- tar-zxvf OCSNG_UNIX_SERVER-1.3.2-linvinus-with-utf8_patch.tar.gz
- cd ocsinventory-server-1.3.2/
- sh setup.sh
在地址栏输入 进行安装配置
在命令行输入:
点击(此处)折叠或打开
- #移动GLPI文件夹到wwwroot
- tar zxvf glpi-0.72.4.tar.gz
- mv glpi/ /var/www/html/
- #指定文件夹权限
- chown -R apache:apache /var/www/html
在浏览器里输入:http:glpiServerIp/glpi/install,进入配置向导
在命令行输入:
在浏览器里输入:http:glpiServerIp/glpi/,进入配置向导(设置-插件-),配置插件(安装,启用)点击(此处)折叠或打开
- #移动插件到PLCI的插件目录
- tar zxvf glpi-ocsinventoryng-1.0.2.tar.gz
- mv ocsinventoryng/ /var/www/html/glpi/plugins
在插件-OCS inventory NG中进行其他设置
ALL DONE!!!
pkw11554022015-08-13 13:47:09
怎么我在CentOS7上面安装完后,重启apache报错导致apache不能启动。
报如下错误:
[Thu Aug 13 12:45:24.282873 2015] [perl:error] [pid 8688] Can\'t locate Apache/Ocsinventory/Plugins.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 . /etc/httpd) at (eval 13) line 2.\\n
[Thu Aug 13 12:45:24.283210 2015] [perl:error] [pid 8688]