CentOS 7, based on RPM package installation of APM (PHP module) + XCache;
A) a virtual host to provide phpMyAdmin, another virtual host to provide WordPress;
b) Providing HTTPS services to Phpmyadmim;
First, the Environment configuration
Turn off SELinux and firewalls:
Install the necessary packages--based on the RPM package:
The HTTPD program is used to provide browse and access to static page content, PHP program implements Dynamic Web page, Php-mysql is used to implement PHP and database connection, MOD_SSL is used to provide HTTPS service, Mariadb-server provides database service with Ali;
Start the configured service:
View service Status:
View the modules used by this configuration service:
[Email protected] ~]# vim/etc/httpd/conf.modules.d/10-php.conf
Configure two virtual host sites:
[Email protected] ~]# CD/ETC/HTTPD/CONF.D
[[email protected] conf.d]# ls
autoindex.conf php.conf README ssl.conf userdir.conf welcome.conf www1.conf www2.conf
[Email protected] conf.d]# vim vhost1.conf
<virtualhost 172.16.72.1:80>
ServerName www.clvhost1.com
Documentroot/var/www/html/vhost1
</VirtualHost>
[Email protected] conf.d]# vim vhost2.conf
<virtualhost 172.16.72.1:80>
ServerName www.clvhost2.com
Documentroot/var/www/html/vhost2
</VirtualHost>
[[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 homepage." >>/var/www/html/vhost1/index.html
[Email protected] conf.d]# echo "Vhost2 's homepage." >>/var/www/html/vhost2/index.html
There is no problem with the syntax check configuration, no problem restarting the service:
[Email protected] conf.d]# httpd-t
AH00557:httpd:apr_sockaddr_info_get () failed for Chenliang
AH00558:httpd:Could not reliably determine the server ' s fully qualified domain name, using 127.0.0.1. Set the ' ServerName ' directive globally to suppress this message
Syntax OK
[Email protected] conf.d]# systemctl restart Httpd.service
To add a parse entry to the local host:
Usually C-drive under \windows\system32\drivers\etc\hosts file added: 172.16.72.1 www.clvhost1.com www.clvhost2.com
Test results:
To create a PHP test page:
[Email protected] conf.d]# Cd/var/www/html/vhost1
[[email protected] vhost1]# ls
Index.html
[Email protected] vhost1]# mv index.html index.php
[Email protected] vhost1]# vim index.php
Vhost1 ' s homepage.
<?php
Phpinfo ();
?>
[Email protected] vhost1]# Cd/var/www/html/vhost2
[[email protected] vhost2]# ls
Index.html
[Email protected] vhost2]# mv index.html index.php
[Email protected] vhost2]# vim index.php
Vhost2 ' s homepage.
<?php
Phpinfo ();
?>
PHP page Connection Test results:
PHP and server-side database connection testing:
To confirm that the mariadb-server is turned on, create a WordPress database and authorize the user:
To test whether the database connection was successful:
Virtual machine Vhost1 is used to install the Configuration WordPress Forum:
[Email protected] vhost2]# Cd/var/www/html/vhost1
[[email protected] vhost1]# ls
index.php
[Email protected] vhost1]# vim index.php
Vhost2 ' s homepage. </br>
<?php
$conn = mysql_connect (' 172.16.72.1 ', ' wpuser ', ' 123456 ');
if ($conn)
echo "Connect successful.";
Else
echo "Connect failed.";
?>
Test results:
Virtual machine Vhost2 is used to install the configuration phpMyAdmin application:
[Email protected] vhost1]# Cd/var/www/html/vhost2
[[email protected] vhost2]# ls
index.php
[Email protected] vhost2]# vim index.php
Vhost1 ' s homepage. </br>
<?php
$conn = mysql_connect (' 172.16.72.1 ', ' wpuser ', ' 123456 ');
if ($conn)
echo "Connect successful.";
Else
echo "Connect failed.";
?>
Test results:
Second, install WordPress forum and phpMyAdmin Application:
Put the WordPress forum compression package Anti-/var/www/html/vhost1 directory, the phpMyAdmin application compressed package anti-placement into the/VAR/WWW/HTML/VHOST2 directory:
Build wordpress Forum:
Unzip and rename (renamed to better Type the address):
Go to the WP directory and change the configuration file and file name:
[Email protected] wp]# MV wp-config-sample.php wp-config.php
Build success:
To configure the phpMyAdmin application:
The phpMyAdmin application does not need to modify the configuration file on the server side, directly to the local login test, as follows:
At this point, build wordpress forum and configure phpMyAdmin application successfully.
Provide HTTPS services for the second virtual host site Phpmyadmim application (This configuration https is done on the same host):
Create a private CA:
generate a self-visa book:
Create a text file and catalog file:
Generate a key for the HTTPD server and generate a certificate request:
sends a certificate request to the CA:
issues a certificate on the CA for this request:
Transfer the CA-issued certificate to the HTTPD server on the CA:
[email protected] ssl]# cp/etc/pki/ca/certs/httpd.crt/etc/httpd/ssl/
on the httpd server, delete the certificate request file:
[[email Protected] ssl]# ls
httpd.crt httpd.csr httpd.key
[[email protected] ssl]# rm-f HTTPD.CSR
Configure SSL support on the VHOST2 virtual host Site Server:
Configure the Virtual host for HTTPS (ensure that the Mod_ssl module is loaded correctly, and if not, you need to install it separately):
[[email protected] ~]# cd/etc/ HTTPD/CONF.D
[[email protected] conf.d]# ls
autoindex.conf php.conf README ssl.conf userdir.conf vhost1.conf vhost2.conf welcome.conf
[[email protected] conf.d]# vim vhost2.conf
<virtualhost 172.16.72.1:443>
ServerName www.clvhost2.com:443
Documentroot/var/www/html/vhost2
Sslcertificatefile/etc/httpd/ssl/httpd.crt
Sslcertificatekeyfile/etc/httpd/ssl/httpd.key
</VirtualHost>
Check to see if the port has been heard on HTTPS port 443:
To test whether the HTTPS service was established successfully:
至此,https服务提供成功。
CentOS7 installation of APM (PHP module modules) + XCache based on RPM package mode