Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Here's my error message when I run sudo apachectl start:

(98)Address already in use: make_sock: could not bind to address 127.0.0.1:80
no listening sockets available, shutting down
Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
myUser@myMachine:/etc
$ sudo apachectl stop
httpd (no pid file) not running

I'm brand new to Ubuntu (and Linux) and downloaded Apache 2.2 (worker) through Synaptic. I found a httpd.conf flavor I liked and am using it.

share|improve this question
add comment

1 Answer

Another server is already listening on port 80 (the standard HTTP port), so the server cannot start. You can either figure out what's running on it and stop or reconfigure it, or you can change the port Apache listens on.

To see what is currently listening on port 80, open a terminal and run the following command:

sudo netstat --tcp --udp --listening --program

One of the lines of output will have :www in the third column, as in this example from my machine:

tcp        0      0 *:www                   *:*                     LISTEN      1820/lighttpd   

The last column indicates the PID and executable of the program currently listing on that port. In my case, it's the lighttpd web server, so I'd stop it with the service command:

sudo service lighttpd stop

Alternatively, you can kill it using its PID:

sudo kill 1820

If you know what's running on port 80 and don't want to mess with it, you can instead reconfigure Apache to listen on a different port. To do so, edit your /etc/httpd/httpd.conf file and locate the following line:

Listen 80

Change 80 to any number not in use on your system, like 8080. Then, start Apache and you can visit it by appending a colon and the port number, like http://localhost:8080/.

share|improve this answer
    
Do you know if there might be another reason for this? I have nothing running on port 80 and the result from running the start command is still the same. –  Slavo Sep 6 '11 at 18:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.