Page 1 of 1

Apache and IIS on same box

Posted: Fri Nov 28, 2003 11:02 am
by microthick
Background Info:

My web server (which is my personal computer) runs WinXP Pro. I run Apache on port 80 and IIS on port 8080.

Apache for PHP and Perl. IIS for ASP.NET.

Apache handles 5 virtual hosts for 5 different domain names.
IIS currently only works with http://localhost:8080, because I haven't purchased any domain names for it yet.

I use PowerDNS (http://www.powerdns.com to download source) as a DNS server.

Problem:

I want visitors to be able to access my IIS web server using domain names without specifying port 8080 in the host name.

Can this be done?

I don't have the option of porting everything over to IIS (PHP, etc.) because I try to maintain the same environment as my clients.

For anyone that has experience with running their own DNS server (bind, etc.) can I specify that all requests for something.com go to something.com:8080?

Or, would I have to set up a virtual host in httpd.conf (for Apache) and forward the user to something.com:8080 so IIS can then handle it? After the initial redirect, I don't mind if :8080 appears in the website address.

Is there anything I can do?

One thing I specifically don't wanna do is HIDE a redirect using frames.

Posted: Fri Nov 28, 2003 11:38 am
by Stoker
since port 80 is default for http only one of your servers will get the request (unless you add another host or daemon which redirects (NAT or similar) internally.. If you want them to all transparantly appear on the same port you will need to use a different IP/Hostname for them and use soemthing like DNAT to redirect internally..

If you only have one IP and they both use the same and you want it transparently you need a 3rd daeomon acting as a transparent proxy redirecting requests based on hostname internally...

Or, the easiest approach, set up the same domain on Apache with a simple header redirect to the right port, this way it is not transparent but very easy and quick thing to do if you only have one IP..

But, then comes the big question, why are you doing this? It seems like a total waste of resources, if you are on a Bill Gates machine it shouldnt be all that hard to make Apache do all the work that IIS does...

Posted: Fri Nov 28, 2003 11:53 am
by microthick
I'll probably do what you suggested and take the simple route of just redirecting to the right port using Apache.

I use IIS because I also write ASP.NET. There are ways of getting ASP.NET pages to work with Apache (ie, http://www.go-mono.com/asp-net.html) but, I also enjoy having environments similar to my clients.

This means I have two dbs (MySQL and MS SQL) and two web servers (Apache and IIS).

Since this is just a development and pre-production box, I don't care about the decrease in speed that all this clutter creates, but it's the only solution til I purchase another development machine.

Posted: Mon Dec 01, 2003 10:35 pm
by Pyrite
You should be able to add a virtual host in apache to host the domain you want, and have it just point to the local machine on another port.