httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Cocker" <paul.coc...@tntpost.co.uk>
Subject RE: [users@httpd] Redirecting to internal server
Date Wed, 28 Nov 2007 11:28:55 GMT
Thanks, you're right, not only was it the wrong block it was the wrong
config file. I forgot that when we upgraded Apache we used the new
config locations but didn't delete the old configs "just in case".

The proxy element is now working alas I have a new and exciting problem,
but it's one outside the scope of this list so thanks for your
assistance. With time I hope I'll be more confident in my own diagnosis
of the problem :)

One question, when acting as a reverse proxy what does Apache use as a
source port, anything above 1023? 


Paul Cocker
IT Systems Administrator
IT Security Officer

01628 81(6647)

TNT Post
1 Globeside Business Park
Fieldhouse Lane
Marlow
Bucks
SL7 1HY

-----Original Message-----
From: Boyle Owen [mailto:Owen.Boyle@swx.com] 
Sent: 28 November 2007 08:22
To: users@httpd.apache.org
Subject: RE: [users@httpd] Redirecting to internal server

> -----Original Message-----
> From: Paul Cocker [mailto:paul.cocker@tntpost.co.uk]
> Sent: Tuesday, November 27, 2007 3:56 PM
> To: users@httpd.apache.org
> Subject: RE: [users@httpd] Redirecting to internal server
> 
> The reverse proxy doesn't appear to be working. My block now looks 
> like the following:
> 
>      ServerAdmin administrator@domain.co.uk
>      ServerName www.domain.co.uk
>      DocumentRoot /var/www/html/domain
>      ProxyRequests off
>      ProxyPass /folder http://virtualfolder/
>      ProxyPassReverse /folder http://virtualfolder/
> 
> I've also got the line:
> 
> LoadModule proxy_module modules/mod_proxy.so
> 
> I've confirmed the file is under the modules directory.
> 
> I restarted Apache using apachectl graceful.
> 
> Requests going to http://www.domain.co.uk/folder get the message:
> 
> Object not found!
> 
> The requested URL was not found on this server. If you entered the URL

> manually please check your spelling and try again.
> 
> If you think this is a server error, please contact the webmaster.
> Error 404
> www.domain.co.uk
> Apache/2.0.59 (Unix)
> 
> 
> While I can understand not getting the reverse proxy right straight 
> off the bat, this looks like it isn't redirecting at all. Where am I 
> going wrong?

Just a note: Proxy doesn't "redirect". Redirect is a very specific term
that means "send a response back to the client causing it to make a
second request for a new URL". Proxying means "fetch the content from a
second server without informing the client". The two processes have the
same overall effect (client requests data from one URL but gets content
from another) but operate via different mechanisms.

> 
> error_log just registers the following:
> 
> [Tue Nov 27 15:41:08 2007] [error] [client 1.1.1.1] File does not 
> exist:
> /var/www/html/domain/folder

You diagnosis is correct - the ProxyPass directive is not being used. 

Is the block you quoted inside a VH? Are you sure that this block is
really serving the pages? To check, change the path of the DocumentRoot
directive and see what happens (I suspect you might have another VH with
a DocumentRoot definition that is overriding this one...)

Rgds,
Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored. 

> [Tue Nov 27 15:41:12 2007] [error] [client 1.1.1.1] File does not 
> exist:
> /var/www/html/domain/folder
> [Tue Nov 27 15:42:02 2007] [error] [client 1.1.1.1] File does not 
> exist:
> /var/www/html/domain/folder
>  
> 
> Paul Cocker
> IT Systems Administrator
> 
>  
> 
> ________________________________
> 
> From: Victor Trac [mailto:victor.trac@gmail.com]
> Sent: 24 November 2007 11:13
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] Redirecting to internal server
> 
> 
> On Nov 23, 2007 6:52 PM, Paul Cocker
> <paul.cocker@tntpost.co.uk> wrote:
> 
> 
> 	Hi all, first time on the apache list so have mercy ;)
> 	
> 	I have been tasked with setting up a system whereby a Linux
server
> 	running apache 2.0.59 in the DMZ takes requests on port 80 and
then
> 	passes them through to an internal Windows server running IIS
which
> 	actually hosts the HTML.
> 	
> 	Such a setup already exists (though it's Linux to Linux) so I
thought
> 	this would be relatively easy to do, just copy the existing
setup.
> 	People currently connect to
> http://www.domain.co.uk/folder/login.html
> 	and all is well. Searching the httpd.conf file I can find only
one
> 	reference to folder, which is:
> 	
> 	<VirtualHost *:80>
> 	    ServerAdmin administrator@domain.co.uk
> 	    ServerName www.domain.co.uk
> 	    DocumentRoot /var/www/html/domain
> 	    RewriteEngine on
> 	    RewriteRule ^/folder(.+)
> https://www.domain.co.uk/folder$1 [R,L]
> 	    RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
> 	    RewriteRule .* - [F]
> 	</VirtualHost>
> 	
> 	So we're using the rewrite module... except having read the 
> 	documentation on this feature I cannot fathom it.
> 	
> 	I hoped that with the above I could simply add another line:
> 	
> 	RewriteRule ^/folder2(.+)    https://www.domain.co.uk/folder2$1
> [R,L]
> 	
> 	I then added a route for the relevant server so the traffic is
routed 
> to
> 	the internal network when its name is called. However, without
really
> 	understanding the above I'm not in much of a position to
progress
> 	further when this invariably fails to work. I don't know whether
the
> 	above in any way relates to the name apache calls which then
causes 
> the
> 	call to be routed to server X.
> 	
> 	Any advice or guidance you can offer would be much appreciated. 
> 	
> 	Paul Cocker
> 	IT Systems Administrator <mailto:users-help@httpd.apache.org>
> 
> 
> Your example is not rewriting to an internal server.  You want to use 
> mod_proxy.  Let's say your windows box is 192.168.1.100, then you want

> something like this inside your VirtualHost directive:
> 
> 
> ProxyRequests off
> ProxyPass /folder2 http://192.168.1.100 ProxyPassReverse /folder2 
> http://192.168.1.100
> 
> 
> With this, anytime someone visits your externally accessible site at 
> http://www.domain.co.uk/folder2, they'll see the html output by your 
> windows server at http://192.168.1.100 and your internal IIS host is 
> never directly accessible from the internet.
> 
> cheers,
> Victor
> 
> 
> --
> http://www.victortrac.com
> 
> 
> 
> 
> TNT Post is the trading name for TNT Post UK Ltd (company
> number: 04417047), TNT Post (Doordrop Media) Ltd (00613278), TNT Post 
> Scotland Ltd (05695897),TNT Post North Ltd
> (05701709) and TNT Post South West Ltd (05983401). Emma's Diary and 
> Lifecycle are trading names for Lifecycle Marketing (Mother and Baby) 
> Ltd (02556692). All companies are registered in England and Wales; 
> registered address: 1 Globeside Business Park, Fieldhouse Lane, 
> Marlow, Buckinghamshire, SL7 1HY.
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server 
> Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
 
 
This message is for the named person's use only. It may contain
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission.
If you receive this message in error, please notify the sender urgently
and then immediately delete the message and any copies of it from your
system. Please also immediately destroy any hardcopies of the message.
You must not, directly or indirectly, use, disclose, distribute, print,
or copy any part of this message if you are not the intended recipient.
The sender's company reserves the right to monitor all e-mail
communications through their networks. Any views expressed in this
message are those of the individual sender, except where the message
states otherwise and the sender is authorised to state them to be the
views of the sender's company.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server
Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org





TNT Post is the trading name for TNT Post UK Ltd (company number: 04417047), TNT Post (Doordrop
Media) Ltd (00613278), TNT Post Scotland Ltd (05695897),TNT Post North Ltd (05701709) and
TNT Post South West Ltd (05983401). Emma's Diary and Lifecycle are trading names for Lifecycle
Marketing (Mother and Baby) Ltd (02556692). All companies are registered in England and Wales;
registered address: 1 Globeside Business Park, Fieldhouse Lane, Marlow, Buckinghamshire, SL7
1HY.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message