Forum Moderators: phranque

Message Too Old, No Replies

Routing of websites to Webservers

         

LionKing

9:13 pm on Jan 23, 2004 (gmt 0)

10+ Year Member



Hello all,

Background info:
Running IIS (192.168.1.10) and Apache (192.168.1.20) on same win2k server machine. 2 IPs same port 80. Also running on the same machine is a kerio winroute firewall.

I run sites, subdomain xyz.mydomain.com on IIS and subdomain uvw.mydomain.com on Apache.

From within the network, since it goes through the firewall, it looks at the hosts file and redirects the sites to the corresponding IP and everything is perfect.

However from outside, the DNS server on the internet sends the site to my static internet IP. Once it gets in, my router sends it to the webserver at 192.168.1.10. (The router can only send to one IP)

Here comes the question:
How can I get it to send then the subdomain uvw to the 192.168.1.10 IP address?
I tried fooling around in the DNS, creating hosts and sending them to the right IPs. But I don't know if the query gets to the Windows DNS server. How can I find that out? When I do a nslookup on the server it sends back the correct IPs, I just don't think it gets the request to begin.

Thanks a bunch.
At least for reading, if not for answering...LOL

txbakers

9:15 pm on Jan 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to the Wbmaster World forums! Thanks for posting, and keep coming back.

In IIS all web requests are routed through port 80. You can't have two web servers running on the same port (I think).

Internally you can tell the website to route to different ports, but in order to run both apache and IIS I think you will have to include the port in the IP address from outside the firewall, and route it to the appropriate internal address.

[edited by: txbakers at 9:33 pm (utc) on Jan. 23, 2004]

bakedjake

9:18 pm on Jan 23, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Hiya lionking, welcome to WebmasterWorld!

How can I get it to send then the subdomain uvw to the 192.168.1.10 IP address?

Do a wildcard. Have your domain server on the outside send *.mydomain.com to the external address on the router, and then have the router forward all traffic to .10 on the inside.

Set up IIS to use host headers, and let host headers figure it all out. Non HTTP/1.1 clients will get the default website, so make sure your default website is the main one.

LionKing

9:25 pm on Jan 23, 2004 (gmt 0)

10+ Year Member



Thanks for the quick replies.

The servers are working fine. And actually everything gets to IIS fine, I just need to get a couple subdomains past IIS to continue its trip to the Apache instead of getting the "no website at this Address" message from IIS. Of course there is no site since it is on the Apache server. hehe

From inside the network it works fine, I type whatever subdomain, it gets correctly rerouted to the IIS or Apache for that subdomain. It just doesn't work from theinternet side, and I'm at a loss in finding if the Windows DNS server can solve the problem?

bakedjake

9:28 pm on Jan 23, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Oh, I see! The subdomains are on different servers.

Hmm... There's no easy way of doing what you're trying to do with two different machines.

There are tricky ways of doing something cool with an Apache box and some complex mod-rewrite stuff, but honestly, I think you're better off upgrading the firewall and getting a few more IP addresses.

LionKing

9:31 pm on Jan 23, 2004 (gmt 0)

10+ Year Member



2 subdomains, 2 webservers, 1 machine. It is a wicked setup. lol

I will keep googlin' for it. It's computers, everything is possible, ain't it? hehehe

bakedjake

9:34 pm on Jan 23, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Alright, I'll bite.

What you're doing is possible if you only had one webserver (IIS or Apache) running, with one IP address. You could run as many subdomains as you wanted, in that case.

So why can't you consolidate?

LionKing

9:38 pm on Jan 23, 2004 (gmt 0)

10+ Year Member



Actually I don't know if I took the hard road for this. But the end result is I need to run ASP apps and PHP with mySQL APPS.

I just started on the trip with installing Appache alongside IIS. I want to learn the Apache side to latter move to Linux.

But the basic premise was running ASP on IIS and PHP on Apache.

bakedjake

9:41 pm on Jan 23, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Why not run PHP on IIS? If you do that, what you want to do with you IP address problem is very easy. :)

LionKing

9:42 pm on Jan 23, 2004 (gmt 0)

10+ Year Member



I may try that again, however I did before and never got it working. *sigh* lol

txbakers

9:45 pm on Jan 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



why do both? pick one or the other and make your life easier.

Both are good technologies, both have advantages and disadvantages.

The world is big enough to support both very nicely.

I chose ASP because I have worked with windows servers for a long time and would rather program than adminisister a *NIX server.

LionKing

9:49 pm on Jan 23, 2004 (gmt 0)

10+ Year Member



I know, I'd love to do that, I also started in ASP but found that PHP has so much more stuff already made for it and free. Why reinvent the whell. However my main site is ASP and Access DB. I can't switch to PHP and MySql for it, yet.

But the new sites will most likely be PHP and MySQL based.

Hence the dilemna. Plus learning new things is cool too.

LionKing

9:54 pm on Jan 23, 2004 (gmt 0)

10+ Year Member



LMAO...Just ran the php installer for windows, created the new site in IIS,

and boom, it opens up.

Thanks for the info. I may go the IIS/PHP/MySQL route for a while yet. lol

txbakers

9:55 pm on Jan 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can use mySQL with ASP with no problem.

I do and process thousands of transactions a day that way.

You don't need PHP to use mySQL.

LionKing

9:57 pm on Jan 23, 2004 (gmt 0)

10+ Year Member



I know, simply the Forum I use was not built with MySQL in mind. They haven't got the scripts optimized for it. Therefore have to wait for that.