【发布时间】:2014-06-26 15:16:16
【问题描述】:
所以我将 Wampserver 用于开发目的,并且我设法设置了用于开发目的的服务器(它与 Dreamweaver 一起工作,PHP 工作等)但是在访问 localhost 时,我收到 404 错误。
我几乎没有更改设置,只是将其设置为使用该 vhosts 文件,然后我在系统 32 的 hosts 文件中创建了一些新主机,一切正常。
localhost/phpmyadmin 确实可以工作,但是,所以我真的很困惑为什么它不会加载任何东西。我还尝试加载一个站点文件夹(localhost/Rufus),该文件夹也返回 404。我需要指向 www 文件夹的所有目录,我的所有文件都保存在该文件夹中。
在任何人说之前,不,这不是 Skype 或 IIS,因为它们都已关闭并且 Wampserver 正在端口 80 上运行(我检查过)
我的虚拟主机文件:
# Virtual Hosts
#
# Required modules: mod_log_config
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.4/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "c:/Apache24/docs/dummy-host.example.com"
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "c:/Apache24/docs/dummy-host2.example.com"
ServerName dummy-host2.example.com
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
<Directory C:\Users\Tom\sites\wamp\www>
Order Deny,Allow
Allow from all
</Directory>
<VirtualHost *:80>
DocumentRoot "C:\Users\Tom\sites\wamp\www\Rufus"
ServerName rufus.stone
</VirtualHost>
【问题讨论】:
-
向我们展示您的虚拟主机配置文件
-
编辑中。甚至不确定这是否是问题所在。当我在 Dreamweaver 中按 f12 时它似乎可以工作,但是打开 localhost 或 localhost/ 我创建的任何文件夹都不起作用。不过在使用虚拟主机之前它确实有效。
标签: apache wampserver