1、我更改了网站根目录;并在根目录下新建了test.php;浏览器localhost/test.php可以成功; 2、新建了两个站点后;浏览器locahost/test.php不可以,提示The requested URL /test.php was not found on this server 但是自己新建的两个站点可以用域名访问,请指教问题出在哪里
在httpd-vhost.conf里面插入
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "你的站点目录"
ServerName localhost
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
然后在httpd.conf里面
# Virtual hosts
#Include conf/extra/httpd-vhosts.conf
改为
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
接着重启apacha试试
按照你新建的两个站点再建一个叫作localhost的站点呗
localhost再重新配置一下,