繁体   English   中英

使用Apache 2.4和Mono的Fedora 22服务器上的503错误

[英]503 Error On Fedora 22 Server Using Apache 2.4 and Mono

我目前正在尝试设置家庭网络服务器。 我有很多使用C#编程的经验,并且多年来一直使用Visual Studio和IIS。 我最近决定转向Linux,并一直使用MonoDevelop重建我的代码库。 我让它们在我的开发机器上编译,因此我要使用Fedora 22 Server和Apache 2.4设置家庭服务器。

仅使用默认配置,服务器就可以毫无问题地提供html页面的服务,但是当我安装Mono及其依赖项时,我遇到了各种各样的错误,并且它们的详细程度不足以使我的经验有限的人无法解决。 我花了整整一个星期的时间来解决这个问题,这就是我遇到的问题。

浏览到http://71.41.214.194/LDC-Demo/index.aspx时 ,在浏览器中收到“ 503 Service Unavailable”错误。 查看Apache错误日志时,我得到以下信息:

[Fri Oct 09 15:22:41.809588 2015] [:error] [pid 7577] Failed to connect to mod-mono-server after several attempts to spawn the process.

由于这不足以识别问题,因此我重新启动了Apache并尝试重新加载页面(我希望找到一个相关的错误,可以帮助我解决该问题)

[Fri Oct 09 15:38:22.000257 2015] [mpm_prefork:notice] [pid 7564] AH00170: caught SIGWINCH, shutting down gracefully
[Fri Oct 09 15:38:23.011225 2015] [:alert] [pid 7564] (13)Permission denied: Failed to acquire dashboard lock before destroying the dashboard
[Fri Oct 09 15:38:23.011668 2015] [:alert] [pid 7564] (13)Permission denied: Failed to acquire dashboard lock before destroying the dashboard
[Fri Oct 09 15:38:23.011770 2015] [:alert] [pid 7564] (13)Permission denied: Failed to acquire dashboard lock before destroying the dashboard
[Fri Oct 09 15:38:24.068911 2015] [core:notice] [pid 7641] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Fri Oct 09 15:38:24.069933 2015] [suexec:notice] [pid 7641] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globa$
[Fri Oct 09 15:38:24.079961 2015] [auth_digest:notice] [pid 7641] AH01757: generating secret for digest authentication ...
[Fri Oct 09 15:38:24.080817 2015] [lbmethod_heartbeat:notice] [pid 7641] AH02282: No slotmem from mod_heartmonitor
[Fri Oct 09 15:38:24.088966 2015] [mpm_prefork:notice] [pid 7641] AH00163: Apache/2.4.16 (Fedora) mod_mono/3.12 configured -- resuming normal operations
[Fri Oct 09 15:38:24.088993 2015] [core:notice] [pid 7641] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Fri Oct 09 15:38:36.414478 2015] [:error] [pid 7651] Failed to connect to mod-mono-server after several attempts to spawn the process.

在尽我所能研究了所有这些消息之后,我找不到与该问题相关的任何信息。 我确实发现,如果运行命令“ journalctl -xe -cat”,我可以看到更多详细信息。

Started The Apache HTTP Server.
mono[7646]: segfault at 5 ip 0000000000512710 sp 00007fffa85f01b0 error 6 in mono-sgen[400000+34d000]
<audit-1130> pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=httpd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Unregistered Authentication Agent for unix-process:7633:25881589 (system bus name :1.83, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)
<audit-1400> avc:  denied  { execmem } for  pid=7649 comm="mono" scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:system_r:httpd_t:s0 tclass=process permissive=0
<audit-1400> avc:  denied  { execmem } for  pid=7649 comm="mono" scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:system_r:httpd_t:s0 tclass=process permissive=0
<audit-1701> auid=4294967295 uid=48 gid=48 ses=4294967295 subj=system_u:system_r:httpd_t:s0 pid=7649 comm="mono" exe="/usr/bin/mono-sgen" sig=11
mono[7649]: segfault at 5 ip 0000000000512710 sp 00007ffe5ca30440 error 6 in mono-sgen[400000+34d000]
Not saving repeating crash in '/usr/bin/mono-sgen'
Not saving repeating crash in '/usr/bin/mono-sgen'
<audit-1400> avc:  denied  { sigchld } for  pid=7647 comm="abrt-hook-ccpp" scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=process permissive=0
Failed to create core_backtrace: waitpid failed: Permission denied
Blacklisted package 'mono-core'
'post-create' on '/var/spool/abrt/ccpp-2015-10-09-15:38:24-7644' exited with 1
Deleting problem directory '/var/spool/abrt/ccpp-2015-10-09-15:38:24-7644'
<audit-1400> avc:  denied  { execmem } for  pid=7661 comm="mono" scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:system_r:httpd_t:s0 tclass=process permissive=0
<audit-1400> avc:  denied  { execmem } for  pid=7661 comm="mono" scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:system_r:httpd_t:s0 tclass=process permissive=0
<audit-1701> auid=4294967295 uid=48 gid=48 ses=4294967295 subj=system_u:system_r:httpd_t:s0 pid=7661 comm="mono" exe="/usr/bin/mono-sgen" sig=11
mono[7661]: segfault at 5 ip 0000000000512710 sp 00007ffed5a32ee0 error 6 in mono-sgen[400000+34d000]
Not saving repeating crash in '/usr/bin/mono-sgen'

这些消息中有很多信息,但是我仍然无法找到原因。 最后5行重复3次。

我曾尝试对apache配置文件(httpd.conf)和mod_mono.conf文件进行修改,但是似乎没有任何事情可以解决我的问题。

在当前配置中,mod_mono.conf文件未从默认配置中进行修改,而我对httpd.conf所做的唯一更改是添加了一个虚拟主机部分,如下所示:

<VirtualHost *:80>
  ServerName LDC-Demo
  ServerAdmin root@localhost
  ServerAlias LDC-Demo
  DocumentRoot /var/www/html/LDC-Demo/
  MonoServerPath LDC-Demo "/usr/bin/mod-mono-server4"
  MonoDebug LDC-Demo true
  MonoSetEnv LDC-Demo MONO_IOMAP=all
  MonoApplications LDC-Demo "/:/var/www/html/LDC-Demo"
  <Location "/LDC-Demo">
    Allow from all
    Order allow,deny
    MonoSetServerAlias LDC-Demo
    SetHandler mono
    SetOutputFilter DEFLATE
    SetEnvIfNoCase Request_URI "\.(?:gif|jpe?g|png)$" no-gzip dont-vary
  </Location>
</VirtualHost>

如我上面所述,任何想法都将不胜感激,我整个星期都在努力,并且没有取得太大进展。

我在上面输入此内容作为评论,但我想回答这个问题。

我想通了。 Fedora运行SELinux,并且正在干扰mod_mono运行所需的权限。 要查看这些设置,我运行了命令:getenforce然后使用以下命令临时更改设置:setenforce 0最后,重新启动Apache:apachectl restart我刷新了Web浏览器并正确加载了页面。 要使设置永久不变,请编辑selinux文件:nano / etc / sysconfig / selinux我重新启动了服务器,并尝试再次加载该网页。 尤里卡! 一切正常。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM