Starting apache fails (could not bind to address 0.0.0.0:80)

China☆狼群 提交于 2019-11-28 15:21:16
StandDuPp

Worked for me running this command:

fuser -k -n tcp 80

It may be skype or nginx using the port 80.

Try shutting down skype, or running: sudo /etc/init.d/nginx stop

I had the same error, and just want to confirm that running

    sudo netstat -ltnp | grep ':80'

helped me indicate that Hiawatha webserver was in the way of Apache2.

Removing Hiawatha fixed the issue (sudo dpkg --purge hiawatha). Ubuntu 12.04.2 server.

I had the same problem

For me, apache was already running but it was running the wrong way.

Killing processes didnt work because a daemon kept reinstantiating it.

apachectl stop   

resolved the issue.

Sam

Try this, it works for me…

sudo netstat -ltnp | grep ':80'

This would return the following:

tcp6 0 0 :::80 :::* LISTEN 1047/apache2

Then

sudo kill -9 1047

Then I was able to restart Apache and everything was working fine.

Go to device manager, select “show hidden devices” from menu/view, go to “Non-Plug and Play Driver”/HTTP, double click it to disable it (and disable or manual some services depended on it). Reboot and enjoy!

What I would do is simply check if the following is set in your /etc/apache2/sites-available/your-domain-name.com.conf

SSLEngine on 
SSLCertificateFile /your/path/to/your-domain.com.crt
SSLCertificateKeyFile /your/path/to/your-domain.com.key
SSLCACertificateFile /your/path/to/your-domain.com.ca-bundle

and there aren't any mistyped directories or anything else that would not supposed to be in your .conf file. It did the trick for me as re-starting and killing the processes did not help at all. It did not start anyway.

Satish Chauhan

It look like other process is using port 80.

$ netstat -anp | grep

eg. $ netstat -anp | grep 80

by above you get process name, if you want to use port then you need to stop the process or change the port

use either

sudo killall httpd

or

sudo killall apache2

check if some one using the 80 port

sudo netstat -tulpn| grep :80

The restart

sudo service httpd start

then restart the server.It took me a whole day to understand the issue

sreeks devan

This will happen because of repeated installation of apache or port is using by another service

sudo lsof -i | grep "httpd"

You will find process id and listening port of service. Then check

cd /proc/(process id of http)

Then kill that process using command

kill -9 pid

now

sudo netstat -nltp

again kill the process

syntax:-

kill -9 pid

and now start apache

sudo ./apachectl start
luqman

I fixed it by using below procedure. Run below command as root user.

root# ps aux |grep apache

It will show you Apache PID, just kill that PIDs and restart Apache Server.

You can only have listen PORTNUMBER in only one file of .conf. Do not put it in multiple files. Try it :)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!