troubleshooting Question

Forwarding Request to Different Ports Based on Domain

Avatar of no158
no158 asked on
Apache Web ServerNetworking
4 Comments1 Solution1151 ViewsLast Modified:
Hello All,
I once again need your expertise on the following, can you please help?

I've set up a server and I'd like to host two web applications (living on two different tomcats) from different ports; however I could not figure out how to forward the requests to a specific port based on the domain name.

In a nutshell I want www.firstdomain.com to go to 8080 and www.seconddomain.com to go to port 8081 seemlessly with sessions etc... (I do not want people to see the trailing port numbers by the way)

This is what I have so far:
I'm running on Ubuntu Server Edition (linux of course) with Apache 2 and two tomcats.
I've managed to have my tomcats listen to different ports already (tomcat1 is listening to 192.168.1.9:8080 and tomcat2 is listening to 192.168.1.9.8081).

I'm a newbie on this, and I'm not sure if I can do this with iptables or do I have to get dirty with VirtualHosts mod_proxy etc (which scares me).

Thank you in advance.
Best,
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros