LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-16-2012, 07:39 AM   #16
secondhandman
Member
 
Registered: May 2012
Posts: 60

Original Poster
Rep: Reputation: Disabled

<VirtualHost *:80>

ProxyRequests Off

ProxyPass /site1 http://192.168.0.2
ProxyPassReverse /site1 http://192.168.0.2

ProxyPass /site2 http://192.168.0.3
ProxyPassReverse /site2 http://192.168.0.3

ServerAdmin webmaster@localhost

and so on
 
Old 05-16-2012, 07:50 AM   #17
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
yep, that should do it
 
1 members found this post helpful.
Old 05-16-2012, 07:57 AM   #18
secondhandman
Member
 
Registered: May 2012
Posts: 60

Original Poster
Rep: Reputation: Disabled
It's hard to tell when the network is down. Thanks for the reply's! Much appreciated. I may have this one sorted out now!
 
Old 05-16-2012, 08:13 AM   #19
secondhandman
Member
 
Registered: May 2012
Posts: 60

Original Poster
Rep: Reputation: Disabled
One last question regarding the reverse proxy. Is an external computer passing requests though the front end server, as in their requests are simply proxied through the server on the way to the back end or is the request served up by the front end server it's self when a request is made?

Thanks!
 
Old 05-16-2012, 09:18 AM   #20
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
the request is fully proxied. the intermediate system is passing on the request to the back end and the response passed back, applying transformations to the response as if it were served locally. The request can be tweaked and changed in some cases, ProxyPreserveHost is often used to not change the Host header for example.
 
1 members found this post helpful.
Old 05-16-2012, 11:13 PM   #21
secondhandman
Member
 
Registered: May 2012
Posts: 60

Original Poster
Rep: Reputation: Disabled
It's still not working..

Right now I'm getting the following error:

Proxy Error

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /win.

Reason: DNS lookup failure for:
 
Old 05-16-2012, 11:31 PM   #22
secondhandman
Member
 
Registered: May 2012
Posts: 60

Original Poster
Rep: Reputation: Disabled
The above issue is resolved and thanks again for taking the time to give me a hand with the problems I'm having... but we're not done yet!!

Now the pages don't fully load and all links are broken! Not sure what to make of this error. I'm using a WAMP server as a test page for the reverse proxy if that helps.
 
Old 05-17-2012, 03:54 AM   #23
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
well the html content is not going to change by deafult, and changing it at all is pretty horrendous. Generally you want to move the web content on the end server, or make it otherwise available under the same uri you are proxying if it is using absolute uris (e.g. /images/photo.png compared to images/photo.png).

Take a look at the source code and see what links are broken and then you can look to investigate solutions

I had this issue last night actually. I was proxying sabnzbd on apache and was able to change the web root of sabnzbd, so that on it's own web service it runs under localhost:8080/sabnzbd as opposed to just localhost:8080. I then configure a proxypass /sabnzbd http://localhost:8080/sabnzbd. before I found I could do this, I was faced with redirecting a handful of individual uris, e.g. /static, /images and so on, as there was no other way to contain these uris in anything more concise.

It is *possible* to change the links in the HTML code coming back (mod_proxy_html I believe), but it's usually the beginning of a descent into madness.
 
1 members found this post helpful.
Old 05-17-2012, 07:44 AM   #24
secondhandman
Member
 
Registered: May 2012
Posts: 60

Original Poster
Rep: Reputation: Disabled
I can get to the web pages easily by typing in the private ip address of the server that hosts them. Things only go wrong when I use the reverse proxy to get to them. Before I had the /site1 and /site2 names, the front end server was only hosting one webpage and it worked perfectly. Not sure what might be causing the issue. I'm hoping I won't have to do anything involving source code!!

I've gone mad before, I'd like to avoid it this time if at all possible
 
Old 05-17-2012, 09:42 AM   #25
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
well maybe you won't, just look at the source to find out.
 
1 members found this post helpful.
Old 05-17-2012, 12:01 PM   #26
secondhandman
Member
 
Registered: May 2012
Posts: 60

Original Poster
Rep: Reputation: Disabled
Sorry, but where do I find the source code? I already have apache installed, so it should already be on the system. I know the file should end with src.. I searched, I really did Google and the directories on the server.

Sorry to be a pain.
 
Old 05-17-2012, 12:31 PM   #27
secondhandman
Member
 
Registered: May 2012
Posts: 60

Original Poster
Rep: Reputation: Disabled
http://apache.webthing.com/mod_proxy_html/

It seems mod_proxy_html is the way to go!.. now to find it..
 
Old 05-17-2012, 12:53 PM   #28
secondhandman
Member
 
Registered: May 2012
Posts: 60

Original Poster
Rep: Reputation: Disabled
In order to get mod_proxy_html to work, would I just add the appropriate directives to the /etc/apache2/sites-enabled/000-default file?

ProxyHTMLURLMap, etc.

??
 
Old 05-17-2012, 01:30 PM   #29
secondhandman
Member
 
Registered: May 2012
Posts: 60

Original Poster
Rep: Reputation: Disabled
http://httpd.apache.org/docs/2.4/mod...roxy_html.html

Good place to go if you're having trouble with mod_proxy_html
 
Old 05-17-2012, 06:16 PM   #30
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
no, try to avoid mod_proxy_html, it's a slippery slope like I said.

I mean the source of the web page! right click, view source! Not rocket surgery. Also a tool like firebug, chrome developer tools etc are useful to see what GETs are being requested and seeing what mappings you need if you can't work it out from a few lines of html.

Last edited by acid_kewpie; 05-17-2012 at 06:17 PM.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] iptables 192.168.1.x server, can't ping by 192.168.0.x momok Linux - Security 2 06-02-2011 02:32 AM
[root@wlxxb ~]# telnet 192.168.192.12 25 Trying 192.168.192.12... telnet problem cnhawk386 Linux - Networking 1 10-10-2007 03:50 PM
pinging 192.168.0.10 from 192.168.2.101 cov Linux - Networking 12 05-03-2007 11:21 AM
What route to access daisy chained 2d router 192.168.1.1 after 192.168.0.1 (subnets?) Emmanuel_uk Linux - Networking 6 05-05-2006 02:47 AM
Is someone on my network?! ::ffff:192.168.0.10:ssh ::ffff:192.168.0.:38201 ESTABLISHE ming0 Linux - Security 4 04-12-2005 02:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:32 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration