Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ubuntu error with apache: (98)Address already in use

I am getting this error when I try to start Apache in Ubuntu.

 (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80  no listening sockets available, shutting down  Unable to open logs  Action 'start' failed. 

I have this in my ports.conf

NameVirtualHost *:80 Listen 80 

This is my vhost file

<VirtualHost *:80>           ServerAdmin [email protected]           ServerName rails.server.com           # ServerAlias           DocumentRoot /var/www/sample_app/current/public           ErrorLog /var/www/sample_app/error.log            RailsEnv production         <Directory "/var/www/sample_app/current/public">           Options Indexes FollowSymLinks MultiViews           Order allow,deny           Allow from all         </Directory> </VirtualHost> 

What am I missing?

like image 947
SilverNightaFall Avatar asked May 24 '12 21:05

SilverNightaFall


People also ask

What is AH00072?

An Apache AH00072: make_sock: could not bind to address error message is generated when there is another process listening on the same port that Apache is configured to use. Typically the port will be the standard port 80 for HTTP connections, or port 443 for HTTPS connections.


2 Answers

It seems port 80 is already taken. Use another port or try netstat (grep the result to select only the row with value 80 in it), ps and kill to see what application occupies the port and shut it down.

like image 35
toniedzwiedz Avatar answered Oct 04 '22 20:10

toniedzwiedz


netstat -ltnp | grep :80 

This would return the following:

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

Then run the following command:

sudo kill -9 1047 

(1047 - pid no)

(the pid that appears on your particular instance.)

Restart Apache.

sudo service apache2 restart 

Reference to Ubuntu Forums.

like image 126
pinku Avatar answered Oct 04 '22 21:10

pinku