Linux
創建了一個 httpd 伺服器,但未載入範例頁面
我得到了一個伺服器來為我們的服務創建一個測試站點,這是我第一次嘗試這樣做,所以我做了很多研究,最後我找到了這個提供了很好指導的頁面,但即使在嘗試了所有這些之後,我無法載入我的簡單 index.php 頁面,我得到的只是超時錯誤頁面
我試圖執行調試,但我得到的只是以下警告
httpd -X AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message (13)Permission denied: AH00058: Error retrieving pid file /run/httpd/httpd.pid AH00059: Remove it before continuing if it is corrupted.
從我讀到的所有內容來看,這是一個警告。我更改了 /var/www 文件夾中文件的權限,以便使用者可以讀取和執行。是否有另一種方法來執行調試並找出我的範例頁面http://www.example.com/index.php沒有載入的原因。
我確定問題出在我的伺服器設置上,我非常絕望地發帖。
這是我的 httpd 版本的更新
[@localhost html]$ httpd -v Server version: Apache/2.4.6 (Red Hat Enterprise Linux) Server built: Sep 17 2015 09:06:30 [@localhost /]$ sudo systemctl status httpd.service ● httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled) Active: failed (Result: exit-code) since Thu 2016-03-10 08:47:25 EST; 18min ago Docs: man:httpd(8) man:apachectl(8) Process: 5049 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE) Process: 5047 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=0/SUCCESS) Main PID: 5047 (code=exited, status=0/SUCCESS) Mar 10 08:47:25 www.example.com systemd[1]: Starting The Apache HTTP Server... Mar 10 08:47:25 www.example.com httpd[5047]: httpd (pid 4920) already running Mar 10 08:47:25 www.example.com kill[5049]: kill: cannot find process "" Mar 10 08:47:25 www.example.com systemd[1]: httpd.service: control process exited, code=exited status=1 Mar 10 08:47:25 www.example.com systemd[1]: Failed to start The Apache HTTP Server. Mar 10 08:47:25 www.example.com systemd[1]: Unit httpd.service entered failed state. Mar 10 08:47:25 www.example.com systemd[1]: httpd.service failed. Mar 10 08:48:27 www.example.com systemd[1]: Stopped The Apache HTTP Server.
這是日誌文件
[Thu Mar 10 08:34:05.040127 2016] [mpm_prefork:notice] [pid 4021] AH00169: caught SIGTERM, shutting down [Thu Mar 10 08:34:08.720785 2016] [core:notice] [pid 4864] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0 [Thu Mar 10 08:34:08.721566 2016] [suexec:notice] [pid 4864] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [Thu Mar 10 08:34:08.742757 2016] [auth_digest:notice] [pid 4864] AH01757: generating secret for digest authentication ... [Thu Mar 10 08:34:08.743567 2016] [lbmethod_heartbeat:notice] [pid 4864] AH02282: No slotmem from mod_heartmonitor [Thu Mar 10 08:34:08.762688 2016] [mpm_prefork:notice] [pid 4864] AH00163: Apache/2.4.6 (Red Hat Enterprise Linux) PHP/5.4.16 configured -- resuming normal operations [Thu Mar 10 08:34:08.762712 2016] [core:notice] [pid 4864] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND' [Thu Mar 10 08:42:02.335809 2016] [mpm_prefork:notice] [pid 4864] AH00170: caught SIGWINCH, shutting down gracefully [Thu Mar 10 08:43:21.804591 2016] [core:notice] [pid 4919] SELinux policy enabled; httpd running as context unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 [Thu Mar 10 08:43:21.805328 2016] [suexec:notice] [pid 4919] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [Thu Mar 10 08:43:21.827883 2016] [auth_digest:notice] [pid 4920] AH01757: generating secret for digest authentication ... [Thu Mar 10 08:43:21.828964 2016] [lbmethod_heartbeat:notice] [pid 4920] AH02282: No slotmem from mod_heartmonitor [Thu Mar 10 08:43:21.849008 2016] [mpm_prefork:notice] [pid 4920] AH00163: Apache/2.4.6 (Red Hat Enterprise Linux) PHP/5.4.16 configured -- resuming normal operations [Thu Mar 10 08:43:21.849036 2016] [core:notice] [pid 4920] AH00094: Command line: 'httpd'
經過進一步研究,我發現我的設置是正確的,是防火牆。感謝所有的幫助!欲了解更多資訊,請查看此頁面
https://linuxconfig.org/how-to-stop-start-and-disable-enable-firewall-on-redhat-7-linux-system