系统:
[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
软件环境:
LAMP # yum 安装
关闭selinux和防火墙:
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl disable firewalld
[root@localhost ~]# setenforce 0
源环境
[root@localhost~]#yuminstallepel-release-y
[root@localhost~]#wgethttp://rpms.famillecollet.com/enterprise/remi-release-7.rpm#PHP7.1源
[root@localhost~]#rpm-Uvhremi-release-7.rpm
安装PHP 及依赖包
[root@localhost~]#yum-yinstall--enablerepo=remi--enablerepo=remi-php71gccgcc-c glibc-develglibc-headersautoconf\
>automakebzip2-develzlib-develncurses-devellibjpeg-devellibpng-devellibtiff-develfreetype-develpam-devel\
>openssl-devellibXpmlibX11libxml2-develgettext-devel\
>pcre-develphpphp-fpmphp-develphp-gdphp-pecl-zipphp-MySQLphp-develphp-pearphp-imap\
>php-ldapphp-odbcphp-xmlphp-xmlrpcphp-imap\
>php-ldapphp-soapperlmod_perlperl-XML-Simpleperl-Compress-Zlibperl-DBI\
>perl-DBD-MySQLperl-Net-IPperl-apache-DBIperl-SOAP-Lite\
>perl-XML-Entitiesperl-ModPerl-MMperl-Apache2-SOAPhttpdphp71-php-mbstring\
#wgethttp://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm
#rpm-ivhmysql57-community-release-el7-8.noarch.rpm
#systemctlstartmysqld
#systemctlenablemysqld
#greppassw/var/log/mysqld.log#mysql初始密码用来改密
#修改root用户密码
>alteruser'root'@'localhost'identifiedby'King1230@##.*';
配置MySQL
createdatabaseglpi;#创建库
createuser'glpi'@'%'identifiedby'King1230@##.*';#专属用户
grantallprivilegesonglpi.*to'glpi'@'%'identifiedby"King1230@##.*";#授权
安装GLPI
#wgethttps://github.com/glpi-project/glpi/releases/download/9.3.1/glpi-9.3.1.tgz
#tarxvfglpi-9.3.1.tgz-C/var/www/html
#chown-Rapache:apache/var/www/html
#chkconfig--level2345httpdon#设置httpd在运行级别为2、3、4、5的情况下都是on(开启)的状态
#systemctlstarthttpd
#systemctlenablehttpd
将存储GLPI配置/etc/glpi,只需将config目录复制到此位置即可。
将GLPI数据存储在其中/var/lib/glpi,只需将files内容目录复制到此处即可。
GLPI日志文件将被存储/var/log/glpi,这里没有什么可复制的,只需创建目录即可。
#mkdir/etc/glpi#配置文件的路径
#mkdir/var/lib/glpi#数据存储文件的路径。
#mkdir/var/log/glpi#日志文件的路径。
#cd/var/www/html/glpi/
#cp-rconfig//etc/glpi/
#cp-rfiles/*/var/lib/glpi/
更改所创建目录的所属组,组 。否则会有权限问题
#chown-Rapache:apache/etc/glpi
#chown-Rapache:apache/var/lib/glpi/
#chown-Rapache:apache/var/log/glpi/
PHP配置
#vim/etc/php.ini
extension=/opt/remi/php71/root/usr/lib64/php/modules/mbstring.so#可在末尾添加
#vim/var/www/html/glpi/inc/downstream.php#创建文件并添加以下内容
<?phpdefine('GLPI_CONFIG_DIR','/etc/glpi/');if(file_exists(GLPI_CONFIG_DIR.'/local_define.php')){require_onceGLPI_CONFIG_DIR.'/local_define.php';
}
#vim/etc/glpi/local_define.php#创建文件并添加以下内容<?php
define('GLPI_VAR_DIR','/var/lib/glpi');
define('GLPI_DOC_DIR',GLPI_VAR_DIR);
define('GLPI_CRON_DIR',GLPI_VAR_DIR.'/_cron');
define('GLPI_DUMP_DIR',GLPI_VAR_DIR.'/_dumps');
define('GLPI_GRAPH_DIR',GLPI_VAR_DIR.'/_graphs');
define('GLPI_LOCK_DIR',GLPI_VAR_DIR.'/_lock');
define('GLPI_PICTURE_DIR',GLPI_VAR_DIR.'/_pictures');
define('GLPI_PLUGIN_DOC_DIR',GLPI_VAR_DIR.'/_plugins');
define('GLPI_RSS_DIR',GLPI_VAR_DIR.'/_rss');
define('GLPI_SESSION_DIR',GLPI_VAR_DIR.'/_sessions');
define('GLPI_TMP_DIR',GLPI_VAR_DIR.'/_tmp');
define('GLPI_UPLOAD_DIR',GLPI_VAR_DIR.'/_uploads');
define('GLPI_CACHE_DIR',GLPI_VAR_DIR.'/_cache');
define('GLPI_LOG_DIR','/var/log/glpi');
#vim/etc/httpd/conf/httpd.conf#放宽访问权限的目录级别None改成ALL
<Directory"/var/www">
AllowOverrideALL#Allowopenaccess:
Requireallgranted
</Directory>
#systemctlrestarthttpd
进行ip 访问 http://192.168.70.128/glpi/ 就会看到安装UI界面 安装指示安装就可以
界面安装演示1.可选择语言
2.同意许可
3.安装
4.环境测试
5.连接数据库
6.选择库(等待数据初始就可以了)
7.数据初始完成
8.留意账号密码
9.进入界面
,