簡體   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