Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Virtual hosts on firewalled server 1

Status
Not open for further replies.

billieT

MIS
Dec 11, 2001
107
NZ
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:
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!
 
How to set up Name Based Vitualhosts on Apache.
faq65-1831
 
sleipnir214 - ahhhhhh! no, I don't have that directive in place! I'd say that's what my problem is right there.

smah - that doco doesn't describe anything I haven't already done, and it's for Apache 1.3, so I don't think it's that applicable.

Thanks for responding. I'll report back on how I get on.
 
It still applies, and the first part of the configuration info is:
Uncomment

BindAddress *

Also uncomment

NameVirtualHost *
 
smh - I'm afraid that the fact the first line that says to uncomment BindAddress put me off, since there isn't such a directive in the apache2 httpd.conf file. Thus my discounting the rest of it, since there obviously are some relevant changes.

Thanks anyway.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top