[英]Install Apache 2 on a Linux server
我已將偵聽端口修改為8080。但是,當我運行“ apachetcl start”時,錯誤消息仍會顯示為:
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
我還檢查了Apache錯誤日志。
[Wed Dec 09 12:39:16.457678 2015] [mpm_event:notice]
[pid 96777:tid 139998996637568] AH00489: Apache/2.4.7
(Ubuntu) configured -- resuming normal operations
[Wed Dec 09 12:39:16.457753 2015] [core:notice] [pid 96777:tid 139998996637568] AH00094: Command line: '/usr/sbin/apache2'
如何隱藏此消息?
解決此問題的方法:
打開/etc/apache2/apache2.conf
最重要的是:ServerName localhost
現在關閉!
打開/etc/apache2/ports.conf
您將看到兩個80或443或8080。刪除一個並保存...現在
apachetcl start
或者,您可以執行以下操作:
sudo netstat -ltnp | grep ':80'
sudo kill -9 2242
然后重新啟動apache2
:
sudo /etc/init.d/apache2 restart
然后開始
sudo /etc/init.d/apache2 start
與JM511的響應相似,但操作順序不同。 他們推薦的方法是讓apache2
使用新的進程ID重新啟動自身,並且仍然占用端口。
sudo etc/init.d/apache2 stop
sudo netstat -ltnp | grep ':80'
sudo kill -9 2178 #killed the process id of the process listening to port 80
sudo opt/bitnami/ctlscript.sh restart apache
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.