在linux系統下apache的預設安裝路徑在哪

2020-11-05 18:01:22

如果採用RPM包安裝,安裝路徑應在 /etc/httpd目錄下。

(學習教學推薦:)

apache組態檔:/etc/httpd/conf/httpd.conf 可以修改相關的存取路徑及設定

Apache模組路徑:/usr/sbin/apachectl 啟動模組

web目錄:/var/www/html 專案的儲存路徑

如果採用原始碼安裝,一般預設安裝在/usr/local/apache2目錄下。

啟動apache報錯資訊,很大程度需要檢查是不是埠被佔用了,因為預設apache啟動的是80埠。像nginx預設頁是開啟80埠。

報錯資訊如下:

[root@localhost ~]# service httpd restart
Redirecting to /bin/systemctl restart httpd.service
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
[root@localhost ~]# service httpd status
Redirecting to /bin/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 三 2018-12-05 14:42:42 CST; 11s ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 3640 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
  Process: 3639 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 3639 (code=exited, status=1/FAILURE)

12月 05 14:42:42 localhost.localdomain httpd[3639]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
12月 05 14:42:42 localhost.localdomain httpd[3639]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
12月 05 14:42:42 localhost.localdomain httpd[3639]: no listening sockets available, shutting down
12月 05 14:42:42 localhost.localdomain httpd[3639]: AH00015: Unable to open logs
12月 05 14:42:42 localhost.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
12月 05 14:42:42 localhost.localdomain kill[3640]: kill: cannot find process ""
12月 05 14:42:42 localhost.localdomain systemd[1]: httpd.service: control process exited, code=exited status=1
12月 05 14:42:42 localhost.localdomain systemd[1]: Failed to start The Apache HTTP Server.
12月 05 14:42:42 localhost.localdomain systemd[1]: Unit httpd.service entered failed state.
12月 05 14:42:42 localhost.localdomain systemd[1]: httpd.service failed.
[root@localhost ~]#

可以看到Address already in use錯誤,修改apache的埠。

編輯/etc/httpd/conf/httpd.conf

7197ed1592e8705919322e1f00ce3eb.png

再次重新啟動即可。

以上就是在linux系統下apache的預設安裝路徑在哪的詳細內容,更多請關注TW511.COM其它相關文章!