Apache and IIS on same box

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
microthick
Forum Regular
Posts: 543
Joined: Wed Sep 24, 2003 2:15 pm
Location: Vancouver, BC

Apache and IIS on same box

Post 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.
User avatar
Stoker
Forum Regular
Posts: 782
Joined: Thu Jan 23, 2003 9:45 pm
Location: SWNY
Contact:

Post 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...
microthick
Forum Regular
Posts: 543
Joined: Wed Sep 24, 2003 2:15 pm
Location: Vancouver, BC

Post 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.
User avatar
Pyrite
Forum Regular
Posts: 769
Joined: Tue Sep 23, 2003 11:07 pm
Location: The Republic of Texas
Contact:

Post 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.
Post Reply