Httpd – Overlapping Virtualhost on port 80

apache-2.2httpdvirtualhost

On my clients web server, he has this apache conf file:

rails_passenger_conf

Listen *:80
<VirtualHost *:80>

    # rails public folder
    DocumentRoot /www/myclientdomain.com/public
    ServerName myclientdomain.com
    RailsEnv production

</VirtualHost>

I wanted to add a subdomain to the server for testing purposes so I added a new conf file that apache would read:

my_dev_subdomain.conf

Listen *:80
<VirtualHost *:80>

    DocumentRoot /www/dev.myclientdomain.com
    ServerName dev.myclientdomain.com

</VirtualHost>

And upon using apachectl –configtest I get this:

[warn] _default_ VirtualHost overlap on port 80, the first has precedence
(98)Address already in use: make_sock: could not bind to address [::]:80

Now, I'm obviously no apache expert. I'm just a web developer but I thought I knew enough about web administration to get a basic subdomain running… apparently not. Can anyone point me in the right direction?

Best Answer

You only need one "Listen *:80" in your apache config. Get rid of the one in your subdomain config file and that should take care of it.

Related Topic