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?

link|improve this question

74% accept rate
feedback

1 Answer

up vote 1 down vote accepted

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.

link|improve this answer
That worked, thanks! However after a index.html in the document root I get this error in my browser: Error 101 (net::ERR_CONNECTION_RESET): Unknown error. Any thoughts? – Jakobud Nov 21 '09 at 6:22
You have a screenshot of that? A 101 error is a valid http error code, but it's not indicitave of a connection reset, which is what looks like you have going on. What browser are you using? I googled that error, and saw a lot of Chrome users posting about the same error. – ErikA Nov 21 '09 at 6:28
Yes using Chrome. Tried it with Firefox and I get "The connection was reset" error. My DocumentRoot and the index.html both have 755 permissions. I don't need to add this subdomain to my host file do I? – Jakobud Nov 21 '09 at 6:44
No, if you're getting a connection reset error, your browser is resolving the name correctly. Are you using a proxy of any sort? – ErikA Nov 21 '09 at 6:46
No proxy. My Googling of this error was refering to Proxy setups and stuff like that. But I'm not using using any proxy or special web connection. Just a cable modem with my cable ISP. Nothing fancy. – Jakobud Nov 21 '09 at 6:56
show 2 more comments
feedback

Your Answer

 
or
required, but never shown

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