apache startup port is occupied solution

sudo service apache2 restart 报错
* Restarting web server apache2                                                (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.
                                                                         [fail]
* The apache2 instance did not start within 20 seconds. Please read the log files to discover problems

查下80端口占用情况,被nginx占用了。
mochong@bogon:~$ sudo  netstat -lnp|grep 80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1118/nginx

sudo service nginx stop
stop nginx. Then
sudo service apache2 restart
starts successfully

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326445327&siteId=291194637