开源资产管理软件 GLPI

环境需求

系统:CentOS 7

IP:192.168.11.207

关闭selinux和防火墙

$ systemctl stop firewalld

$ systemctl disable firewalld

$ setenforce 0

$vim /etc/sysconfig/selinux

SELINUX=disabled

注:注意 selinux 配置检测会用到请注意关闭

PHP****安装配置

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

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

$ 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-imap php-ldap php-gd

$ yum install -y tree vim lrzsz wget nc nmap dos2unix bash-completion bash-completion-extras telnet net-tools

安装数据库

$ vim /etc/yum.repos.d/MariaDB.repo

[mariadb]

name=MariaDB

baseurl=http://mirrors.aliyun.com/mariadb/yum/10.3/centos7-amd64/

gpgkey=http://mirrors.aliyun.com/mariadb/yum/RPM-GPG-KEY-MariaDB

gpgcheck=1

$ yum clean all && yum makecache

$ yum install -y MariaDB-server MariaDB-client MariaDB-devel

配置MySql

启动mysql数据库服务并设为开机启动

$ systemctl start mariadb && systemctl enable mariadb

初始化MariaDB数据库,主要创建mysql数据库密码,然后全部Y下一步:

$ mysql_secure_installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MariaDB to secure it, we'll need the current password for the root user. If you've just installed MariaDB, and you haven't set the root password yet, the password will be blank, so you should just press enter here. Enter current password for root (enter for none): //当前数据库密码为空,直接按回车键 OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MariaDB root user without the proper authorisation. Set root password? [Y/n] Y //输入要为root管理员设置的密码(数据库root非linux root) New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success! By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y/n] Y //删除匿名账号 ... Success! Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] Y //禁止root管理员从远程登录 ... Success! By default, MariaDB comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n] Y //删除test数据库并取消对它的访问权限 - Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n] Y //刷新授权表,让初始化后的设定立即生效 ... Success! Cleaning up... All done! If you've completed all of the above steps, your MariaDB installation should now be secure. Thanks for using MariaDB!

创建用户并设置权限

$ mysql -uroot -p

MariaDB [(none)]> use mysql

MariaDB [mysql]> grant all privileges on . to root@"%" identified by "21ops.com";

MariaDB [mysql]>flush privileges;

MariaDB [(none)]> create database glpi;

MariaDB [(none)]> create user 'glpi'@'%' identified by "glpi";

MariaDB [(none)]> grant all privileges on glpi.* to 'glpi'@'%' identified by "glpi";

MariaDB [(none)]> flush privileges;

下载GLPI安装包

[root@test4-8g ~]# wget https://github.com/glpi-project/glpi/releases/download/9.3.2/glpi-9.3.2.tgz

$ tar xvf glpi-9.3.2.tgz -C /var/www/html

$ chown -R apache:apache /var/www/html

$ systemctl start httpd

$ systemctl enable httpd

GlPI****配置

将存储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 -r config/ /etc/glpi/

$ cp -r files/* /var/lib/glpi/

更改所创建目录的所属主,组 。否则会有权限问题

$ chown -R apache:apache /etc/glpi

$ chown -R apache:apache /var/lib/glpi/

$ chown -R apache:apache /var/log/glpi/

PHP****配置

$ vim /etc/php.ini # 可在末尾添加extension=/opt/remi/php56/root/usr/lib64/php/modules/mbstring.so

GLPI-PHP****配置

$ vim /var/www/html/glpi/inc/downstream.php # 创建文件并添加以下内容

<?php

define('GLPI_CONFIG_DIR', '/etc/glpi/');

if (file_exists(GLPI_CONFIG_DIR . '/local_define.php')) {

require_once GLPI_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

<Directory "/var/www"> AllowOverride ALL # Allow open access: Require all granted </Directory>

设置selinux

$ setsebool -P httpd_can_network_connect 1

$ setsebool -P httpd_can_network_connect_db 1

$ setsebool -P httpd_can_sendmail 1

重启HTTPD,浏览器访问

$ systemctl restart httpd

进行ip 访问 http://192.168.11.207/glpi/ 就会看到安装UI界面 安装指示安装就可以

界面安装演示

1.可选择语言

[图片上传失败...(image-d5512f-1565320331473)]

[图片上传失败...(image-33df2f-1565320331473)]

2.同意许可

[图片上传失败...(image-7cf494-1565320331473)]

3.安装

[图片上传失败...(image-dde224-1565320331473)]

4.环境测试

[图片上传失败...(image-8ad578-1565320331473)]

5.连接数据库

[图片上传失败...(image-5e727c-1565320331473)]

6.选择库(等待数据初始就可以了)

[图片上传失败...(image-a22003-1565320331473)]

7.数据初始完成

[图片上传失败...(image-ae636b-1565320331473)]

[图片上传失败...(image-89693b-1565320331472)]

8.留意账号密码

[图片上传失败...(image-dc2cd5-1565320331472)]

9.进入界面

[图片上传失败...(image-b57dbe-1565320331472)]

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 194,088评论 5 459
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 81,715评论 2 371
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 141,361评论 0 319
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 52,099评论 1 263
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 60,987评论 4 355
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 46,063评论 1 272
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 36,486评论 3 381
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 35,175评论 0 253
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 39,440评论 1 290
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 34,518评论 2 309
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 36,305评论 1 326
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 32,190评论 3 312
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 37,550评论 3 298
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 28,880评论 0 17
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 30,152评论 1 250
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 41,451评论 2 341
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 40,637评论 2 335