CentOS 7, based on RPM Package installation Deployment APM (PHP-FPM) + XCache;
A) httpd, PHP, MARIADB are deployed separately on a separate host;
b) A virtual host to provide phpMyAdmin, another virtual host to provide WordPress;
c) Providing HTTPS services to Phpmyadmim;
First, the environment configuration:
Turn off the firewall and set SELinux:
Use httpd+fastcgi to achieve consolidation:
The 1.php-5.3.3+ version can be implemented by default;
2.HTTPD support Proxy_fcgi_module, the default httpd-2.2 does not support this module, httpd-2.4 support;
Modules that need to be installed: PHP-FPM//php-fpm and PHP cannot exist at the same time, to install php-fpm need to uninstall PHP first
To install the application:
[email protected] ~]# Yum install-y php-fpm php-gd php-mbstring php-mysql mod_ssl mariadb-server
Open service:
[Email protected] ~]# systemctl start Httpd.service
[Email protected] ~]# systemctl start Mariadb.service
To view the service startup status:
httpd, PHP, MARIADB are deployed on a separate host (httpd, PHP, mariadb Three applications can be installed directly on the host)
One virtual host provides phpMyAdmin, and another virtual host provides WordPress (additional two FQDN-based virtual host addresses need to be configured):
To configure a virtual host:
[Email protected] ~]# CD/ETC/HTTPD/CONF.D
[[email protected] conf.d]# ls
autoindex.conf README ssl.conf userdir.conf welcome.conf
[Email protected] conf.d]# vim vhost1.conf
<virtualhost 172.16.72.1:80>
ServerName www.clvhost1.com
DocumentRoot "/var/www/html/vhost1"
Proxyrequests off
Proxypassmatch ^/(.. php) $ fcgi://172.16.72.1:9000/var/www/html/vhost1$1
<directory "/var/www/html/vhost1" >
Options None
AllowOverride None
Require all granted
</Directory>
</VirtualHost>
[Email protected] conf.d]# vim vhost1.conf
<virtualhost 172.16.72.1:80>
ServerName www.clvhost1.com
DocumentRoot "/var/www/html/vhost1"
Proxyrequests off
Proxypassmatch ^/(.. php) $ fcgi://172.16.72.1:9000/var/www/html/vhost1/$1
<directory "/var/www/html/vhost1" >
Options None
AllowOverride None
Require all granted
</Directory>
</VirtualHost>
To create a directory and home page file:
[[email protected] conf.d]# mkdir-pv/var/www/html/vhost{1,2}
mkdir: The directory "/var/www/html/vhost1" has been created
mkdir: The directory "/var/www/html/vhost2" has been created
[Email protected] conf.d]# echo "Vhost1 ' s testpage." >>
autoindex.conf ssl.conf vhost1.conf welcome.conf
README userdir.conf vhost2.conf
[Email protected] conf.d]# echo "Vhost1 's testpage." >>/var/www/html/vhost1/index.html
[Email protected] conf.d]# echo "Vhost2 's testpage." >>/var/www/html/vhost2/index.html
Review the syntax for no problem (HTTPD-T) after restarting the HTTPD service (systemctl restart Httpd.service), add resolution entries to the client localhost:
C-Disk \windows\system32\drivers\etc\hosts file added: 172.16.72.1 www.clvhost1.com www.clvhost2.com
Test static page results:
[Email protected] conf.d]# cd/etc/php-fpm.d/www.conf
Listen = 172.16.72.1:9000
Listen.allowed_clients = 172.16.72.1
Create the database and authorize the user to test the database connection:
To test the database connection status:
Install APM (PHP-FPM) + XCache in CentOS 7 based on RPM package