返回顶部
首页 > 资讯 > 后端开发 > PHP编程 >搭建glpi(IT资产管理系统)
  • 432
分享到

搭建glpi(IT资产管理系统)

服务器centosphp 2023-09-05 20:09:21 432人浏览 安东尼
摘要

目录 1.环境准备 2.安装环境依赖 3.安装mariadb 4.安装httpd 5.源码:glpi-project 6.修改服务器的时间: 7.安装fusioninventory插件(fusioninventory) 8.Client(W

目录

1.环境准备

2.安装环境依赖

3.安装mariadb

4.安装httpd

5.源码:glpi-project

6.修改服务器的时间:

7.安装fusioninventory插件(fusioninventory)

8.Client(Windows agent):fusioninventory-agent_windows-x64_2.6.exe

9.Client(Linux agent)


IP主机名系统
172.25.250.103服务器linux
172.25.250.1Client01windows
172.25.250.101Client02Linux

1.环境准备

系统环境:Centos7
mariadb:10.5.18
PHP:7.4.33
apache:2.4.6

#关闭selinuxsetenforce 0#关闭防火墙systemctl stop firewalld#拉取cento7的阿里云网络源curl -o /etc/yum.repos.d/epel.repo Http://mirrors.aliyun.com/repo/epel-7.repo curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo yum install epel-release -y rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm

2.安装环境依赖

yum -y install --enablerepo=remi --enablerepo=remi-php74 php php-opcache php-devel php-mbstring php-mcrypt php-Mysqlnd php-pecl-xdebug php-pecl-xhprof php-imap php-gd php-ldap php-intl php-simplexml php-zip php-apcu php-xmlrpc php-pear-CAS php-zipyum -y install GCc gcc-c++ flex bison autoconf automake bzip2-devel zlib-devel ncurses-devel libjpeg-devel libpng-devel libtiff-devel freetype-devel pam-devel openssl-devel libxml2-devel gettext-devel pcre-devel

3.安装mariadb

#配置mariadb的yum源cat >> /etc/yum.repos.d/mariadb.repo << EOF[mariadb]name = MariaDBbaseurl = https://mirrors.aliyun.com/mariadb/yum/10.5/centos7-amd64gpgkey = https://mirrors.aliyun.com/mariadb/yum/RPM-GPG-KEY-MariaDBgpgcheck = 1EOF
yum makecacheyum -y install MariaDB-server MariaDB-clientsystemctl start mariadb

 配置mariadb

#初始化数据库mysql_secure_installation #登录数据库mysql -uroot -puse mysql#创建数据库用户,并给予远程数据库的权限create user'glpi'@'%' IDENTIFIED BY 'redhat';grant all privileges ON *.* TO 'glpi'@'%' IDENTIFIED BY 'redhat';create database glpi;flush privileges;

4.安装httpd

yum install -y httpd httpd-develsystemctl start  httpdsystemctl enable httpd

5.源码glpi-project

#下载源码:https://GitHub.com/glpi-project/glpi/releaseswget https://github.com/glpi-project/glpi/releases/download/10.0.1/glpi-10.0.1.tgztar -zxf glpi-10.0.1.tgz cp glpi/* /var/www/html/. -Rchown -R apache:apache /var/www/htmlchmod 755 -R /var/www/html/config/chmod 755 -R /var/www/html/files/

网页访问:http://服务器IP/glpi/

http://服务器IP/glpi/

6.修改服务器的时间:

vim /etc/php.ini    date.timezone = Asia/Shanghai#重启httpd服务systemctl restart httpd

7.安装fusioninventory插件fusioninventory

cd /var/www/html/plugins/wget https://github.com/fusioninventory/fusioninventory-for-glpi/releases/download/glpi10.0.1%2B1.0/fusioninventory-10.0.1+1.0.zipyum install -y unzipunzip fusioninventory10.0.1+1.0.zip

网页打开安装并启用
http://服务器IP/front/marketplace.php

http://服务器IP/front/marketplace.php

8.Client(Windows agent):
fusioninventory-agent_windows-x64_2.6.exe

编写bat自动安装的脚本(与fusioninventory-agent_windows-x64_2.6.exe同一目录下):

:x64echo "_____________________________________________"echo "install fusioninventory-agent_windows-x64_2.6.exe"%~dp0\fusioninventory-agent_windows-x64_2.6.exe /acceptlicense /add-firewall-exception /execmode=Service /no-start-menu /runnow /server='http://172.25.250.103/plugins/fusioninventory/' /installtasks=Deploy,ESX,Inventory,NetDiscovery,NetInventory,WakeOnLan /Secho "install session"ping -n 3 127.0.0.1>nulecho "send computer information ti GLPI Server"call "D:\迅雷下载\fusioninventory-agent.bat"echo "_____________________________________________"ping -n 3 127.0.0.1>nul

 右键管理员运行bat文件

网页查看:http://127.0.0.1:62354

http://127.0.0.1:62354

 生成的内容返回到服务器上

9.Client(Linux agent):

yum install -y fusioninventory-agent fusioninventory-agent-task-inventorysed -i "s@#server = http://server.domain.com/glpi/plugins/fusioninventory/@server = http://服务器IP/plugins/fusioninventory/@g" /etc/fusioninventory/agent.cfg#开启服务并设置开机自启systemctl start fusioninventory-agentsystemctl enable fusioninventory-agent#防火墙放行62354端口firewall-cmd --permanent --zone=public --add-port=62354/tcpfirewall-cmd --reload#后台运行fusioninventory-agent --server http://服务器IP/plugins/fusioninventory/ --daemon

来源地址:https://blog.csdn.net/vincefans/article/details/128419779

--结束END--

本文标题: 搭建glpi(IT资产管理系统)

本文链接: https://www.lsjlt.com/news/396111.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作