LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-28-2012, 07:41 AM   #1
Jim44
Member
 
Registered: Feb 2006
Location: Atlanta, Georgia, USA
Distribution: Mint, Ubuntu, Centos
Posts: 57

Rep: Reputation: 15
Using Apache Directives to expose a system behind a firewall.


I have a lan connected to the internet through a router. The router exposes port 80 to one system, 192.168.1.50. I have a set of web pages on 192.168.1.90 that I want to also expose to the internet. For instance http://example.com would go to the .50 system, while http://example.com/mark and http://example.com/mark/crud would draw data from the .90 system. My attempts at generating rewrite rules almost work, except the http://example.com/mark/crud becomes http://192.168.1.90/mark/crud, which from the internet is not resolvable.

Can someone point me to the documentation that specifically mentions how to rewrite or proxy such that I can have a tree successfully exposed?

Thanks,
Jim
 
Old 06-28-2012, 07:51 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
you would initially only need a proxypass directive:

ProxyPass /mark http://192.168.1.90/

but depending on what else is going on on the remote server, it might require more. mod_rewrite can also do this but I prefer mod_proxy. As I can remember it.
 
Old 06-28-2012, 09:19 AM   #3
Jim44
Member
 
Registered: Feb 2006
Location: Atlanta, Georgia, USA
Distribution: Mint, Ubuntu, Centos
Posts: 57

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by acid_kewpie View Post
you would initially only need a proxypass directive:

ProxyPass /mark http://192.168.1.90/

but depending on what else is going on on the remote server, it might require more. mod_rewrite can also do this but I prefer mod_proxy. As I can remember it.
Thanks,

If I read that right, I might want it to read

ProxyPass /mark http://192.168.1.90/mark

Right?

As long as the .90 web pages use relative urls it should work, I'm guessing.

Jim.
 
Old 06-28-2012, 09:51 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
if you've using an exact uri stem that also exists on the remote server, even better yes. Just as you have it there. if you might get 302's back from the end point, you can use the same config for ProxyPassReverse which will rewrite HTTPS 302s etc.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache httpd.conf directives deeneyc09 Linux - Server 1 09-07-2011 07:10 PM
Which directives are processed in which order in apache? exceed1 Linux - Server 1 05-28-2010 12:58 PM
Apache 2 Global public_html directives 0.o Linux - Server 1 10-01-2008 11:18 AM
Apache 1.3 configuration directives calissal Linux - Software 0 09-08-2003 01:47 PM
Apache 1.3 Configuration Directives Found calissal Linux - General 4 09-08-2003 08:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration