Centos7 with Nginx on Synology

Install Synology Guests

QEMU is the emulator that runs the OS (like Vmware / VirtualBox etc)

yum install qemu-guest-agent

yum install epel-release

yum install nginx

systemctl start nginx

yum install unzip

sudo firewall-cmd --permanent --zone=public --add-service=http 
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --reload


Check enforcement getenforce

Set enforcement off setenforce Permissive

Get status: sestatus


yum install yum-utils yum install composer


yum install git

Enable Remi repository

```yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm yum-config-manager --enable remi-php72

Install PHP7.2

yum install php72 php72-php-fpm php72-php-mysqlnd php72-php-opcache php72-php-xml php72-php-xmlrpc php72-php-gd php72-php-mbstring php72-php-json

Check it's installed 

`php72 -v`

List files

`rpm -ql php72-php-fpm`

Change ownership to nginx from apache

`vi /etc/opt/remi/php72/php-fpm.d/www.conf`

`chgrp nginx *`


`service php72-php-fpm restart`

Link to php

`ln -s /usr/bin/php72 /usr/bin/php`

# Setting up PHP on Nginx

Add to nginx.conf

Remi uses port 9000 (you can see it `/etc/opt/remi/php72/php-fpm.d/www.conf`)

location ~ .php$ { include /etc/nginx/fastcgi_params; fastcgi_pass; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; }

# Phalcon


`curl -s https://packagecloud.io/install/repositories/phalcon/stable/script.rpm.sh | sudo bash`

`yum install php72u-phalcon`

`yum install php72-php-phalcon3`

`service php72-php-fpm restart`

# Percoda

yum install https://repo.percona.com/yum/percona-release-latest.noarch.rpm
yum install Percona-Server-server-57
service mysql start
service mysql status
service mysql stop

Get password: `cat /var/log/mysqld.log |grep generated`

Update password `mysql_secure_installation`

Store password:

`vi /root/.my.cnf`

[client] host = localhost user = root password = "XXX" socket=/var/lib/mysql/mysql.sock database = dome