Our server is running Apache on port 9000 (because IIS is at 80) and we have the following configuration (vhosts.conf) to access our sites:
NameVirtualHost *:9000 UseCanonicalName Off <VirtualHost *:9000> ServerAlias %1.ourserver VirtualDocumentRoot D:/oursites/%1 VirtualScriptAlias D:/oursites/%1 </VirtualHost>
So we can open the browser and access by
http://someclient.ourserver:9000/. So far so good.
Now we are installing a new server, where Apache will run on port 80, but we need that one specific site to have the
VirtualDocumentRoot to a different drive/directory. We tried something like this (with no success):
NameVirtualHost *:80 UseCanonicalName Off <VirtualHost specificsite.ourdomain.com:80> ServerAlias specificsite.ourdomain.com VirtualDocumentRoot C:/specificsite VirtualScriptAlias C:/specificsite </VirtualHost> <VirtualHost *:80> ServerAlias %1.ourserver VirtualDocumentRoot D:/oursites/%1 VirtualScriptAlias D:/oursites/%1 </VirtualHost>
When we test, the result is that, accessing
http://specificsite.ourdomain.com/ on browser, Apache tries to "redirect" to
D:/oursites/specificsite, which is not correct.
http://someclient.ourserver/ Apache redirects correctly to
So what am I missing? Looks like I am forgetting a little detail that is resulting in all requests falling at the second VirtualHost.
- Running Xampp 1.7.7 on
- Windows Server 2008 R2 with
- Two entries on DNS management: one for the *.ourserver and another for the specificsite.ourdomain.com;
- The reason of using
specificsite.ourdomain.comis that our clients can access this specific site that is hosted on our server.
Thanks in advance for any help!