Using port 80 for 2 web servers.. How do i forward to each?


I currently have the following setup:

IIS running on port 80
Apache running on port 8080

I have 2 sub domains which are used for me two web servers.. -> IIS -> Apache

I know how to put Apache on port 80.. I just need to give it a new IP address.. Say

Problem is, how do i get to reach that IP??


Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Henrik JohanssonSystems engineerCommented:
Start DNS-manager (dnsmgmt.msc), expand 'Forward lookup zones'->
Double-click on dev and change it to the correct IP-address.
Each IP address needs to be registered with the correct name in DNS - are you using Microsoft DNS or some third party?
fugazerAuthor Commented:
yes i'm using DNS..

Before i make the change, i'm wondering if incoming traffic from will route to the proper server??

So... will stay the same ->IIS Sharepoint
and will now forward to -> Apache

Essentially the same appearance as i currently have expect now eliminating port 8080.

ON-DEMAND: 10 Easy Ways to Lose a Password

Learn about the methods that hackers use to lift real, working credentials from even the most security-savvy employees in this on-demand webinar. We cover the importance of multi-factor authentication and how these solutions can better protect your business!

Henrik JohanssonSystems engineerCommented: and is two different DNS-records.
Updating dev will not affect home if not home is a CNAME pointing to dev.
If they're both A-records (host), just update dev to point on the correct IP.
If any of them is CNAME-record (alias) to the other's A-record, you nead to delete the CNAME-record and re-create it as A-record.
fugazerAuthor Commented:
well.. i made the switch

And what i was worried about happened..

i switched over to (A Record)

Internally on our network everything is fine..

But i had my friend access and it brought him to our IIS server with sharepoint.

Internally it works, externally no go..

I have a router that sits before W2k3 server and Port 80 forwards off to IP

I also added another forward from port 80 to, but obviously that didn't work..

With port 80, and external traffic coming in on port 80, its either Sharepoint ( or Apache (

I'm i dead in the water?

The linksys wrt54g router has been upgraded with -> Firmware Version: v4.71.1, Hyperwrt 2.1b1 + Thibor15c

Is there some advanced setting i can do on the router to direct the traffic to the correct target?

Or is there some special W2k3 setting i can do?

You need two different firewall rules on the external network with two separate publically accessible IPs/domains.

ie you need a public DNS for that is NATd to and one for that is NAT'd to

fugazerAuthor Commented:
I uninstalled our NAT to get our 2 networks talking..


Is the root of all my trouble's the router that sits before my W2k3??

Should the internet be plugged in directly to the windows server?

No, you should never place a computer directly on the internet.

Are you trying to bridge two networks together or are you just trying to get these two websites up on the internet?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
fugazerAuthor Commented:
So it is correct that i have the router before the windows server? I used this as my firewall, and access point for wireless notebooks..

NIC1 and NIC2 are bridged..

My goal is to eliminate the need for port 8080, and just have the 2 websites up and running..

currently it is set up like this:

Henrik JohanssonSystems engineerCommented:
Yes, the server should be protected between the firewall box.

If only having one external public IP, you nead to use different ports in the firewall rule to make the visitors reach the different internal servers.
If not wanting to use different ports on the different addresses, you nead to configure a proxy solution to let all traffic to port 8080 pass through the server running at port 80. This can be done with apache's mod_proxy by letting apache listen on port 80 for both hostnames and configure a rule that checks the hostname and proxy-pass requests for IIS' servername:80 to servername:8080
fugazerAuthor Commented:
will that allow user's outside our network to access the apache webserver without having to write 8080 in the url?? ie.. 
Henrik JohanssonSystems engineerCommented:
Yes, the user will only know about the port 80 address when using a proxy solution and all traffic to port 8080 is done through the proxy server listening on port 80.
fugazerAuthor Commented:
Okay.. i think i understand.

I've never set up a proxy before, and im a little confused on how to achieve the setup you suggested.
fugazerAuthor Commented:
i'm having trouble setting up the proxy configuration as you suggested Wizard.. do you have any more insight for me? Or even better, can you tell me how to do this?
Henrik JohanssonSystems engineerCommented:
Create a virtual server in apache and use a rule like below to proxy incoming traffic to IIS.

Also see apache's manuals for mod_rewrite

ServerPort 80
<VirtualServer internal-IP-address-mapped-in-firewall>
  RewriteEngine on
  RewriteCond %{HTTP_HOST} ^home\.domain\.com
  RewriteRule ^/(.*)$1 [P,L]

Open in new window

quote "I also added another forward from port 80 to, but obviously that didn't work.. "

your runs on port 8080 so you should port froward to 8080 instead; btw, you might want try 8181 since most routers use 8080 for remote access

then setup vh as sample here

Listen 8181
NameVirtualHost *:8181
<VirtualHost *:8181>
DocumentRoot path/to/

Open in new window

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2003

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.