Apache 500 错误,error.log 中没有条目

Apache 500 错误,error.log 中没有条目

这是在一台全新的 Ubuntu 14.04 服务器上,运行标准 WAMP 安装,并在其上添加了 Apache DAV_SVN(使用 LDAP 身份验证)(映射到/svn)。我能够让一切正常工作,并测试了通过 HTTP 访问 subversion 并通过 LDAP 进行身份验证,没有任何问题。

然后,我进入 /etc/network/interfaces 并将其从 DHCP 更改为使用静态 IP 地址(以便 DNS 服务器可以解析 SVN 的主机名)。我在服务器上执行了重新启动,之后任何访问尝试都会/svn导致 500 错误(在提供 ldap 身份验证凭据之后) - 但是访问只会/正确返回默认的 apache 页面。

但是,error.log 中没有 500 错误的记录,所以我无法调试错误是什么。我不确定错误是与将凭据传送给 LDAP、SVN、Apache 还是其他有关。


更新

我可以确认返回 DHCP 可以让 SVN 再次工作,但是我需要一个静态 IP,以便我可以对 SVN 使用主机名路由 - 对存储库使用动态 IP 会造成管理混乱。

错误日志

[Fri Feb 06 10:17:37.915182 2015] [mpm_prefork:notice] [pid 1090] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.3 configured -- resuming normal operations
[Fri Feb 06 10:17:37.915260 2015] [core:notice] [pid 1090] AH00094: Command line: '/usr/sbin/apache2'
[Fri Feb 06 10:19:45.681937 2015] [mpm_prefork:notice] [pid 1090] AH00169: caught SIGTERM, shutting down
[Fri Feb 06 10:19:46.786369 2015] [mpm_prefork:notice] [pid 1987] AH00163: Apache/2.4.7 (Ubuntu) SVN/1.8.8 PHP/5.5.9-1ubuntu4.3 configured -- resuming normal operations
[Fri Feb 06 10:19:46.786434 2015] [core:notice] [pid 1987] AH00094: Command line: '/usr/sbin/apache2'
[Fri Feb 06 10:19:48.285095 2015] [mpm_prefork:notice] [pid 1987] AH00169: caught SIGTERM, shutting down
[Fri Feb 06 10:19:49.398153 2015] [mpm_prefork:notice] [pid 2074] AH00163: Apache/2.4.7 (Ubuntu) SVN/1.8.8 PHP/5.5.9-1ubuntu4.3 configured -- resuming normal operations
[Fri Feb 06 10:19:49.398214 2015] [core:notice] [pid 2074] AH00094: Command line: '/usr/sbin/apache2'
[Fri Feb 06 10:41:45.351303 2015] [mpm_prefork:notice] [pid 2074] AH00169: caught SIGTERM, shutting down
[Fri Feb 06 10:41:46.517131 2015] [mpm_prefork:notice] [pid 3665] AH00163: Apache/2.4.7 (Ubuntu) SVN/1.8.8 PHP/5.5.9-1ubuntu4.3 configured -- resuming normal operations
[Fri Feb 06 10:41:46.517209 2015] [core:notice] [pid 3665] AH00094: Command line: '/usr/sbin/apache2'
[Fri Feb 06 10:42:41.050821 2015] [dav:error] [pid 3669] [client 192.168.12.162:59312] Could not fetch resource information.  [301, #0]
[Fri Feb 06 10:42:41.050932 2015] [dav:error] [pid 3669] [client 192.168.12.162:59312] Requests for a collection must have a trailing slash on the URI.  [301, #175002]
[Fri Feb 06 10:46:13.366128 2015] [mpm_prefork:notice] [pid 3665] AH00169: caught SIGTERM, shutting down
[Fri Feb 06 10:46:14.514782 2015] [mpm_prefork:notice] [pid 3738] AH00163: Apache/2.4.7 (Ubuntu) SVN/1.8.8 PHP/5.5.9-1ubuntu4.3 configured -- resuming normal operations
[Fri Feb 06 10:46:14.514837 2015] [core:notice] [pid 3738] AH00094: Command line: '/usr/sbin/apache2'
[Fri Feb 06 10:56:37.258172 2015] [mpm_prefork:notice] [pid 3738] AH00169: caught SIGTERM, shutting down
[Fri Feb 06 11:09:35.552252 2015] [mpm_prefork:notice] [pid 1526] AH00163: Apache/2.4.7 (Ubuntu) SVN/1.8.8 PHP/5.5.9-1ubuntu4.3 configured -- resuming normal operations
[Fri Feb 06 11:09:35.558499 2015] [core:notice] [pid 1526] AH00094: Command line: '/usr/sbin/apache2'
[Fri Feb 06 11:21:48.478383 2015] [mpm_prefork:notice] [pid 1526] AH00169: caught SIGTERM, shutting down
[Fri Feb 06 11:22:06.006478 2015] [mpm_prefork:notice] [pid 1067] AH00163: Apache/2.4.7 (Ubuntu) SVN/1.8.8 PHP/5.5.9-1ubuntu4.3 configured -- resuming normal operations
[Fri Feb 06 11:22:06.007231 2015] [core:notice] [pid 1067] AH00094: Command line: '/usr/sbin/apache2'
[Fri Feb 06 11:41:32.208255 2015] [mpm_prefork:notice] [pid 1067] AH00169: caught SIGTERM, shutting down
[Fri Feb 06 11:41:33.396579 2015] [mpm_prefork:notice] [pid 1392] AH00163: Apache/2.4.7 (Ubuntu) SVN/1.8.8 PHP/5.5.9-1ubuntu4.3 configured -- resuming normal operations
[Fri Feb 06 11:41:33.396643 2015] [core:notice] [pid 1392] AH00094: Command line: '/usr/sbin/apache2'

在此处输入图片描述 在此处输入图片描述

答案1

Stackoverflow 上已经发布了与您的问题类似的问题:

内部错误 500 Apache

首先,正如您所展示的,您的端口处于活动状态并接受用户,但是导航到子目录却不起作用。

我在 CentOS 上遇到了类似的问题,root 工作正常http://somesite.com但当我去http://somesite.com/xyz,它给了我一个 500 错误。

这是由于 /xyz 文件夹缺少权限以及 .htaccess/httpd.conf 文件未正确设置造成的:

<VirtualHost :80>
...
Insert your permissions here
</VirtualHost>

或者(假设您不希望公众访问它并将其限制为您选择的 IP):

<Directory /xyz>
Options Follow Symlinks
Order deny, allow # If you want it to be public, use Order Allow, Deny; and
Deny from all #Allow from all
Allow from {IP of your choosing} #If Allow from all is present, this is line is not necessary. 
</Directory>

弄乱你的 httpd.conf/.htaccess 文件,这是一个权限问题。:)

编辑:

此外,如果您使用数据库在 /xyz 上提供内容,请确保后端 .php 使用的凭据正确,数据库错误可以通过 500 内部错误从公共视图中隐藏。(检查这一点的一种简单方法是:apt-get install lynx,然后发出 lynxhttp://127.0.0.1/svn

答案2

只是想跟进并发布问题和解决方案。基本上,问题是我在设置静态 IP 时没有分配本地 DNS 服务器,因此它没有解析 LDAP 服务器主机名。当为 DHCP 设置时,它使用 DHCP 分配的 DNS 就好了。解决方案只是将本地 DNS 服务器添加到 中/etc/network/interfaces,之后一切都正常工作。

我仍不确定为什么没有为此生成错误日志条目。

相关内容