Archlinux 下安装itop 和 glpi

安装lnmp

sudo pacman -S graphviz unzip mariadb php-fpm php-gd php-imap php-memcached php-sodium php-apcu nginx wget

配置php

sudo nano /etc/php/php.ini
修改的内容
cgi.fix_pathinfo=0
///
max_execution_time = 600
///
extension=bcmath
extension=bz2
extension=calendar
extension=curl
extension=dba
;extension=enchant
extension=exif
extension=ftp
extension=gd
extension=gettext
extension=gmp
extension=iconv
extension=imap
;extension=intl
extension=sodium
extension=ldap
extension=mysqli
;extension=odbc
zend_extension=opcache
;extension=pdo_dblib
;extension=pdo_mysql
;extension=pdo_odbc
;extension=pdo_pgsql
;extension=pdo_sqlite
;extension=pgsql
;extension=pspell
;extension=shmop
;extension=snmp
extension=soap
;extension=sockets
;extension=sqlite3
;extension=sysvmsg
;extension=sysvsem
;extension=sysvshm
;extension=tidy
extension=xmlrpc
;extension=xsl
extension=zip
extension=apcu
extension=memcached

配置php-fpm

sudo nano /etc/php/php-fpm.d/www.conf
///内容
request_terminate_timeout = 600

配置nginx

sudo nano /etc/nginx/nginx.conf
内容
user http;
worker_processes  auto;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    types_hash_max_size 4096;
    server_names_hash_bucket_size 128;

    include conf.d/*.conf;
    fastcgi_connect_timeout 600;
    fastcgi_send_timeout 600;
    fastcgi_read_timeout 600;
    #gzip  on;
}

新建网站的配置文件

sudo nano /etc/nginx/conf.d/www.conf
内容如下:
server {
    listen   80 default_server;
    root /var/www/html;
    index index.php;
    server_name localhost;

    location / {try_files $uri $uri/ index.php;}

    #prise en charge PHP
    location ~ \.php$ {
    fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
    fastcgi_index index.php;
    include /etc/nginx/fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
    fastcgi_param SERVER_NAME $host;
        }
}

配置数据库

sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
sudo systemclt start mariadb
sudo mysql_secure_installation
///修改my.cnf
sudo nano /etc/mysql/my.cnf
///内容
[mysqld]
max_allowed_packet = 128M
///重启数据库
sudo systemctl restart mariadb

新建itop数据库

sudo mysql -u root -p
> CREATE USER 'yourname'@'localhost' IDENTIFIED BY 'yourpasswd';
> create database itop DEFAULT CHARACTER SET utf8;
> grant all privileges on itop.* to 'yourname'@'localhost' identified by 'yourpasswd';
> flush privileges;
> \q

加入系统启动

sudo systemctl enable mariadb
sudo systemctl enable nginx
sudo systemctl enable php-fpm

安装itop

cd ~
wget -c -t5 https://sourceforge.net/projects/itop/files/itop/2.5.0/iTop-2.5.0-3935.zip/download
unzip download
sudo mkdir -p /var/www/html
sudo mv ./web /var/www/html/itop
sudo mkdir -p /var/lib/php/session
sudo chown -R http:http /var/www/html/itop
sudo chown -R http:http /var/lib/php/session
///修改php session路径
sudo nano /etc/php/php.ini
///内容
session.save_path = "/var/lib/php/session"

重启系统,输入http://ip/itop安装。glpi跟itop的配置文件都通用,不再重复。

    原文作者:龜山島
    原文地址: https://www.jianshu.com/p/cba74917ed86
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞