Home Geschichten Kunst Computer Tindertraum

[current]

Zope behind Apache, the proxy way
(Friday 9th April 2004)

Ok, this will not really be a HOWTO, but rather a recollection of a common pitfall.

First, what we did:
We have here a Zope site, and an Apache server on the same machine/IP. The Zope zserver runs on port 8080 and Apache on 80. Now we wanted to serve the Zope pages to be accesible via a 'portess' URL, say schockwellenreiter.de

To date this was done via PCGI and some bad voodoo mod_rewrite rules...
But there's a far 'simpler' way to do it, using mod_proxy:
This is what I initially tried, which worked like a charm (or so I thought):
<VirtualHost 217.160.92.11>
ServerName schockwellenreiter.de
ProxyRequests off
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
</VirtualHost>

Ok, Apache-iados might already have spotted my error, but let me explain what this does first:
This vhost entry takes any request for schockwellenreiter.de and internally sends that exact request to the actual Zope server running on localhost, port 8080. returning the response from there back to the client.
Up to here everything is neato and works as expected.

Now Zope being a dynamic-content server and all, it does some magic (I'm not using the v-word here) with any inline content like images and styles and stuff. Basically it re-writes all img-tags etc. to absolute URLs with hostname etc. ...
But now, what does Zope think it's hostname really is? 100 Points to the man with the cap.
localhost:8080, exactly what the http requests headers tells it (the actual request coming from the Apache http)
Unghh, stupid question 'why is that a problem'... because you are not seeing our Zope pages from your localhost, but over the internet, that's why. (if you see them via localhost and you are not one of three people I know of, I want to hear about it!)
The browser will try to get the images from the selfsame machine it's running on, that's what local means...

The solution?
for now I can change http://localhost:8080 into http://server-wg.de:8080, which will result in images you can see over the net... But that's actually not 100% cool either, as some people will not be able to see things on ports other than 80.... Oh well that's for the Zope guy to fix I guess ;)

[ by Martin>] [permalink] [similar entries]

similar entries (vs):

similar entries (cg):

no similar entries (yet?)

Martin Spernau
© 1994-2003

traumwind icon Big things to come (TM) 30th Dez 2002

Is there something missing?
Oblique Strategies, Ed.3 Brian Eno and Peter Schmidt



amazon.de Wunschliste





 

usefull links:
Google Graph browser
Traumwind 6-Colormatch
UAV News

powered by SBELT