前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Centos7搭建Glpi+Fusioninventory

Centos7搭建Glpi+Fusioninventory

作者头像
孤鸿
发布2022-09-23 16:51:12
8090
发布2022-09-23 16:51:12
举报
文章被收录于专栏:孤鸿

安装163yum源

代码语言:javascript
复制
yum -y install wget
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
cp CentOS7-Base-163.repo /etc/yum.repos.d/
yum clean all
yum makecache

安装LAMP

关闭firewall:

代码语言:javascript
复制
systemctl stop firewalld.service
systemctl disable firewalld.service

安装配置iptables

代码语言:javascript
复制
yum -y install iptables-services
iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
iptables-save
service iptables save
systemctl restart iptables
systemctl enable iptables

关闭SELINUX

代码语言:javascript
复制
vim /etc/selinux/config
#SELINUX=enforcing #注释掉
#SELINUXTYPE=targeted #注释掉
SELINUX=disabled #增加
setenforce 0 #使配置立即生效

安装Apache

代码语言:javascript
复制
yum install -y httpd
systemctl start httpd
systemctl enable httpd

安装配置Mariadb

代码语言:javascript
复制
yum install -y mariadb mariadb-server
systemctl start mariadb
systemctl enable mariadb
cp /usr/share/mysql/my-huge.cnf /etc/my.cnf
mysql_secure_installation
systemctl restart mariadb.service

安装PHP

代码语言:javascript
复制
yum install -y php
yum install -y php-mysql php-gd libjpeg* php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-bcmath php-mhash
chown apache.apache -R /var/www/html #权限设置
systemctl restart mariadb.service
systemctl restart httpd.service

PS:安装PHP相关模块

代码语言:javascript
复制
yum install php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml  php-xmlrpc
#或者
yum install php-mysql php-gd libjpeg* php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath php-mhash libmcrypt
安装完成,重启mysqld,重启httpd

PS:Apache和PHP配置

Apache配置
代码语言:javascript
复制
vi /etc/httpd/conf/httpd.conf #编辑文件
ServerTokens OS #修改为:ServerTokens Prod (在出现错误页的时候不显示服务器操作系统的名称)
ServerSignature On  #修改为:ServerSignature Off (在错误页中不显示Apache的版本)
Options Indexes FollowSymLinks  #修改为:Options Includes ExecCGI FollowSymLinks(允许服务器执行CGI及SSI,禁止列出目录)
#AddHandler cgi-script .cgi #修改为:AddHandler cgi-script .cgi .pl (允许扩展名为.pl的CGI脚本运行)
AllowOverride None  #修改为:AllowOverride All (允许.htaccess)
AddDefaultCharset UTF-8 #修改为:AddDefaultCharset GB2312 (添加GB2312为默认编码)
Options Indexes MultiViews FollowSymLinks     #修改为 Options MultiViews FollowSymLinks(不在浏览器上显示树状目录结构)
DirectoryIndex index.html index.html.var     #修改为:DirectoryIndex index.html index.htm Default.html Default.htm index.php Default.php index.html.var (设置默认首页文件,增加index.php)
KeepAlive Off      #修改为:KeepAlive On (允许程序性联机)
MaxKeepAliveRequests 100     #修改为:MaxKeepAliveRequests 1000 (增加同时连接数)
/etc/init.d/httpd restart #重启
PHP配置
代码语言:javascript
复制
vi /etc/php.ini
date.timezone = PRC #在946行 把前面的分号去掉,改为date.timezone = PRC
disable_functions = passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,

popepassthru,stream_socket_server,escapeshellcmd,dll,popen,disk_free_space,checkdnsrr,checkdnsrr,getservbyname,getservbyport,disk_total_space,posix_ctermid,

posix_get_last_error,posix_getcwd, posix_getegid,posix_geteuid,posix_getgid, posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid, posix_getppid,posix_getpwnam,posix_getpwuid, posix_getrlimit, posix_getsid,posix_getuid,posix_isatty, posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid, posix_setpgid,posix_setsid,posix_setuid,posix_strerror,posix_times,posix_ttyname,posix_uname
#在386行 列出PHP可以禁用的函数,如果某些程序需要用到这个函数,可以删除,取消禁用。
expose_php = Off #在432行 禁止显示php版本的信息
magic_quotes_gpc = On #在745行 打开magic_quotes_gpc来防止SQL注入
short_open_tag = ON #在229行支持php短标签
open_basedir = .:/tmp/ #在380行 设置表示允许访问当前目录(即PHP脚本文件所在之目录)和/tmp/目录,可以防止php木马跨站

,如果改了之后安装程序有问题,可以注销此行,或者直接写上程序的目录/data/域名/:/tmp/
:wq! #保存退出
/etc/init.d/mysqld restart #重启MySql
/etc/init.d/httpd restart #重启Apche

配置数据库

代码语言:javascript
复制
mysql -uroot -p
mysql> CREATE USER 'glpi'@'%' IDENTIFIED BY 'glpipassword';
mysql> GRANT USAGE ON *.* TO 'glpi'@'%' IDENTIFIED BY 'glpipassword';
mysql> CREATE DATABASE IF NOT EXISTS `glpi` ;
mysql> GRANT ALL PRIVILEGES ON `glpi`.* TO 'glpi'@'%';
mysql> FLUSH PRIVILEGES;
mysql> quit 
systemctl restart mariadb.service

安装glpi

代码语言:javascript
复制
tar -zxvf glpi-0.90.tar -C /var/www/html/
cd /var/www/html/
mv glpi-0.90/ glpi
chmod 777 -R /var/www/html/glpi/config/
chmod 777 -R /var/www/html/glpi/files/

安装fusioninventory插件

代码语言:javascript
复制
tar -zxvf fusioninventory-for-glpi_0.90.1.0.tar.gz -C /var/www/html/glpi/plugins/

安装fusioninventory-agent

PS:软件安装参考http://fusioninventory.org/documentation/agent/installation/windows_before_2.3.0.html

Windows
  • 截图略,TAG自定义
Linux(agent使用方法类似
代码语言:javascript
复制
cd /usr/bin/
fusioninventory-agent --local=/tmp/ --tag=yourtag --server=http://serverIP/glpi/plugins/fusioninventory/front/plugin_fusioninventory.communication.php --no-software

详情参考fusioninventory-agent --help 配置文件里面有详解more fusioninventory-agent

Mac

参考:http://prebuilt.fusioninventory.org/stable/macosx-intel//

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 安装163yum源
  • 安装LAMP
    • 关闭firewall:
      • 安装配置iptables
        • 关闭SELINUX
          • 安装Apache
            • 安装配置Mariadb
              • 安装PHP
                • PS:安装PHP相关模块
                  • PS:Apache和PHP配置
                    • Apache配置
                    • PHP配置
                  • 配置数据库
                  • 安装glpi
                  • 安装fusioninventory插件
                    • 安装fusioninventory-agent
                      • Windows
                      • Linux(agent使用方法类似)
                      • Mac
                  领券
                  问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档