Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am running an SVN host from my windows box, along with a few local development sites.

The problem I am having, when I have no virtual hosts everything works fine as everything directs explcitly.

When I have one virtual host (for convenience):

NameVirtualHost *:80

<VirtualHost *:80>
 ServerName www.localsite.home
 DocumentRoot "D:/ws/localsite/"
</VirtualHost>

It works fine for localsite.home, but now localhost doesnt correctly work, and everything is redirected to that localsite folder. It also means SVN stops working externally and locally. How do I fix this?

share|improve this question

2 Answers 2

Try removing the ServerName option. With this option your one virtual host may not like any other names. If you add additional Virtual hosts in the future keep this one as the first definition. It will catch any undefined names.

share|improve this answer

The problem is Apache if it cannot find a matching virtualhost will default to the first vitualhost.

I have replaced the first virtualhost with:

<VirtualHost *:80>
    DocumentRoot "D:/ws/"
</VirtualHost>

Everything works fine, but external SVN users are still unable to connect.

share|improve this answer

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.