Apache configures a domain-based virtual host

Source: Internet
Author: User

First, set

Analog domain

www.wang.org, blog.wang.org, bbs.wang.org

Site Folder

/var/html/www,/var/html/blog,/var/html/bbs

Second, the implementation of the steps:

1. Create a Web site folder





2. Write content to three index for easy testing


3.cd to extra under the conf folder in Apache

Add configuration to three websites

<virtualhost *:80>serveradmin [Email protected]--admin mailbox DocumentRoot "/var/html/www"--site folder servername Www.wang.org--ServerAlias wang.org--alias errorlog "Logs/www-error_log" Serveralias Wang.orgserveralias Wang.orgcustomlog "Logs/www-access_log" Common</virtualhost><virtualhost *:80>ServerAdmin [email Protected]documentroot "/var/html/blog" ServerName blog.wang.orgErrorLog "Logs/blog-error_log" Customlog "logs/ Blog-access_log "Common</virtualhost><virtualhost *:80>serveradmin [email protected]DocumentRoot"/var/ Html/bbs "ServerName bbs.wang.orgErrorLog" Logs/bbs-error_log "Customlog" Logs/bbs-access_log "common</ Virtualhost>

4. Add a configuration to the master configuration file

The gaze of the #Virtual hosts opened

Staring open #Server-pool management (MPM)

5. Post in drivers under window system32

Join local DNS


Ping www.wang.org,blog.wang.org can pass

6.

Window access to the www.wang.org, 403appears, indicating that there is no reference in the master configuration file

join under the httpd.conf

Check


Ask again














Apache configures a domain-based virtual host

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.