On Wed, Mar 19, 2003 at 04:39:02PM +0800, Sherwin T. Ang wrote:
> I need to run both apache and zope at the same time i tried this setup
> using apache mod_proxy
>
> <VirtualHost 203.167.x.x:80>
> ServerName fire.homelinux.net
> ProxyPass / http://jam.homelinux.net:8080/
> ProxyPassReverse / http://jam.homelinux.net:8080/
> </VirtualHost>
>
> It almost have worked but, when i click on a link like
> http://jam.homelinux.net/Examples the hyperlinks on that page still
> shows http://jam.homelinux.net:8080/Examples/GuestBook i may have done
> something wrong, please help.
First create an instance of the Virtual Host Monster in the root of
Zope, using the ZMI. It can be named anything, and doesn't need to be
tweaked. You also just need one for your entire Zope site, and ideally
in the root folder.
With that done, enable mod_proxy and mod_rewrite in Apache, and use
lines like this in your httpd.conf:
Type 1: to access everything as "http://myurl/zope", I do this to
allow Zope access as part of my SSL-encrypted URL, primarily for ZMI
work. I put this in the VirtualHost section for my SSL-encrypted
VHost.
RewriteEngine On
RewriteLogLevel 0
RewriteRule ^/p_/(.*) http://127.0.0.1:9673/p_/$1 [P]
RewriteRule ^/zope/(.*)
http://127.0.0.1:9673/VirtualHostBase/https/leathercollection.ph:443/VirtualHostRoot/_vh_zope/$1
[P]
RewriteRule ^/zope
http://127.0.0.1:9673/VirtualHostBase/https/leathercollection.ph:443/VirtualHostRoot/_vh_zope/
[P]
<Location /p_>
Allow from All
</Location>
<Location /zope>
Allow from All
</Location>
You will notice that my instance of Zope listens to port 9673. This is
the newer way to do things at least on Debian, because port 8080
conflicts with some possibly running proxies. Change the port in the
RewriteRules if you want to use port 8080. Also you will notice that I
use https instead of http, and have the address set to
leathercollection.ph:443, change both to suit your needs.
Type 2: to link a particular URL with a particular folder. I do this
to, for example, map jijo.free.net.ph to the /jijo folder in Zope. I
put this in the VirtualHost section for jijo.free.net.ph.
RewriteEngine On
RewriteLogLevel 0
RewriteRule ^/(.*)
http://127.0.0.1:9673/VirtualHostBase/http/jijo.free.net.ph:80/jijo/VirtualHostRoot/$1
[P]
When you have this working, you may want to restrict Zope to listen to
only localhost. This forces everything else through Apache. I do this by
passing the following arguments to Zope:
-X -u zope -w 127.0.0.1:9673 -d 192.168.0.1
You can find out about what these mean by looking at the source of (at
least on Debian), /usr/sbin/zope-z2. On Debian you can conveniently set
these by setting the ZOPEOPTS environment variable in /etc/init.d/zope.
Good luck, and have fun. If you want to talk about Zope development,
feel free to join the Python list at lists.free.net.ph. I believe Zope
talk is more than welcome there, until perhaps such time that we have
enough Zope traffic locally to merit a Zope list on lists.free.net.ph.
:)
--> Jijo
--
Federico Sevilla III : http://jijo.free.net.ph : When we speak of free
Network Administrator : The Leather Collection, Inc. : software we refer to
GnuPG Key ID : 0x93B746BE : freedom, not price.
_
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]
Fully Searchable Archives With Friendly Web Interface at http://marc.free.net.ph
To subscribe to the Linux Newbies' List: send "subscribe" in the body to [EMAIL
PROTECTED]