首页 > 技术文章 > 安装GLPI

dsl146 2019-01-25 16:08 原文

Centos7安装GLPI资产管理软件

  • 系统信息
    • 环境说明

    下面的命令可以查看系统的版本信息,本次使用的是centos7

cat /etc/redhat-release

uname -a

  • IP地址信息

由于安装GLPI软件需要连接网络,下载很多的软件包,所以需要我们安装的服务器可以连接网络,我使用的vmware软件虚拟化出来的操作系统,Centos配置了2个网卡,一个网卡连接本地电脑(仅主机模式),另一个网卡配置用来上网(NAT模式)。

  • 查看IP地址

ip addr

  • 修改IP地址

vi /etc/sysconfig/network-scripts/ifcfg-eno16777736

  • 重启网卡

service network restart

  • 关闭Selinux

vi /etc/selinux/config

修改为disabled

重启之后才会生效。

  • 关闭防火墙

    不关闭防火墙,安装好后,地址无法访问。

systemctl stop firewalld.service #停止firewall

systemctl disable firewalld.service #禁止firewall开机启动

firewall-cmd --state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running

   

  • 配置yum源
    • CentOS6.x方法

rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm

rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

  • CentOS7.x方法

rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm

rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm

  • 安装PHP

yum -y install php-imap

yum -y install php-ldap

yum -y install php-gd

yum -y install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpuni-PHPUnit php-pecl-xdebug php-pecl-xhprof

#无、php-phpuni-PHPUnit

  • 安装Apache、MySQL和一些依赖

yum -y install gcc gcc-c++ gcc-g77 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 mysql mysql-server httpd

#无、gcc-g77mysql-serverMysql-server必须安装centos7 mysql数据库安装和配置讲述的如何安装Mysql-server

  • 配置MySQL

[root@localhost1 ~]# service mysqld start

[root@localhost1 ~]# mysql

mysql> use mysql;

mysql> update user set password=PASSWORD("root")where user="root";

mysql> FLUSH PRIVILEGES;

mysql> create database GLPI;

mysql> quit

Bye

[root@localhost1 ~]# chkconfig --levels 235 mysqld on

  • 配置GLPI

[root@localhost1 ~]# cd /usr/src/

[root@localhost1 src]# curl -O -L https://github.com/glpi-project/glpi/releases/download/9.1.3/glpi-9.1.3.tgz

[root@localhost1 src]# tar xf glpi-9.1.3.tgz -C /var/www/html/

[root@localhost1 src]# chown -R apache:apache /var/www/html/

[root@localhost1 src]# chkconfig --level 2345 httpd on

service httpd restart

 后面的算是优化

[root@localhost1 src]# vim /etc/httpd/conf/httpd.conf

276 ServerName www.example.com:80

292 DocumentRoot "/var/www/html/glpi"

##vi编辑的过程中,使用":set number"可以查看行号

   

推荐阅读