Second, the project operation:
Implemented using httpd-2.2 and httpd-2.4, respectively
1. Establish httpd service, request:
1) provide two name-based virtual host WWW1, WWW2; requires a separate error log and access log for each virtual host;
2) Provide status information through WWW1 's/server-status, and only allow 172.16.0.1 host access;
3) WWW2 does not allow access to any host in the 192.168.1.0/24 network;
1.WWW1 Configuration of virtual machines
<VirtualHost 172.16.11.11:80> Servername www.qmx.com documentroot "/mnt/web/www1/" ErrorLog "LOGS/ERROR_WWW1" Loglevel warn CustomLog "LOGS/ACCESS_WWW1" combined <Directory "/mnt/web/www1/" > options none allowoverride none order deny,allow allow from all </directory> <Location /server-status> SetHandler server-status Order deny,allow Deny from all Allow from 172.16.0.1 </Location></VirtualHost>
Create a log file for WWW1
Touch Error_www1touch access_www1chmod 660 error_www1 chmod 660 access_www1 chgrp Apache error_www1 chgrp Apache ACCESS_WW W1
Create a Web site path
Mkdir-pv/mnt/web/www1
Configure the local Hosts file to complete the host header-based virtual host
Access to the WWW1 virtual host and its configured server status data query
Configuring WWW2 in the same vein
<VirtualHost 172.16.88.99:80> Servername www.qqzx.com documentroot "/mnt/web/www2/" ErrorLog "LOGS/ERROR_WWW2" Loglevel warn CustomLog "LOGS/ACCESS_WWW2" combined <Directory "/mnt/web/www2/" > options none allowoverride none order deny,allow deny from 192.168.1.0/24 </directory></virtualhost>
Verifying access control
2. Provide HTTPS services for the 2nd virtual host above;
Due to personal ability reasons, not yet completed, please look forward to
HTTP Configuration Instance