Centos 7 | OCSNG | 官方文档 Setting up OCS Inventory Server | 错误汇总

官方文档

Setting up OCS Inventory Server
Setting up OCS Inventory Server with RPM

我按照别人博客安装的记录

centos7 | OCSNG资产管理系统安装配置 | ocs inventory | 出错汇总
这里有我的一些出错集合,当然还有些错误没有记录在内,大家可以翻看我Linux分栏的博客。欢迎大家指出错误之处,因为刚刚接触Unix类系统不久。

正文

配置yum环境

需要配置epel,remi,ocsinventory源,官方提供如下:

wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
wget https://rpms.remirepo.net/enterprise/remi-release-7.rpm
wget https://rpm.ocsinventory-ng.org/ocsinventory-release-latest.el7.ocs.noarch.rpm
yum install ocsinventory-release-latest.el7.ocs.noarch.rpm epel-release-latest-7.noarch.rpm remi-release-7.rpm

源配置,大家可以参考我这篇博客。
CentOS 7| 配置yum源(阿里) | 官方文档

安装OCS Inventory server

Install with RPM 失败了

yum install ocsinventory

我这里提示

错误:软件包:ocsinventory-reports-2.6.0-2.el7.ocs.noarch (ocsinventory)
          需要:php-phpmailer6

yum库中没有找到这个包。所以没有尝试官网这个with RPM的安装文档了,考虑按照之前博客方式,参考官方文档进行安装。

Setting up OCS Inventory Server

官方文档Setting up OCS Inventory Server

环境

安装apache和数据库
yum install httpd
yum install MariaDB MariaDB-client

启动服务

systemctl restart httpd
systemctl enable httpd
systemctl start mariadb
systemctl enable mariadb

修改数据库初始密码,创建数据库。由于mariadb没有初始密码。

mysql -uroot -p 回车
回车

修改初始密码、授予权限

update user set password=password("123456") where user="root";
flush privileges;  
create database ocsweb;            
GRANT ALL PRIVILEGES ON ocsweb.* TO ocs@localhost IDENTIFIED BY 'ocs';
GRANT ALL PRIVILEGES ON ocsweb.* TO ocs@'%' IDENTIFIED BY 'ocs';
flush privileges;
quit               
perl&php包
yum install mod_perl php-common php-gd php-pecl-zip php-pear-Net-Curl.noarch php-mbstring php-soap php-pear-SOAP.noarch php-xml php-xmlrpc php-xmlseclibs.noarch perl-XML-Simple php-pecl-yaml  perl-XML-Simple-DTDReader perl-Compress-Zlib perl-DBI perl-DBD-MySQL  perl-Apache-DBI.noarch perl-Net-IP perl-SOAP-Lite perl-Archive-Zip perl-Mojolicious perl-Plack perl-XML-Entities perl-Switch perl-YAML  perl-SOAP-* perl-XML-* perl-Compress-* perl-DBI-* perl-Apache* perl-Net-* perl-SOAP-* perl-WWW-Curl perl-Plack-Middleware-* perl-Archive-* perl-YAML-* perl-XML-*

部分包

perl -MCPAN -e shell
install Mojolicious::Lite
install Plack::Handler

安装OCS

后面有提示我不能打开这个文件夹,影响了安装

mkdir -p /etc/ocsinventory-server/plugins
mkdir -p /home/hadoop/perl5/lib/perl5
cd /opt
wget https://github.com/OCSInventory-NG/OCSInventory-ocsreports/releases/download/2.6/OCSNG_UNIX_SERVER_2.6.tar.gz
tar xvf OCSNG_UNIX_SERVER_2.6.tar.gz
cd OCSNG_UNIX_SERVER_2.6
./setup.sh

注意更改:
Where to copy Administration Server static files for PHP Web Console
[/usr/share/ocsinventory-reports] ?/var/www/html/


错误一:

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 10.108.22.237. Set the 'ServerName' directive globally to suppress this message
vim /etc/httpd/conf/httpd.conf

找到相应的servername行,添加

ServerName localhost

错误二:
如果有提示缺包,安装就好了

错误三:

Scalar value @args[$i] better written as $args[$i] at /root/perl5/lib/perl5/Apache/Ocsinventory/Interface/AssetCategory.pm line 54.

按照错误信息将代码更改即可。

安装成功后会提示:

Setup has created a log file /opt/OCSNG_UNIX_SERVER_2.6/ocs_server_setup.log. Please, save this file.
If you encounter error while running OCS Inventory NG Management server,
we can ask you to show us its content !

DON'T FORGET TO RESTART APACHE DAEMON !

Enjoy OCS Inventory NG ;-)

记得测试一下数据库能否正常进。

错误一

Access denied for user 'root'@'localhost'
mysql> grant all privileges on *.* to root@'%' identified by '密码';
mysql> flush privileges;

启动服务

chown -R apache. /var/www/html/
[root@slave2 html]# systemctl start httpd
[root@slave2 html]# systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
[root@slave2 html]# systemctl restart mariadb
[root@slave2 html]# systemctl enable mariadb
Created symlink from /etc/systemd/system/mysql.service to /usr/lib/systemd/system/mariadb.service.

打开网页

http://localhost/ocsreports/

在这里插入图片描述
这里出现了数据库更新的选项,点击即可
在这里插入图片描述

最后用admin/admin登陆
在这里插入图片描述

发布了134 篇原创文章 · 获赞 57 · 访问量 5万+

猜你喜欢

转载自blog.csdn.net/stone_fall/article/details/102530287
今日推荐