httpd.conf Zope on Apache-based ISP
Hi all, I'm putting a Zope site on an Apache based hosting service. They've asked me to suggest the virtual hosts section of httpd.conf and for me to run Zope on 8081 to avoid conflicts. The files are in a folder called /websites/patrkirk/public_html/ with a cgi folder called /websites/patrkirk/public_html/cgi_bin/ It seems that there are very many ways of doing this and I'm at a loss how to choose the right way. Can anyone suggest an authoritative URL that simply allows zope to run on some high number port with Apache serving up its pages? I have no access to Apache so extensive re-writes of httpd.conf are unlikely to be accepted by the ISP. This is my first draft. # Zope redirection <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^/Zope/(.*) /var/lib/zope/cgi-bin/default/$1 [t=application/x-httpd-cgi,l] </IfModule> <VirtualHost 195.224.53.44> ServerName www.enterprise-hr.com DocumentRoot /websites/patrkirk/public_html/zope RewriteEngine on RewriteRule ^/(.*) /var/lib/zope/cgi-bin/default/$1 [t=application/x-httpd-cgi,l] </VirtualHost> Does this look right and if not can someone please tell me what I need to do? Thanks in advance. -- Best regards, Patrick Kirk Mobile: 07876 560 646
I have a site (studyshare.net) which is served from Zope's /sites/studyshare_net/ folder. Zope is running on localhost port 8085. There is a Virtual Host Monster in the Zope Root and I use this rewrite rule: RewriteRule ^/(.*) http://127.0.0.1:8085/VirtualHostBase/http/studyshare.net:80/sites/studyshar... [L,P] The big difference here is that I am using apache as a proxy in front of Zope. It looks like you're trying to use PCGI. Since this RewriteRule grabs all requests, it needs to be last. Troy
Hi all,
I'm putting a Zope site on an Apache based hosting service. They've asked me to suggest the virtual hosts section of httpd.conf and for me to run Zope on 8081 to avoid conflicts. The files are in a folder called /websites/patrkirk/public_html/ with a cgi folder called /websites/patrkirk/public_html/cgi_bin/
It seems that there are very many ways of doing this and I'm at a loss how to choose the right way.
Can anyone suggest an authoritative URL that simply allows zope to run on some high number port with Apache serving up its pages? I have no access to Apache so extensive re-writes of httpd.conf are unlikely to be accepted by the ISP.
This is my first draft.
# Zope redirection <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^/Zope/(.*) /var/lib/zope/cgi-bin/default/$1 [t=application/x-httpd-cgi,l] </IfModule>
<VirtualHost 195.224.53.44> ServerName www.enterprise-hr.com DocumentRoot /websites/patrkirk/public_html/zope RewriteEngine on RewriteRule ^/(.*) /var/lib/zope/cgi-bin/default/$1 [t=application/x-httpd-cgi,l] </VirtualHost>
Does this look right and if not can someone please tell me what I need to do?
Thanks in advance.
Hi Troy, That looks so easy it'd be perfect! Let me do the exact drafting and post it to you and the list for a sanity check before sending to the ISP. The path to the html folder is /websites/enterpri/public_html Zope will be untarred to a folder called /websites/enterpri/public_html/zope and configured to run on port 8081 All the hosting provider needs do is add this enter to httpd.conf <VirtualHost 195.224.53.44> ServerName www.enterprise-hr.com DocumentRoot /websites/enterpri/public_html/zope RewriteEngine on RewriteRule ^/(.*) http://64.5.48.153:8081/VirtualHostBase/http/enterprise-hr.com:80/websites/e... [L,P] </VirtualHost> Once the virtual host monster is configured and zope is listening and 8081, there is no more the hosting partner needs do. Does this look right? Troy Farrell wrote:
I have a site (studyshare.net) which is served from Zope's /sites/studyshare_net/ folder. Zope is running on localhost port 8085. There is a Virtual Host Monster in the Zope Root and I use this rewrite rule:
RewriteRule ^/(.*) http://127.0.0.1:8085/VirtualHostBase/http/studyshare.net:80/sites/studyshar... [L,P]
The big difference here is that I am using apache as a proxy in front of Zope. It looks like you're trying to use PCGI. Since this RewriteRule grabs all requests, it needs to be last.
Troy
Hi all,
I'm putting a Zope site on an Apache based hosting service. They've asked me to suggest the virtual hosts section of httpd.conf and for me to run Zope on 8081 to avoid conflicts. The files are in a folder called /websites/patrkirk/public_html/ with a cgi folder called /websites/patrkirk/public_html/cgi_bin/
It seems that there are very many ways of doing this and I'm at a loss how to choose the right way.
Can anyone suggest an authoritative URL that simply allows zope to run on some high number port with Apache serving up its pages? I have no access to Apache so extensive re-writes of httpd.conf are unlikely to be accepted by the ISP.
This is my first draft.
# Zope redirection <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^/Zope/(.*) /var/lib/zope/cgi-bin/default/$1 [t=application/x-httpd-cgi,l] </IfModule>
<VirtualHost 195.224.53.44> ServerName www.enterprise-hr.com DocumentRoot /websites/patrkirk/public_html/zope RewriteEngine on RewriteRule ^/(.*) /var/lib/zope/cgi-bin/default/$1 [t=application/x-httpd-cgi,l] </VirtualHost>
Does this look right and if not can someone please tell me what I need to do?
Thanks in advance.
Patrick Kirk wrote:
Zope will be untarred to a folder called /websites/enterpri/public_html/zope and configured to run on port 8081
Won't this mean your Zope installation's code will be publicly abailable on the web?! cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
Chris, I'm glad you noticed that. In my example, my zope installation directory (/home/troy/zopehome/studyshare/) is not publically served. Patrick, I want to be sure you understand with which path you need to be concerned. /websites/enterpri/public_html is irrelevant as far as Zope is concerened. I would install zope to /websites/enterpri/zope/. My rewrite rule: RewriteRule ^/(.*) http://127.0.0.1:8085/VirtualHostBase/http/studyshare.net:80/sites/studyshar... [L,P] It looks like this because what you see at http://studyshare.net:80/ is exactly the same was what you would see if you visited http://127.0.0.1:8085/sites/studyshare_net/ on the server. If you want to serve your website from the root folder of Zope, your rule should change from: RewriteRule ^/(.*) http://64.5.48.153:8081/VirtualHostBase/http/enterprise-hr.com:80/websites/e... [L,P] to RewriteRule ^/(.*) http://64.5.48.153:8081/VirtualHostBase/http/enterprise-hr.com:80/VirtualHos... When you use Apache to proxy for Zope, Apache doesn't care in what directory Zope lives. It only cares about the IP and port. Don't forget to add a VirtualHostMonster to your Zope root folder. Troy Chris Withers wrote:
Patrick Kirk wrote:
Zope will be untarred to a folder called /websites/enterpri/public_html/zope and configured to run on port 8081
Won't this mean your Zope installation's code will be publicly abailable on the web?
Hi guys, Thanks for the feedback. The hosting company has kindly installed Zope in /opt so I just have to choose where to put my Zope instance. Based on your advice, I'll put it in /websites/enterpri I'm sorry if I seem to be asking basic questions - I had assimed that a hosting company with python expertise would also have Zope expertise and expected all this would be done for me. I guess its a useful learning experience. cd /websites/enterpri /opt/zope/bin/mkzopeinstance.py Edit /etc/zope.conf to set port to 8081 then simply ./zope/bin/zopectl start Within zope, I create a folder called www where I have my public site. The basic site is essentially ready on my Win2k box at home. I add a VHM to the root folder. For the hosting company they then need to add this line to httpd.conf RewriteRule ^/(.*) http://64.5.48.153:8081/VirtualHostBase/http/enterprise-hr.com:80/VirtualHos... Are we sure of this? My reading of the text of the VHM says I should have the folder name of the site's files. There will be 2 other subdomains of enterprise-hr.com in 2 other folders so I don't understand how zope can guess which folder to use. Perhaps I ought have made that clear in my first email. My guess was that if the suddomains were called staff.enterprise-hr.com and projects.enterprise-hr.com in folders called staff and projects the rules would be as follows. RewriteRule ^/(.*) http://64.5.48.153:8081/VirtualHostBase/http/www.enterprise-hr.com:80/www/Vi... RewriteRule ^/(.*) http://64.5.48.153:8081/VirtualHostBase/http/staff.enterprise-hr.com:80/staf... RewriteRule ^/(.*) http://64.5.48.153:8081/VirtualHostBase/http/projects.enterprise-hr.com:80/p... Thanks for taking the time to read this lot! Look forward to your comments. Best regards, Patrick Kirk Mobile: 07876 560 646 Troy Farrell wrote:
Chris, I'm glad you noticed that. In my example, my zope installation directory (/home/troy/zopehome/studyshare/) is not publically served.
Patrick, I want to be sure you understand with which path you need to be concerned. /websites/enterpri/public_html is irrelevant as far as Zope is concerened. I would install zope to /websites/enterpri/zope/. My rewrite rule:
RewriteRule ^/(.*) http://127.0.0.1:8085/VirtualHostBase/http/studyshare.net:80/sites/studyshar...
[L,P]
It looks like this because what you see at http://studyshare.net:80/ is exactly the same was what you would see if you visited http://127.0.0.1:8085/sites/studyshare_net/ on the server. If you want to serve your website from the root folder of Zope, your rule should change from:
RewriteRule ^/(.*) http://64.5.48.153:8081/VirtualHostBase/http/enterprise-hr.com:80/websites/e...
[L,P]
to
RewriteRule ^/(.*) http://64.5.48.153:8081/VirtualHostBase/http/enterprise-hr.com:80/VirtualHos...
When you use Apache to proxy for Zope, Apache doesn't care in what directory Zope lives. It only cares about the IP and port. Don't forget to add a VirtualHostMonster to your Zope root folder.
Troy
Chris Withers wrote:
Patrick Kirk wrote:
Zope will be untarred to a folder called /websites/enterpri/public_html/zope and configured to run on port 8081
Won't this mean your Zope installation's code will be publicly abailable on the web?
Patrick Kirk wrote:
I'm sorry if I seem to be asking basic questions - I had assimed that a hosting company with python expertise would also have Zope expertise and expected all this would be done for me. I guess its a useful learning experience.
AS someone said in a pub last night, Zope is to Python what J2EE is to Java, veryroughly speaking. So, unless the hosting company advertised being Zope-fluent, I think expecting them to know Zope based on Python expertise could be seen as a little harsh ;-)
For the hosting company they then need to add this line to httpd.conf
RewriteRule ^/(.*) http://64.5.48.153:8081/VirtualHostBase/http/enterprise-hr.com:80/VirtualHos...
Hmmm... maybe this instead: http://64.5.48.153:8081/VirtualHostBase/http/enterprise-hr.com:80/www/Virtua...
Are we sure of this? My reading of the text of the VHM says I should have the folder name of the site's files.
Yep, trust the text or docs :-)
RewriteRule ^/(.*) http://64.5.48.153:8081/VirtualHostBase/http/www.enterprise-hr.com:80/www/Vi...
RewriteRule ^/(.*) http://64.5.48.153:8081/VirtualHostBase/http/staff.enterprise-hr.com:80/staf...
RewriteRule ^/(.*) http://64.5.48.153:8081/VirtualHostBase/http/projects.enterprise-hr.com:80/p...
Looks good to me :-) cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
participants (3)
-
Chris Withers -
Patrick Kirk -
Troy Farrell