Can't seem to run Apache 2.2 on Ubuntu 10.10 (Maverick Meerkat)

2

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.

Pam

Posted 2011-04-19T00:30:59.683

Reputation: 21

Answers

3

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/.

Patches

Posted 2011-04-19T00:30:59.683

Reputation: 14 078

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 – 2011-09-06T18:04:32.477