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