Configure a domain name-based VM in Apache

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.