重启apache没有?
原来有几个站点?
有没有开mod_vhost?
这个配置文件是哪里的?如果是conf/extra/httpd-vhost.conf那么conf/httpd.conf里面有没有Include这个文件?
原来有几个站点?
有没有开mod_vhost?
这个配置文件是哪里的?如果是conf/extra/httpd-vhost.conf那么conf/httpd.conf里面有没有Include这个文件?
这个是在httpd.conf文件的,由于论坛限制字数只能这样放些关键的出来.原来四个站点都没问题,可以正常访问,再加多一个站点就不可以了,配置是一样的.现在我改了下,全部都不正常了,,输入www.o.com,www.f.com 等等访问的都是www.b.com .
输入www.o.com,www.f.com 等等访问的都是www.b.com .都是访问到第一个配置的上去了..
输入www.o.com,www.f.com 等等访问的都是www.b.com .都是访问到第一个配置的上去了..
ServerName localhost
DocumentRoot /SNS/public_html/
DirectoryIndex index.html index.php
</VirtualHost>类似这样的试试
虚拟主机IP地址对应的完整域名;
字符*,仅与NameVirtualHost *配合使用以匹配所有 的IP地址;或是
字符串_default_,与基于IP的虚拟主机联用以捕获所 有没有匹配的IP地址。
示例
<VirtualHost 10.1.2.3>
ServerAdmin [email protected]
DocumentRoot /www/docs/host.foo.com
ServerName host.foo.com
ErrorLog logs/host.foo.com-error_log
TransferLog logs/host.foo.com-access_log
</VirtualHost>
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot d:/web/root/
ServerName test1
ErrorLog logs/test1_error_log
CustomLog logs/test1-access_log common
<Directory "d:/web/root/">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost><VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot d:/web/shop/
ServerName test2
ErrorLog logs/test2_error_log
CustomLog logs/test2-access_log common
<Directory "d:/web/shop/">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>我的配置,因为我没有申请域名,所以只能在hosts文件里加入
127.0.0.1 test1
127.0.0.1 test2然后http://test1 http://test2访问正常.