Solved

Redirect to secondary private network server

Posted on 2009-05-12
4
559 Views
Last Modified: 2012-05-06
Okay, here's the situation. I have a publicly accessible static IP address that currently has port 80 forwarded from the firewall/router to an internal private web server (i.e. 192.168.0.3) that is handling several websites via Virtual Hosts. This works like a charm without any issues.

I am in the progress on building a 2nd internal web server (i.e. 192.168.0.12) that will house only one 'testing' web instance. Since port 80 is already forwarded on the firewall to the primary web server, I would like to keep the virtual host on the primary web server, but redirect (proxy) all inbound http connectivity for this other domain name to the 2nd internal web server after seeing the entry on the primary web server.

Internet --> Firewall/Port Forward (Forward Port 80) --> Primary Web Server (Listen Port 80) --> mod_proxy --> 2nd Internal Web Server (Listen Port 80)

What do I need to do on the primary web server's Virtual Host entry to redirect all traffic to the 2nd web server while maintaining the domain name in the URL (i.e. not showing the user the site is being redirected)?

I thought of something like this, but I don't know if that would really work or not...

<VirtualHost *:80>

  ServerName myothersite.com

  ServerAlias www.myothersite.com

  ProxyRequests Off

  ProxyPreserveHost On

  ProxyPass / http://192.168.0.12/

  ProxyPassReverse / http://192.168.0.12/

</VirtualHost>

Open in new window

0
Comment
Question by:Michael W
  • 3
4 Comments
 
LVL 30

Accepted Solution

by:
Kerem ERSOY earned 500 total points
ID: 24370845
Hi,

Just try this:
<VirtualHost *:80>

  ServerName myothersite.com

  ServerAlias www.myothersite.com

  ProxyRequests Off

  ProxyPreserveHost On

  ProxyPass / http://192.168.0.12/

  ProxyPassReverse / http://192.168.0.12/

  DocumentRoot /usr/local/apache2/htdocs 

  Errorlog logs/www.myothersite.com.log

  CustomLog logs/www.myothersite.com.access_log combined	

</VirtualHost>

Open in new window

0
 
LVL 30

Expert Comment

by:Kerem ERSOY
ID: 24371047
I'm using a similar setup and it works like charm : ) I'm sure it will work for you too.
0
 
LVL 29

Author Closing Comment

by:Michael W
ID: 31580805
Yep. Worked like a charm. Thanks!
0
 
LVL 30

Expert Comment

by:Kerem ERSOY
ID: 24372293
Yr welcome :)
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
Network ports are the threads that hold network communication together. They are an essential part of networking that can be easily ignore or misunderstood, my goals is to show those who don't have a strong network foundation how network ports opera…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now