Solved

Redirect to secondary private network server

Posted on 2009-05-12
4
564 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 Worsham
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 Worsham
ID: 31580805
Yep. Worked like a charm. Thanks!
0
 
LVL 30

Expert Comment

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

Featured Post

Business Impact of IT Communications

What are the business impacts of how well businesses communicate during an IT incident? Targeting, speed, and transparency all matter. Find out more in this infographic.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.

734 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