Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I'm trying to get apache to have multiple subdomains, but whenever I try and start apache I'm getting the following error:

(98)Address already in use: make_sock: could not bind to address [::]:80

I tried the following to see if anything was using the port:

root@xxx:/etc/apache2# netstat -ltnp | grep ':80'
root@xxx:/etc/apache2# lsof -i tcp:80

Note that they both came back with nothing. I'm new to this and I'm assuming I'm doing something blatantly wrong. Here is my 'default' file from sites-available:

Listen 80

<VirtualHost *:80>
    DocumentRoot /srv/www/
    ErrorLog /srv/www/
    LogLevel warn
    CustomLog /srv/www/ combined
<VirtualHost *:80>
    DocumentRoot /srv/aaa/
    ErrorLog /srv/aaa/
    LogLevel warn
    CustomLog /srv/aaa/ combined

I tried looking through the apache docs and I looked through a few other forums, but it seems everything I found had netstat returning something and were generally for single sites without subdomains.

Any help would be greatly appreciated.

share|improve this question
up vote 0 down vote accepted

This looks like a debian-ish system. With that configuration, you don't put listen directives in your vhost files as they are already listed in /etc/apache2/ports.conf. If this system is not a debian-ish system, just grep -R listen /etc/apache2 and find where it's defined.

share|improve this answer
So that seemed to work, but I guess I'm lost as to why that would make a difference. Why would putting Listen in the vhosts file make a difference? Isn't apache just picking up each file and 'tailing' them one after another? I assumed any location would work... – Aram Papazian Jun 3 '13 at 17:11
If you have Listen 80 twice in your config, apache will try to listen on port 80 twice. The second time will fail, as something is already listening on that port (apache itself). – Dennis Kaarsemaker Jun 3 '13 at 17:13
Ahhhhhh gots it. So from the sounds of it you can only have 1 thing listening to a port at any given time? – Aram Papazian Jun 3 '13 at 17:18

Your Answer


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.