Configure a domain name-based VM in Apache
I. Settings
Simulated Domain Name
Www.wang.org,Blog.wang.org,Bbs.wang.org
Site Directory
/Var/html/www,/var/html/blog,/var/html/bbs
II. Implementation steps:
1. Create a site directory
2. Write content to the three indexes to facilitate testing
3. cd to extra under the conf directory of apache
Add three sites
ServerAdmin wang_w0821@163.com -- administrator mailbox DocumentRoot "/var/html/www" -- site directory ServerName www.wang.org -- ServerAlias wang.org -- alias ErrorLog "logs/www-error_log" ServerAlias wang. orgServerAlias wang. orgCustomLog "logs/www-access_log" common
ServerAdmin wang_w0821@163.comDocumentRoot "/var/html/blog" ServerName blog. wang. orgErrorLog "logs/blog-error_log" CustomLog "logs/blog-access_log" common
ServerAdmin wang_w0821@163.comDocumentRoot "/var/html/bbs" ServerName bbs. wang. orgErrorLog "logs/bbs-error_log" CustomLog "logs/bbs-access_log" common
4. Add configuration in the main configuration file
# Comment on Virtual hosts
# Comment on Server-pool management (MPM)
5. post in drivers under system32 of window
Add local dns
PingWww.wang.orgBlog.wang.org
6.
Access in WindowWww.wang.org, 403, indicating that it is not referenced in the main configuration file
Add under httpd. conf
Check
Access again