Configuration conditions
1:linux system
2:HTTPD Service, DNS service
Need to learn more about access control for HTTPD services
Primarily to control access to site resources, add access authorizations for specific site directories
Commonly used for client address restrictions, user authorization restrictions
Order configuration items, defining control order
1: First allow after deny, default deny all: Orderallow,deny
2: First deny after allow, default allows all: Order Deny,allow
Configure DNS Service Add resolution
Vim/var/named/chroot/var/named/benet.com.zone (manually created)
@ in NS dnssvr.jianyu.com.
Dnssvr in A 192.168.1.1
www in A 192.168.1.1
Vim/var/named/chroot/var/named/accp.com.zone
@ in NS dnssvr.accp.com.
www in A 192.168.1.1
Create a default Web page for two virtual hosts (you need to create one manually)
Mkdir-p/var/www/html/jianyucom
mkdir-p/var/www/html/ accpcom
Modify the virtual host configuration vim/usr/local/httpd/conf/extra/httpd-vhosts.conf
<directory '/var/www/html ' (advertise its web directory)
Order Allow,deny Access sequence
Allows all
</Directory>
Namevirtualhost 192.168.1.1:80
<virtualhost 192.168.1.1>
Documentroot/var/www/html/jianyuCOM (Default Web page directory)
ServerName www.jianyu.com (domain name)
Namevirtualhost 192.168.1.1:80
<virtualhost 192.168.1.1>
DOCUMENTROOT/VAR/WWW/HTML/ACCPCOM (Default Web page directory)
ServerName www.accp.com (domain name)
Editing a configuration file vim/usr/local/httpd/conf/httpd.conf
Remove the # before the http-vhosts.conf option configuration to apply
Include conf/extra/httpd-vhosts.conf (Load standalone configuration)
Restart Service /usr/local/httpd/bin/apachectl/start
2017.7.11
Jianyu
This article is from the "Jianyu" blog, make sure to keep this source http://jianyu97.blog.51cto.com/12222102/1946465
Virtual Web Host