Looking at the various bits of documentation for setting up Squid as an httpd accelerator for Zope leaves me a bit confused, especially on how to reconfigure Apache. It looks as though Squid should run as a listener on port 80, but how do I set it up as an accelerator for both Zope and Apache? And do I no longer need to set up any Rewrite rules in Apache? I'm having a difficult time picturing how the whole thing hangs together... -- John
John Poltorak wrote:
Looking at the various bits of documentation for setting up Squid as an httpd accelerator for Zope leaves me a bit confused, especially on how to reconfigure Apache. It looks as though Squid should run as a listener on port 80, but how do I set it up as an accelerator for both Zope and Apache? And do I no longer need to set up any Rewrite rules in Apache? I'm having a difficult time picturing how the whole thing hangs together...
Why do you need Apache with Squid; are you also delivering content via Apache that's not in Zope? Andrew -- Zope Managed Hosting Systems Administrator/Software Engineer Zope Corporation (540) 361-1700
I've always wondered this, but why is Squid talked about so much for caching when Apache can also cache with mod_cache? Shane On Wed, 08 Dec 2004 09:48:19 -0500, Andrew Sawyers <andrew@zope.com> wrote:
John Poltorak wrote:
Looking at the various bits of documentation for setting up Squid as an httpd accelerator for Zope leaves me a bit confused, especially on how to reconfigure Apache. It looks as though Squid should run as a listener on port 80, but how do I set it up as an accelerator for both Zope and Apache? And do I no longer need to set up any Rewrite rules in Apache? I'm having a difficult time picturing how the whole thing hangs together...
Why do you need Apache with Squid; are you also delivering content via Apache that's not in Zope? Andrew
-- Zope Managed Hosting Systems Administrator/Software Engineer Zope Corporation (540) 361-1700 _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
On Dec 8, 2004, at 15:53, Shane Graber wrote:
I've always wondered this, but why is Squid talked about so much for caching when Apache can also cache with mod_cache?
Very simple: Squid is *made for caching*, it's a cache server, whereas Apache is a *web server* with some caching stuff bolted to the side. jens
--On Mittwoch, 8. Dezember 2004 9:53 Uhr -0500 Shane Graber <sgraber@gmail.com> wrote:
I've always wondered this, but why is Squid talked about so much for caching when Apache can also cache with mod_cache?
Caching with Apache is for kiddies, Squid is for real men :-) The caching options with Apache a very limited. mod_cache is easy to use but not flexible enough for larger setups. -aj
On Dec 8, 2004, at 16:04, Andreas Jung wrote:
--On Mittwoch, 8. Dezember 2004 9:53 Uhr -0500 Shane Graber <sgraber@gmail.com> wrote:
I've always wondered this, but why is Squid talked about so much for caching when Apache can also cache with mod_cache?
Caching with Apache is for kiddies, Squid is for real men :-) The caching options with Apache a very limited. mod_cache is easy to use but not flexible enough for larger setups.
Those same real men use CMF and not Plone ;) jens
Jens Vagelpohl wrote:
On Dec 8, 2004, at 16:04, Andreas Jung wrote:
--On Mittwoch, 8. Dezember 2004 9:53 Uhr -0500 Shane Graber <sgraber@gmail.com> wrote:
I've always wondered this, but why is Squid talked about so much for caching when Apache can also cache with mod_cache?
Caching with Apache is for kiddies, Squid is for real men :-) The caching options with Apache a very limited. mod_cache is easy to use but not flexible enough for larger setups.
Those same real men use CMF and not Plone ;)
jens
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Those same real men use BSD and not Linux :) Heh, sorry... Andrew -- Zope Managed Hosting Systems Administrator/Software Engineer Zope Corporation (540) 361-1700
On Wed, Dec 08, 2004 at 09:53:17AM -0500, Shane Graber wrote:
I've always wondered this, but why is Squid talked about so much for caching when Apache can also cache with mod_cache?
It may well be that Squid is talked about so much, but I'm a bit sceptical about how many people have it set up. I certainly can't get it working and will be looking at Apache as an alternative. Is there a write-up on it anywhere?
Shane
On Wed, 08 Dec 2004 09:48:19 -0500, Andrew Sawyers <andrew@zope.com> wrote:
John Poltorak wrote:
Looking at the various bits of documentation for setting up Squid as an httpd accelerator for Zope leaves me a bit confused, especially on how to reconfigure Apache. It looks as though Squid should run as a listener on port 80, but how do I set it up as an accelerator for both Zope and Apache? And do I no longer need to set up any Rewrite rules in Apache? I'm having a difficult time picturing how the whole thing hangs together...
Why do you need Apache with Squid; are you also delivering content via Apache that's not in Zope? Andrew
-- Zope Managed Hosting Systems Administrator/Software Engineer Zope Corporation (540) 361-1700
-- John
John Poltorak wrote:
On Wed, Dec 08, 2004 at 09:53:17AM -0500, Shane Graber wrote:
I've always wondered this, but why is Squid talked about so much for caching when Apache can also cache with mod_cache?
It may well be that Squid is talked about so much, but I'm a bit sceptical about how many people have it set up. Lots and lots. I certainly can't get it working and will be looking at Apache as an alternative. Is there a write-up on it anywhere? What is the problem you're having? I would expect someone might have problems understanding the redirector possibly; otherwise squid isn't hard to setup. It runs like a champ.
Andrew -- Zope Managed Hosting Systems Administrator/Software Engineer Zope Corporation (540) 361-1700
On Wed, Dec 08, 2004 at 01:59:41PM -0500, Andrew Sawyers wrote:
John Poltorak wrote:
On Wed, Dec 08, 2004 at 09:53:17AM -0500, Shane Graber wrote:
I've always wondered this, but why is Squid talked about so much for caching when Apache can also cache with mod_cache?
It may well be that Squid is talked about so much, but I'm a bit sceptical about how many people have it set up. Lots and lots. I certainly can't get it working and will be looking at Apache as an alternative. Is there a write-up on it anywhere? What is the problem you're having? I would expect someone might have problems understanding the redirector possibly; otherwise squid isn't hard to setup. It runs like a champ.
I've had squid running for years as a proxy server, but getting it set up as an httpd accelerator is proving tricky... I've changed Zope to use port 8081 and have Squid listening on 8080 with httpd_accel_port set to 8081. This is on host 192.168.0.1. Normally I would access MyZopesite using http://192.168.0.1:8080/MyZopesite but with Squid in place I get a Squid error 'while trying to retreive the URL: /MyZopeste I guess there's something missing from the setup but not sure what...
Andrew
-- Zope Managed Hosting Systems Administrator/Software Engineer Zope Corporation (540) 361-1700
-- John
John Poltorak wrote:
I've had squid running for years as a proxy server, but getting it set up as an httpd accelerator is proving tricky...
I've changed Zope to use port 8081 and have Squid listening on 8080 with httpd_accel_port set to 8081. This is on host 192.168.0.1.
Normally I would access MyZopesite using http://192.168.0.1:8080/MyZopesite but with Squid in place I get a Squid error 'while trying to retreive the URL: /MyZopeste
It's not in accelleration mode - your squid thinks it's supposed to be in proxy mode if that's the case.
I guess there's something missing from the setup but not sure what...
Someone followed up with a portion of their squid.conf - check that..... Andrew -- Zope Managed Hosting Systems Administrator/Software Engineer Zope Corporation (540) 361-1700
John Poltorak wrote:
Looking at the various bits of documentation for setting up Squid as an httpd accelerator for Zope leaves me a bit confused, especially on how to reconfigure Apache. It looks as though Squid should run as a listener on port 80, but how do I set it up as an accelerator for both Zope and Apache? And do I no longer need to set up any Rewrite rules in Apache? I'm having a difficult time picturing how the whole thing hangs together...
If you don't need Apache, you can run Squid in front of Zope directly, but Squid doesn't come with its own redirector (to create the equivalent of Apache's rewrite rules), so you'll have to find one or write one yourself. Because I already knew Apache well, and was using it to server other non-Zope content, I decided to put Squid in front of Apache in front of Zope. It has worked well for my purposes. --David
On Wed, Dec 08, 2004 at 09:56:24AM -0500, David Chandek-Stark wrote:
If you don't need Apache, you can run Squid in front of Zope directly, but Squid doesn't come with its own redirector (to create the equivalent of Apache's rewrite rules), so you'll have to find one or write one yourself.
I run a squid accelerator directly in front of zope without using a redirector. This works fine for simple sites where the domain is handled entirely by zope (that is, no special case URL redirection needed). Looking at my squid config file I think the key lines are these: httpd_accel_host virtual cache_peer localhost parent 8080 0 no-query default acl zope_domain dstdomain example.com acl zope_domain dstdomain www.example.com cache_peer_access localhost allow zope_domain -- Fred Yankowski fred@ontosys.com tel: +1.630.879.1312 OntoSys, Inc PGP keyID: 7B449345 fax: +1.630.879.1370 www.ontosys.com 38W242 Deerpath Rd, Batavia, IL 60510-9461, USA
David Chandek-Stark wrote:
John Poltorak wrote:
Looking at the various bits of documentation for setting up Squid as an httpd accelerator for Zope leaves me a bit confused, especially on how to reconfigure Apache. It looks as though Squid should run as a listener on port 80, but how do I set it up as an accelerator for both Zope and Apache? And do I no longer need to set up any Rewrite rules in Apache? I'm having a difficult time picturing how the whole thing hangs together...
If you don't need Apache, you can run Squid in front of Zope directly, but Squid doesn't come with its own redirector (to create the equivalent of Apache's rewrite rules), so you'll have to find one or write one yourself. Because I already knew Apache well, and was using it to server other non-Zope content, I decided to put Squid in front of Apache in front of Zope. It has worked well for my purposes.
Would it be possible, if you could tell us what your setup is. thanks and much kudos in advance Robert
Would it be possible, if you could tell us what your setup is.
Sure. This is basically it: www.mydomain.com - Squid running on port 80 www2.mydomain.com - Apache on port 80, Zope on port 8080 (obviously, Apache and Zope could be on separate boxes) squid.conf: http_port 80 httpd_accel_host www2.mydomain.com httpd_accel_port 80 httpd_accel_single_host on httpd_accel_uses_host_header off httpd.conf: # Apache proxy for Zope RewriteRule ^/(.*)$ http://localhost:8080/VirtualHostBase/http/www.mydomain.com:80/VirtualHostRo... [proxy] --David
On Dec 9, 2004, at 16:08, David Chandek-Stark wrote:
Would it be possible, if you could tell us what your setup is.
Sure. This is basically it:
www.mydomain.com - Squid running on port 80 www2.mydomain.com - Apache on port 80, Zope on port 8080 (obviously, Apache and Zope could be on separate boxes)
squid.conf:
http_port 80 httpd_accel_host www2.mydomain.com httpd_accel_port 80 httpd_accel_single_host on httpd_accel_uses_host_header off
httpd.conf:
# Apache proxy for Zope RewriteRule ^/(.*)$ http://localhost:8080/VirtualHostBase/http/www.mydomain.com:80/ VirtualHostRoot/$1 [proxy]
If the Apache is only used to provide a convenient way for adding a rewrite rule in order to avoid redirectors for Squid then you might be interested in the VirtualHostMonster "Mappings" tab in the ZMI. It allows you to codify virtual host information in Zope itself without using external rewrite rules. jens
On Thu, Dec 09, 2004 at 10:08:40AM -0500, David Chandek-Stark wrote:
Would it be possible, if you could tell us what your setup is.
Sure. This is basically it:
www.mydomain.com - Squid running on port 80 www2.mydomain.com - Apache on port 80, Zope on port 8080 (obviously, Apache and Zope could be on separate boxes)
Looks like you are running Apache and Squid on a different hosts...
squid.conf:
http_port 80 httpd_accel_host www2.mydomain.com httpd_accel_port 80 httpd_accel_single_host on httpd_accel_uses_host_header off
httpd.conf:
# Apache proxy for Zope RewriteRule ^/(.*)$ http://localhost:8080/VirtualHostBase/http/www.mydomain.com:80/VirtualHostRo... [proxy]
Is there any need for anything like SquidGuard which I have seen mentioned in various write ups?
--David
-- John
John Poltorak wrote:
Is there any need for anything like SquidGuard which I have seen mentioned in various write ups?
In general, SquidGuard is focused on the needs of "forward" proxy installations; its benefits for "reverse" / "accelerator" setups haven't (for us) outweighed the additional complexity. Tres. -- =============================================================== Tres Seaver tseaver@zope.com Zope Corporation "Zope Dealers" http://www.zope.com
On Thu, Dec 09, 2004 at 10:08:40AM -0500, David Chandek-Stark wrote:
Would it be possible, if you could tell us what your setup is.
Sure. This is basically it:
www.mydomain.com - Squid running on port 80 www2.mydomain.com - Apache on port 80, Zope on port 8080 (obviously, Apache and Zope could be on separate boxes)
squid.conf:
http_port 80 httpd_accel_host www2.mydomain.com httpd_accel_port 80 httpd_accel_single_host on httpd_accel_uses_host_header off
httpd.conf:
# Apache proxy for Zope RewriteRule ^/(.*)$ http://localhost:8080/VirtualHostBase/http/www.mydomain.com:80/VirtualHostRo... [proxy]
I've taken Zope out of the equation just to try and simplify things but end up with Access denied problems from Squid. Do you need to set any specific Squid ACLs to make this work?
--David
-- John
<dtml-if "fredsession.getsessionuser()!='no session'"> Hello, <dtml-var "fredsession.getsessionuser()"> (<a href="/fredsession/logout?return_to_page=<dtml-var "_.string.split(URL,'//')[1]" missing="index_html" null="index_html"> <dtml-if QUERY_STRING>?<dtml-var QUERY_STRING></dtml-if>"> click here to logout</a>) ...other stuff if logged in... </dtml-if> I have only started looking at the page that has this code to convert to ZPT (of which I am really starting to enjoy) but wondered if anyone had a quick example of how to handle the splitting of the URL in a TAL statement and the forming of the href attribute of that anchor tag. I have looked through all the docs I can find and no clear examples of this situation jump out at me. Thanks for the help if anyone has time. Allen
On Tue, Dec 28, 2004 at 12:39:11PM -0500, Allen Schmidt wrote:
<dtml-if "fredsession.getsessionuser()!='no session'"> Hello, <dtml-var "fredsession.getsessionuser()"> (<a href="/fredsession/logout?return_to_page=<dtml-var "_.string.split(URL,'//')[1]" missing="index_html" null="index_html"> <dtml-if QUERY_STRING>?<dtml-var QUERY_STRING></dtml-if>"> click here to logout</a>)
...other stuff if logged in...
</dtml-if>
I have only started looking at the page that has this code to convert to ZPT (of which I am really starting to enjoy) but wondered if anyone had a quick example of how to handle the splitting of the URL in a TAL statement and the forming of the href attribute of that anchor tag.
Well, that's kinda messy, and there's enough going on in that <a> tag that I'd be tempted to factor it out into a script. Something like (untested): (<a tal:attributes="href string:/fredsession/logout?return_to_page=${context/get_path_and_query}"> Click here to logout </a>) ... and the accompanying script (untested, but should be equivalent to your DTML code): request = context.REQUEST url = request.get('URL') if url is None: path = 'index_html' else: path = url.split('//')[1] query = request.get('QUERY_STRING', '') if query: query = '?' + query return path + query -- Paul Winkler http://www.slinkp.com
Excellent! Thanks Paul! I will give that a shot. Looks logical enough! :) Our entire Zope life has been lived in DTML. Never a reason to switch. Others have done more with py scripts but now I am venturing into page templates more and the absolute need to do more in py scripts. TAL is slick but I still stumble on old DTML embedded 'logic' that I will have to move out to py and then call from tal. Thanks again Allen Paul Winkler wrote:
On Tue, Dec 28, 2004 at 12:39:11PM -0500, Allen Schmidt wrote:
<dtml-if "fredsession.getsessionuser()!='no session'"> Hello, <dtml-var "fredsession.getsessionuser()"> (<a href="/fredsession/logout?return_to_page=<dtml-var "_.string.split(URL,'//')[1]" missing="index_html" null="index_html"> <dtml-if QUERY_STRING>?<dtml-var QUERY_STRING></dtml-if>"> click here to logout</a>)
...other stuff if logged in...
</dtml-if>
I have only started looking at the page that has this code to convert to ZPT (of which I am really starting to enjoy) but wondered if anyone had a quick example of how to handle the splitting of the URL in a TAL statement and the forming of the href attribute of that anchor tag.
Well, that's kinda messy, and there's enough going on in that <a> tag that I'd be tempted to factor it out into a script. Something like (untested):
(<a tal:attributes="href string:/fredsession/logout?return_to_page=${context/get_path_and_query}"> Click here to logout </a>)
... and the accompanying script (untested, but should be equivalent to your DTML code):
request = context.REQUEST url = request.get('URL')
if url is None: path = 'index_html' else: path = url.split('//')[1]
query = request.get('QUERY_STRING', '') if query: query = '?' + query
return path + query
participants (11)
-
Allen Schmidt -
Andreas Jung -
Andrew Sawyers -
David Chandek-Stark -
Fred Yankowski -
Jens Vagelpohl -
John Poltorak -
Paul Winkler -
Robert Rottermann -
Shane Graber -
Tres Seaver