微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

我无处不在地改变Apache的DocumentRoot无济于事

我不知道我在做什么错,但我不能用Apache改变我的本地主机文件的目录。 我用httpd.conf尝试了各种各样的东西,包括把“允许,拒绝”改为“要求全部允许” 。 它仍然不起作用。

我正在运行Windows 7 64位,我试图让Apache工作,但迄今为止所有的解决scheme没有帮助我更改DocumentRoot由于错误403。

这里是httpd.conf

这是我的错误日志自最近的服务重新启动

Apache多个DocumentRoot

您在CentOS中没有Apache的权限错误

The Apache2.4 service is restarting. The Apache2.4 service has restarted. m_winnt:notice [pid5304:tid 468] AH00424: Parent: Received restart signal -- Restarting the server. [Mon Sep 22 22:37:25.315061 2014] [ssl:warn] [pid 5304:tid 468] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name [Mon Sep 22 22:37:25.315061 2014] [mpm_winnt:notice] [pid 5304:tid 468] AH00455: Apache/2.4.10 (Win32) OpenSSL/1.0.1h configured -- resuming normal operations [Mon Sep 22 22:37:25.315061 2014] [mpm_winnt:notice] [pid 5304:tid 468] AH00456: Apache Haus VC9 Server built: Jul 15 2014 20:34:18 [Mon Sep 22 22:37:25.315061 2014] [core:notice] [pid 5304:tid 468] AH00094: Command line: 'C:\Apache24\bin\httpd.exe -d C:/Apache24' [Mon Sep 22 22:37:25.317061 2014] [mpm_winnt:notice] [pid 5304:tid 468] AH00418: Parent: Created child process 3648 [Mon Sep 22 22:37:26.075104 2014] [ssl:warn] [pid 3648:tid 344] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name [Mon Sep 22 22:37:26.265115 2014] [mpm_winnt:notice] [pid 6612:tid 348] AH00364: Child: All worker threads have exited. [Mon Sep 22 22:37:26.372121 2014] [ssl:warn] [pid 3648:tid 344] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name [Mon Sep 22 22:37:26.375121 2014] [mpm_winnt:notice] [pid 3648:tid 344] AH00354: Child: Starting 64 worker threads. [Mon Sep 22 22:43:06.157556 2014] [autoindex:error] [pid 3648:tid 1052] [client ::1:53336] AH01276: Cannot serve directory C:/Apache24/htdocs/: No matching DirectoryIndex (index.html) found,and server-generated directory index forbidden by Options directive

像这样的配置应该工作:

DocumentRoot "C:/www" <Directory "C:/www"> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny Allow from all </Directory>

在对httpd.conf文件进行了任何更改之后,请不要忘记重新启动服务器。 我也会尝试临时删除位于C:/www文件夹中的任何现有的.htaccess文件

要检查配置文件的语法是否正确,请使用-t选项:

httpd -t

您也可以检查logs/error.log以更好地描述出错的地方。

参考

在Microsoft Windows上安装Apache 2.2

首先改变httpd.conf文件

DocumentRoot "c:/www" <Directory "c:/www"> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory>

然后打开“ conf extra httpd-vhosts.conf”文件

<VirtualHost *:80> DocumentRoot "c:/Apache24/docs/dummy-host.example.com" </VirtualHost>

<VirtualHost *:80> DocumentRoot "C:www" </VirtualHost>

最后重新启动你的Apache Web服务器,你很好去..

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐