Zope
  Home arrow Zope arrow Page 5 - Using Zope With Apache
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
ZOPE

Using Zope With Apache
By: icarus, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 30
    2002-05-14


    Table of Contents:
  • Using Zope With Apache
  • A Few Good Reasons
  • When Persistence Pays Off
  • The Writing On The Wall
  • The Fast And The Furious
  • Performing By Proxy
  • Zip Zap Zoom

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Using Zope With Apache - The Fast And The Furious
    ( Page 5 of 7 )

    Now, while the procedure on the previous page does seem to work in some cases (at least according to all the documentation I read and some of the posts in the online newsgroups), I have to admit that, despite my best efforts, I was unable to get the URL rewriting to work correctly on my system. If you had the same problem, then be of stout heart, because there does exist an alternative solution.

    This alternative is FastCGI, which works just as well, and is much easier to install and use. First, untar the Apache distribution to a directory on your system.

    $ cd /tmp/sources $ tar -xzvf apache_1.3.20.tar.gz
    Next, untar the FastCGI distribution

    $ tar -xzvf mod_fastcgi-2.2.12.tar.gz
    and move the contents of the newly-created directory to <apache-source>/src/modules/fastcgi

    $ mv mod_fastcgi-2.2.12 apache_1.3.20/src/modules/fastcgi/
    Configure Apache to activate this FastCGI module.

    $ cd /tmp/sources/apache_1.3.20 $ ./configure --activate-module=src/modules/fastcgi/libfastcgi.a
    In case you're wondering, no, there isn't an error in the line above - the file "libfastcgi.a" doesn't exist at the moment, but it will soon.

    Compile and install the package.

    $ make $ make install
    At this point, you can verify that the FastCGI module has been compiled into the server by executing the httpd binary with the "-l" parameter (look for the entry "mod_fastcgi.c" in the resulting output)

    Next, configure Apache so that it knows how to handle FastCGI. Pop open Apache's "httpd.conf" file and add the following lines to it:

    FastCgiExternalServer /usr/local/apache/htdocs/zope -host localhost:8889 -pass-header Authorization <Location /zope> SetHandler fastcgi-script </Location>
    The FastCgiExternalServer directive defines the file "/usr/local/apache/htdocs/zope" as a FastCGI application, one that will be started and stopped manually. It also means that any request for this file from a client browser will automatically be handled by FastCGI.

    The "-pass-header Authorization" argument to the FastCgiExternalServer directive instructs Apache to pass authentication information to the FastCGI application; this will (hopefully) solve the authentication problems experienced with PCGI.

    Now, shift the action over to Zope. You'll need to start Zope with a couple of additional configuration parameters, so that it knows it needs to use FastCGI. Here's how:

    $ cd /usr/local/Zope/ $ ./bin/python z2.py -D -F 8889
    This tells Zope to use FastCGI, and to run on port number 8889. If you'd prefer to use a UNIX domain socket instead of a TCP port, you can replace the port number with the path to the socket.

    Zope should now start and run silently in the foreground.

    Finally, start Apache.

    $ /usr/local/apache/bin/apachectl start
    At this point, you should be able to browse to the URL http://your.server/zope/ and view the Zope screens. All content under the /zope/ "directory" will be served up by Zope; all other content will be served by Apache.

    You'll notice, also, that if you go to the Zope management interface, at http://your.server/zope/manage/, you'll have no trouble logging in (so long as you have the right credentials). Thus, FastCGI very neatly solves the authentication problem PCGI had - and that's why I'd recommend this approach over the previous one.

     
     
    >>> More Zope Articles          >>> More By icarus, (c) Melonfire
     

       

    ZOPE ARTICLES

    - Creating Zope Products
    - Plone Content Types With Archetypes
    - Flat User Management in Zope
    - Creating Basic Zope Applications
    - Getting started with Zope for Linux and Sola...
    - ZPT Basics (part 4)
    - ZPT Basics (part 3)
    - ZPT Basics (part 2)
    - ZPT Basics (part 1)
    - Exception Handling In DTML
    - DTML Basics (part 4)
    - DTML Basics (part 3)
    - DTML Basics (part 2)
    - DTML Basics (part 1)
    - Using Zope With Apache





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek