Log in |
Apache, Zope and FastCGIApache, Zope and fastCgi*updated 9/26/00 - added Roug's How-to serve rootfolder from apache *updated 6/7/00 - changed the fastcgi version to the latest*updated 3/9/00 - added ppetru's tip to use blocking call. also added the need to update FCGIServer.py from cvs *updated 1/4/00 - added Roug elegent solution to the extra z's. Also added Sam Gendler's solution using fastcgi with unix socket.
I am no Apache, Zope or fastCGI guru. What i'm doing is collecting all information strewn in the mailing list and putting it all together
Now all urls pointed to http://myserver.com/z will serve up your Zope contents.
In my case, I want to serve Zope from my root URL. We need Apache Rewrite module for this. Add these rules in your httpd.conf: ------httpd.conf--------- RewriteEngine On RewriteRule ^/(.*) /z/$1 [PT] #* solution from Roug RewriteRule ^/(.*) /z/$1 [PT] -------------------------Note:This tip was submitted by "Ron Bickers" but failed to serve Zope off of the root URL. Thanks, Ron! Also read Roug's How-to serve rootfolder with fastcgi. Sidenote: With new base URL, reference to absolute_url will return the "z" too. If you are like me, when development of the site is under way,
Another elegent solution is to add the additional rewrite rule as shown above. If you have other dirs not in Zope you'd want to serve, just add those before the /(.*) statement. Tip: the log files are your best friend! You will need to restart zope and apache for the changes to take effect. To use fastcgi with unix socket, try what Sam Gendler has done. --quote sam--- I got it working with Virtual hosts, so that even the root directory of the virtual host is directed to zope. The config was as follows: Problems, experiences, and fixes
Apache with fastcgi sometimes could not handle requests, prompting error 505. To stop or minimize this error, update FCGIServer.py which sits in $ZOPEHOME/ZServer. Get the latest version (v 1.7 as of 3/9/00) from the cvs. Download it, rename the original FCGIServer.py and replace it with the latest version. Restart Zope for the change to take effect. Also, use blocking call to fastcgi by adding -appConnTimeout 0 (see below) --- FastCgiExternalServer /home/httpd/html/z -host localhost:8999 -pass-header Authorization -appConnTimeout 0 --- However, i still experience "(111)Connection refused: FastCGI: failed to connect to server "/home/httpd/html/z": connect() failed " and " FastCGI: incomplete headers (0 bytes) received from server "/home/httpd/html/z"" with all the updates i did. Anybody know why? During my short experience with Zope, mod_pcgi and mod_fastcgi, I would say mod_pcgi provides more statbility, while mod_fastcgi gives you speed.
As always, if you find errors, do point them to me. Also, mail me your experiences, be it good or bad, and your solutions. Credits go to the mailing list and the zope community. Other useful docs |