Networking Forums

Networking Forums > Computer Networking > Linux Networking > Virtual host question

Reply
Thread Tools Display Modes

Virtual host question

 
 
Ron Abramson
Guest
Posts: n/a

 
      11-21-2004, 07:19 AM
I have one Windows machine on my LAN, the rest is Linux. It all sits
behind a Linksys NAT box (attached to a cable connection).

I use DynDNS, and host a personal web site at www.mygreatsite.org (this
name is fictional). This is free DNS, with one IP address (the one that my
cable modem obtains via DHCP), and one name, with "Wildcard" recognition
enabled (DynDNS will pass any machine prefix on my base domain name to the
same IP address as the base domain).

I also have IIS running on the Windows box. It has some services that are
not readily available on Linux, so it comes in handy from time to time.
Right now, the IIS server is configured on port 8080. On the NAT
firewall, port 80 is opened up to my main Apache installation on my Linux
server, and port 8080 is opened up to IIS on the Windows box.

Right now, from the outside world, a request to www.mygreatsite.org gets
directed to the Apache/Linux server, and a request to
www.mygreatsite.org:8080 gets directed to the Windows setup.

Port 8080 is a bit of a pain because some firewalls (like
the one where I work) block it. In fact, my office network blocks
just about everything except port 80 and a VERY SMALL set of other
ports. What I'd like to be able to do is create a virtual host called
windows.mygreatsite.org, which would be accessible via port 80, but on the
back end would really be serviced by IIS (with the actual port used by IIS
transparent to the user).

I've tried doing this using VirtualHost directives - setting up both the
default Linux VirtualHost and a second VirtualHost pointing to the
Windows machine, but it doesn't work. I get "Connection Refused" (and I
did make sure everything was open on the Windows side, such as IIS
configuration and Windows XP's own firewall).

Does anyone know the proper method for doing this, or a reference that
explains it - i.e., having Apache answer over one IP connection for two
different names, and then supply the corresponding content from two
different machines. Seems to me this must be possible. What do I have to
change in httpd.conf, /etc/hosts, DynDNS, etc. in order to get this to
work?


 
Reply With Quote
 
 
 
 
IANAL_VISTA
Guest
Posts: n/a

 
      11-21-2004, 02:12 PM
Ron Abramson <(E-Mail Removed)> wrote in
news(E-Mail Removed):

> I have one Windows machine on my LAN, the rest is Linux. It all sits
> behind a Linksys NAT box (attached to a cable connection).
>
> I use DynDNS, and host a personal web site at www.mygreatsite.org
> (this name is fictional). This is free DNS, with one IP address (the
> one that my cable modem obtains via DHCP), and one name, with
> "Wildcard" recognition enabled (DynDNS will pass any machine prefix on
> my base domain name to the same IP address as the base domain).
>
> I also have IIS running on the Windows box. It has some services that
> are not readily available on Linux, so it comes in handy from time to
> time. Right now, the IIS server is configured on port 8080. On the
> NAT firewall, port 80 is opened up to my main Apache installation on
> my Linux server, and port 8080 is opened up to IIS on the Windows box.
>
> Right now, from the outside world, a request to www.mygreatsite.org
> gets directed to the Apache/Linux server, and a request to
> www.mygreatsite.org:8080 gets directed to the Windows setup.
>
> Port 8080 is a bit of a pain because some firewalls (like
> the one where I work) block it. In fact, my office network blocks
> just about everything except port 80 and a VERY SMALL set of other
> ports. What I'd like to be able to do is create a virtual host called
> windows.mygreatsite.org, which would be accessible via port 80, but on
> the back end would really be serviced by IIS (with the actual port
> used by IIS transparent to the user).
>
> I've tried doing this using VirtualHost directives - setting up both
> the default Linux VirtualHost and a second VirtualHost pointing to the
> Windows machine, but it doesn't work. I get "Connection Refused" (and
> I did make sure everything was open on the Windows side, such as IIS
> configuration and Windows XP's own firewall).
>
> Does anyone know the proper method for doing this, or a reference that
> explains it - i.e., having Apache answer over one IP connection for
> two different names, and then supply the corresponding content from
> two different machines. Seems to me this must be possible. What do I
> have to change in httpd.conf, /etc/hosts, DynDNS, etc. in order to get
> this to work?


This may or may not help solve your problem.

http://www.buzzsurf.com/surfatwork/
 
Reply With Quote
 
Ron Abramson
Guest
Posts: n/a

 
      11-21-2004, 02:32 PM
On Sun, 21 Nov 2004 15:12:52 +0000, IANAL_VISTA wrote:

> This may or may not help solve your problem.
>
> http://www.buzzsurf.com/surfatwork/


Bzzzzt. Next?
 
Reply With Quote
 
Michael Heiming
Guest
Posts: n/a

 
      11-21-2004, 04:41 PM
In comp.os.linux.networking Ron Abramson <(E-Mail Removed)>:
> I have one Windows machine on my LAN, the rest is Linux. It all sits
> behind a Linksys NAT box (attached to a cable connection).

[..]

> Does anyone know the proper method for doing this, or a reference that
> explains it - i.e., having Apache answer over one IP connection for two
> different names, and then supply the corresponding content from two
> different machines. Seems to me this must be possible. What do I have to
> change in httpd.conf, /etc/hosts, DynDNS, etc. in order to get this to
> work?


Should be possible using mod_proxy/mod_rewrite from within
apache. Check the apache docs.

--
Michael Heiming (X-PGP-Sig > GPG-Key ID: EDD27B94)
mail: echo (E-Mail Removed) | perl -pe 'y/a-z/n-za-m/'
#bofh excuse 146: Communications satellite used by the military
for star wars.
 
Reply With Quote
 
Ron Abramson
Guest
Posts: n/a

 
      11-21-2004, 06:06 PM
On Sun, 21 Nov 2004 18:41:44 +0100, Michael Heiming wrote:

> In comp.os.linux.networking Ron Abramson <(E-Mail Removed)>:
>> I have one Windows machine on my LAN, the rest is Linux. It all sits
>> behind a Linksys NAT box (attached to a cable connection).

> [..]
>
>> Does anyone know the proper method for doing this, or a reference that
>> explains it - i.e., having Apache answer over one IP connection for two
>> different names, and then supply the corresponding content from two
>> different machines. Seems to me this must be possible. What do I have
>> to change in httpd.conf, /etc/hosts, DynDNS, etc. in order to get this
>> to work?

>
> Should be possible using mod_proxy/mod_rewrite from within apache. Check
> the apache docs.


Yes. Thanks much. mod_proxy with the ProxyPass directive seems to do the
trick. I see also that if I keep it really simple and use the same
directory name for the site on both ends, internal links resolve correctly
and I can avoid having to use mod_rewrite (which looks a little
complicated). After a few tests, it appears to be working. I needed to
put in ProxyPass twice, with and without an initial capital letter in the
virtual directory name (i.e., with a separate line representing this
directory each way), because the Linux setup is case sensitive whereas IIS
on Windows is not. After a bit of testing from a variety of browser
clients I can cautiously say that it seems to be working OK.
 
Reply With Quote
 
David Efflandt
Guest
Posts: n/a

 
      11-22-2004, 01:43 PM
On Sun, 21 Nov 2004 08:19:57 GMT, Ron Abramson <(E-Mail Removed)> wrote:
> I have one Windows machine on my LAN, the rest is Linux. It all sits
> behind a Linksys NAT box (attached to a cable connection).
>
> I use DynDNS, and host a personal web site at www.mygreatsite.org (this
> name is fictional). This is free DNS, with one IP address (the one that my
> cable modem obtains via DHCP), and one name, with "Wildcard" recognition
> enabled (DynDNS will pass any machine prefix on my base domain name to the
> same IP address as the base domain).
>
> I also have IIS running on the Windows box. It has some services that are
> not readily available on Linux, so it comes in handy from time to time.
> Right now, the IIS server is configured on port 8080. On the NAT
> firewall, port 80 is opened up to my main Apache installation on my Linux
> server, and port 8080 is opened up to IIS on the Windows box.
>
> Right now, from the outside world, a request to www.mygreatsite.org gets
> directed to the Apache/Linux server, and a request to
> www.mygreatsite.org:8080 gets directed to the Windows setup.
>
> Port 8080 is a bit of a pain because some firewalls (like
> the one where I work) block it. In fact, my office network blocks
> just about everything except port 80 and a VERY SMALL set of other
> ports. What I'd like to be able to do is create a virtual host called
> windows.mygreatsite.org, which would be accessible via port 80, but on the
> back end would really be serviced by IIS (with the actual port used by IIS
> transparent to the user).
>
> I've tried doing this using VirtualHost directives - setting up both the
> default Linux VirtualHost and a second VirtualHost pointing to the
> Windows machine, but it doesn't work. I get "Connection Refused" (and I
> did make sure everything was open on the Windows side, such as IIS
> configuration and Windows XP's own firewall).


I have not tried doing ProxyPass, but do have multiple vhosts on my home
PC. Try to get multiple virtual hosts working first (using a different
local directory with different content, instead of ProxyPass). Once you
get that working, you can try proxying other server by its private IP
(check its logs too).

Note that the IP your public names point to is not on your apache server,
so you need to use wildcard "NameVirtualHost *" and "VirtualHost *"
sections (names specified with ServerName or ServerAlias). It also helps
to have a general "UseCanonicalName off" so automatic redirects will go to
specified vhost. More info with conf file examples is at
http://efflandt.freeshell.org/siteinfo/
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Virtual Machine unable to Ping 2nd Nic on Host dicklexick@gmail.com Windows Networking 1 08-23-2008 02:19 AM
name based virtual host query.cdac@gmail.com Linux Networking 2 04-18-2007 12:04 PM
CSS displayed as text for virtual host pragmatist Linux Networking 1 07-28-2004 05:55 PM
Virtual (but MASQueraded) Linux host? Robert Berry Linux Networking 0 10-16-2003 09:26 PM
Virtual (but MASQueraded) Linux host? Robert Berry Linux Networking 0 10-16-2003 09:26 PM



1 2 3 4 5 6 7 8 9 10 11