English 中文(简体)
WAMP 服务器使用另一个文档ROOot, 比我要求的要多
原标题:WAMP Server takes another DocumentRoot than I prescribed

我安装了WAMP服务器,正常工作正常。

我更改了某些设置, 包括 < code> Documentroot 指令。 但是当我启动服务器, 通过网络浏览器打开 < engery > localhost 时, 它给出了一个 < code> 403 错误。 当我打开错误日志时, 我看到原因 :

警告:鲁特文件[C:/Apache2/docs/dom- host.example.com]不存在

但等待... 在 < strong> httpd.conf 文件中, DocumentRooot 指令被适当设置为 < strong > A:/website/www/ 。

这怎么可能?

最佳回答

听起来你编辑错文件了

我使用另一个 WAMP (Wamp- Developer) 但我猜想您的 httpd.conf s DocumentRooot 是服务器( 非虚拟Host) DocumentRooot 。

您正在寻找编辑网站 s (localhosts) 虚拟主机块, 它要么在 httpd.conf 结尾处, 要么在另一个文件( 由 httpd.conf 包含 ) 中 。

通过这样的命令行运行 Apache :

httpd -S

它会告诉你虚拟住址在哪里

您还需要确保您的自定义文档Rooot 拥有所有访问权限 。

<Directory /xxxx>
order allow,deny
allow from all
...
问题回答

您可能在 httpd.conf 中未添加此行 :

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

httpd- vhosts.conf 是您可以将您的虚拟Host 指令与其它指令分开的文件, 但它包含一个导致错误的虚拟Host( 确切地说是您的 dom- host.example ) 样本 。

So you have to replace the sample host with your one(s). But you can also comment the include line and write the VirtualHost directly in your httpd.conf.

正确读取错误日志很重要 :

警告: DocumentRoot [C:/Apache2/docs/dom- host.example. com] 不存在文件[C:/Apache2/docs/dom- host. example. com]

因此我们必须在一些文件里找到一个指令, 试图定义一个虚拟主机。 在我的案例中( W7pro, WAMP ) 我发现它的位置如下:

C:wampinapacheApache2.2.21confextrahttpd- vost.conf :wampinapacheApacheApache2.2.21confextra httpd- vosts.conf 。

只要编辑文件,删除相应的虚拟主机指令即可。

如果工作有效,请尝试 127.0.0.1。 转到 C: WindowsSystem32drivversetc, 并添加( 或未加注) 如下一行:

127.0.0.1 当地东道主

对我来说,这是MSSQL报告服务:

SQL 服务器报告服务(MSSQLSERVER)

使它残废,而且效果良好。





相关问题
Using SimplePie with CodeIgniter and XAMPP

I am using CodeIgniter 1.7.2 with XAMPP 1.7.2 on a Windows computer. I am trying to make use of SimplePie. I followed all the instructions I could find: a copy of simplepie.inc is in my applications/...

Multiple Sites with common files

I have developed over 50 sites that all use the exact same files other than CSS and IMAGES, I currently duplicate the files each time I create a new site and upload different css and images. What ...

http server validation

I finish a litle http server, writing from scratch. I would like to be sure that my imlementation is conforme to the HTTP specifications. W3C give us tools for HTML/XML conformance, but i see nothing ...

热门标签