I'm having a problem with configuring some virtual hosts on a server which is sitting behind a firewall.
I'd like to use 3 name-based Virtual Hosts on my server. The two domains concerned have registered DNS entries pointing to my (one) external IP address. Requests to those domains are forwarded to my internal web server. It is a Windows box running Apache 2.0. My httpd.conf file is pretty much what came with the installation, but I've appended virtual hosts for the three domains. Unfortunately, the only site that is being served is the first in the list, which I believe is the default when the other sites can't be resolved.
So, it looks like this:
External DNS:
-> 165.192.10.1 (say)
-> 165.192.10.1
165.192.10.1 (firewall/router) -> 192.168.0.1 (internal nic)
192.168.0.3 is the internal webserver. Port 80 requests to 165.192.10.1 are routed here.
Virtual host directives in httpd.conf are like this:
As I mentioned above, I've made no other changes to httpd.conf. Is there another parameter I've missed? Only is being served. Any requests made to are "redirected" to site1. Any pointers to the appropriate place or errors to look for would be a help too.
Thanks!
I'd like to use 3 name-based Virtual Hosts on my server. The two domains concerned have registered DNS entries pointing to my (one) external IP address. Requests to those domains are forwarded to my internal web server. It is a Windows box running Apache 2.0. My httpd.conf file is pretty much what came with the installation, but I've appended virtual hosts for the three domains. Unfortunately, the only site that is being served is the first in the list, which I believe is the default when the other sites can't be resolved.
So, it looks like this:
External DNS:
-> 165.192.10.1 (say)
-> 165.192.10.1
165.192.10.1 (firewall/router) -> 192.168.0.1 (internal nic)
192.168.0.3 is the internal webserver. Port 80 requests to 165.192.10.1 are routed here.
Virtual host directives in httpd.conf are like this:
Code:
<VirtualHost *:80>
ServerName [URL unfurl="true"]www.site1.com[/URL] [b]this gets served[/b]
DocumentRoot F:\dir\[URL unfurl="true"]www\site1[/URL]
</VirtualHost>
<VirtualHost *:80>
ServerName [URL unfurl="true"]www.site2.com[/URL] [b]this never gets served[/b]
DocumentRoot F:\dir\[URL unfurl="true"]www\site2[/URL]
</VirtualHost>
<VirtualHost *:80>
ServerName serverconf.site2.com
DocumentRoot F:\dir\[URL unfurl="true"]www\conf[/URL]
</VirtualHost>
[b]this is for my use only - for configuring PHP etc[/b]
As I mentioned above, I've made no other changes to httpd.conf. Is there another parameter I've missed? Only is being served. Any requests made to are "redirected" to site1. Any pointers to the appropriate place or errors to look for would be a help too.
Thanks!