Connect the apache config开发者_开发技巧 files with the command:
include / usr / local / apache / conf / sites / *. conf
Create a file with two virtualhost.
<VirtualHost *>
ServerAdmin webmaster@as.com
ServerName site.com
ServerAlias site.com
DocumentRoot "/var/www/pachko1/site.com"
</VirtualHost>
<VirtualHost *>
ServerAdmin webmaster@as.com
ServerName site1.com
ServerAlias site1.com
DocumentRoot "/var/www/site1/site1.com"
</VirtualHost>
But when accessing site1.com always opens a folder of site.com.
If they are interchanged, when referring to site.com will open site1.com
Always works feather rule, why is this happening?
Sorry for my English.
Try adding NameVirtualHost
directives:
NameVirtualHost site.com
NameVirtualHost site1.com
and then add the actual host names to the VirtualHost
directives:
<VirtualHost site.com>
...
<VirtualHost site1.com>
精彩评论