标签:zip ocsinventory
OCSInventory Server 安装记录
OS:centos 7 core
IP:192.168.8.108
hostname:OCSInventory
user root:ocsadmin
usr ocs:ocsadmin
yum install openssh vim wget -y#ssh vim wget yum update
关闭selinux
vim /etc/selinux/config SELINUX=disable
关闭防火墙
systemctl stop firewalld.service systemctl disable firewalld.service
reboot
yum install make mod_perl php gcc httpd php-pclzip No package mod_perl available No package php-pclzip
不急等会再安装一次
安装mariadb数据库
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm yum install mod_perl php-pclzip #上面的那两个包已经可以安装上了 yum -y install mariadb-server mariadb #安装mariadb数据库 systemctl start mariadb.service #启动数据库 systemctl enable mariadb.service #设置自己启动 /usr/bin/mysql_secure_installation #设置数据库密码第一个直接按回车,后面会提示让你设置数据库用户root的密码
更新php
rpm -Uvh http://download.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm yum repolist all yum search yum-config-manager yum install yum-utils yum-config-manager --enable remi yum-config-manager --enable remi-php71 yum update php*
继续安装各种包
yum install php-mbstring php-gd php-xml php-pecl-memcached php-mysql php-soap -y yum -y install perl-XML-Simple perl-Compress-Zlib perl-DBI perl-DBD-MySQL perl-Net-IP perl-SOAP-Lite mod_perl perl-Digest-SHA1 perl-Test-Simple
systemctl enable httpd 设置httpd开机启动 systemctl start httpd
启动apache
安装perl相关的包
yum install mod_perl perl-CPAN perl-Archive-Zip perl-Net-IP perl-XML-Simple perl-SOAP-Lite.noarch perl-ExtUtils-Embed perl-XML-Entities yum install perl-XML-SAX perl-Apache-DBI perl-Apache2-SOAP yum install httpd-devel
#cpan >install YAML >install ModPerl::MM >install Apache2::SOAP >install Apache::DBI
安装git
yum install git cd /home/ocs/ git clone https://github.com/OCSInventory-NG/OCSInventory-Server.git OCSInventory-Server cd OCSInventory-Server git clone https://github.com/OCSInventory-NG/OCSInventory-ocsreports.git ocsreports
安装OCSInventory 现在是2.3.1版本
./setup.sh
其中一个地方需要输入路经
Where to copy Administration Server static files for PHP Web Console [/usr/share/ocsinventory-reports]?/var/www/html/
其它一路回车就行
Enjoy OCS Inventory NG ;-) 出现 systemctl restart httpd.service
登陆
SECURITY ALERT! Your install.php exists in your installation directory (by default : /usr/share/ocsinventory-reports/ocsreports). The default SQL login/password is set on your database: ocsweb
此处错误
OCS的WIKI页面有相关办法
下面说一个棘手的问题
点击OCSInventory Plugins页面出现错误的解决办法
当我们点到Plugins这个页面时会出现以下提示,这是zip模块没有安装
Please install the following modules in order to get this feature working :
- ZipArchive
安装比较麻烦
下面提供一种zip模块的安装办法
安装zip模块依赖于libzip 而yum安装的libzip版太低无法和zip兼容所以
yum remove libzip #移除libzip yum安装的是0.10版太低了,现在都1.3版了 cd /home/ocs wget https://libzip.org/download/libzip-1.3.0.tar.gz wget http://pecl.php.net/get/zip-1.15.1.tgz
tar -zxvf libzip-1.3.0.tar.gz cd libzip-1.3.0 ./configure
提示configure:error:ZLIB version too old please install at least v1.1.2
实际上是zlib-devel模块没有安装
yum install zlib-devel
cd libzip-1.3.0 ./configure make && make install cd ..
tar -zxvf zip-1.15.1 yum install php-devel phpize ./configure --with-php-config=/usr/bin/php-config#此处写你自己的php-config目录 make && make install
提示
/usr/local/include/zip.h:59:21: fatal error:zipconf.h:No such file or directory
找到zip.h 和zipconf.h两个文件
修改zip.h文件
vim zip.h #incloud <zipconf.h> 改为 #incloud </usr/local/lib/libzip/include/zipconf.h>#zipconf.h的路经
make && make install
修改php.ini
vim /etc/php.ini extension = /usr/lib64/php/modules/zip.so zlib.output_compression=On
重启httpd
systemctl restart httpd.service
到此不再有错误提示
Centos 7 安装OCSInventory NG 2.3.1全记录
标签:zip ocsinventory
原文地址:http://chaozhong.blog.51cto.com/1074869/1979130