воскресенье, 9 декабря 2018 г.

Install GLPi on CentOS7 (php7.1)


Install MariaDB:
yum -y install mariadb-server mariadb-devel
systemctl enable mariadb
systemctl start mariadb

mysql_secure_installation
# mysql -u root -p
> create database glpidb;
> create user 'glpiuser'@'localhost' identified by 'P@ssword01';
> grant all privileges on glpidb.* to glpiuser@localhost;
> flush privileges;

Install php7.1
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum install -y mod_php71w php71w-cli php71w-common php71w-gd php71w-mbstring php71w-mcrypt php71w-mysqlnd php71w-xml php71w-ldap php71w-imap php71w-fileinfo php71w-opcache php71w-pecl-apcu php71w-xmlrpc php71w-common

php -v

Configure Apache:
yum -y install httpd

cd /var/www/
wget https://github.com/glpi-project/glpi/releases/download/9.1.3/glpi-9.3.3.tgz
tar -xvf glpi-9.3.3.tgz

cd /var/www/
mv glpi glpi-9.1.3
ln -s  glpi-9.1.3 glpi

chmod -R 755 /var/www/glpi-9.3.3
chown -R apache:apache /var/www/glpi-9.3.3

Open port 80:
vim /etc/sysconfig/iptables
     -A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
systemctl restart iptables
iptables -L -n -v

Timezone in php:
vi /etc/php.ini
    date.timezone = Europe/Moscow

vi /etc/httpd/conf.d/glpi.conf
<VirtualHost *:80>

        ServerName glpi.river.ru
        DocumentRoot /var/www/glpi

        ErrorLog "/var/log/httpd/glpi.log"
        CustomLog "/var/log/httpd/glpi.log" combined

        <Directory> /var/www/glpi/config>
                AllowOverride None
                Require all denied
        </Directory>

        <Directory> /var/www/glpi/files>
                AllowOverride None
                Require all denied
        </Directory>

</VirtualHost>

systemctl restart httpd

Configure NginX:

yum -y install nginx

vi /etc/php-fpm.d/www.conf
    listen = /run/php-fpm/php-fpm.sock
    listen.owner = nginx
    listen.group = nginx
    user = nginx
    group = nginx

vi /etc/nginx/conf.d/glpi.conf

server {
    listen  80 
    server_name river.ru

    location / {
        root  /var/www/glpi 
        index  index.html index.htm index.php 
    }

    error_page  500 502 503 504  /50x.html 
    location = /50x.html {
        root  /var/www/glpi 
    }
location ~ \.php {
    fastcgi_index index.php 
    fastcgi_split_path_info ^(.+\.php)(.*)$ 
    include /etc/nginx/fastcgi_params 
    fastcgi_pass unix:/run/php-fpm/php-fpm.sock 
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name 
  }

}

chown -R nginx:nginx /var/www/glpi

chmod -R 777 /var/www/glpi

systemctl restart nginx

Open in browser: http:glpi.river.ru

    glpi/glpi for the administrator account
    tech/tech for the technician account
    normal/normal for the normal account
    post-only/postonly for the postonly accou
  • nt


Комментариев нет:

Отправить комментарий