Extreme Thinking
Centos 7 安裝 OCS (OCS-NG Inventory )

2017-02-16


紀錄一下 :

yum install  make mod_perl php gcc httpd php-pclzip 
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 -y install mariadb-server mariadb
systemctl start mariadb.service
systemctl enable mariadb.service
/usr/bin/mysql_secure_installation
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
systemctl start httpd
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 -y
yum install perl-XML-SAX perl-Apache-DBI perl-Apache2-SOAP -y
 yum install httpd-devel -y
#cpan
>install YAML
>install ModPerl::MM
>install Apache2::SOAP
>install Apache::DBI
yum install git -y
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
 ./setup.sh
..........
用內定的就可了
..........

輸入資料後如出現 GUI 版本問題

修改 : /usr/share/ocsinventory-reports/ocsreports/var.php 內的 GUI_VER 為 7011

如要改DB 的帳號 ocs 進去 sql 後:

UPDATE mysql.user SET Password = PASSWORD('ocssecret') WHERE User = 'ocs';  
改 : dbconfig.inc.php
define("PSWD_BASE","ocssecret");
改 : /etc/httpd/conf.d/z-ocsinventory-server.conf
PerlSetVar OCS_DB_PWD ocssecret

完成 :

ps : 要關閉 SElinux 及 開 firewall 80 port

firewall-cmd --get-active-zones
internal

firewall-cmd --zone=internal --add-port=80/tcp --permanent
firewall-cmd --reload