Apache configures two domain names to match folders and configure multiple Web sites

Source: Internet
Author: User

Apache Virtual host is a kind of consent on the same machine, execute more than one site solution, at the same time will be able to Bondi two-level domain name to the specified folder. There are two types of virtual hosts. One is called IP-based (ip-based), and there is a name-based (name-based).

The existence of a virtual host is transparent to the user.

Say the name-based (name-based), IP-based. Please self-help Baidu. For example, this http://www.cnblogs.com/see7di/archive/2011/06/15/2239756.html

Open httpd.conf

Vi/etc/httpd/conf/httpd.conf

Open the gaze of this line of statement

Namevirtualhost *:80

Add the following code at the end of the file

View Source

P=222#printsource "title=" print "class=" Item Printsource "style=" border:0px; margin-top:0px; margin-right:0px; margin-bottom:0px; Margin-left:8px!important; padding:0px; Color:rgb (160,160,160)!important; Text-decoration:none; Display:block!important; Float:left!important; Overflow:hidden!important; Text-indent:-5000px!important; width:16px; height:16px "> Printing Help


 
<virtualhost *:80>    ServerAdmin [email protected]    documentroot/var/www/html/about    ServerName About.erdian.net    serveralias about.erdian.net    serveralias zhangningning.erdian.net    errorlog logs/ About.com-error_log    customlog logs/about.com-access_log common</virtualhost><virtualhost *:80>    ServerAdmin [email protected]    documentroot/var/www/html    ServerName erdian.net    serveralias *.erdian.net    serveralias erdian.net    errorlog Logs/about.com-error_log    Customlog Logs/about.com-access_log common</virtualhost>

Attention

The 1.VirtualHost is sequential, matching 2 from the first start. Ability to configure multiple Serveralias to match multiple addresses. 3. If 403 (Forbidden) appears, change alloverride none to alloverride all

p=222 ">http://www.erdian.net/?p=222

Copyright notice: This article blog original articles, blogs, without consent, may not be reproduced.

Apache configures two domain names to match folders and configure multiple Web sites

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.