[Zope] Zope and Apache -- almost there

Kam Cheung kcheung@littlecircle.com
Thu, 08 Jul 1999 13:17:58 +0000


I am having some difficulties to get Zope working with Apache.

I have Red Hat Linux 6.0 running, using the bundle Apache 1.3.6.

My set up is:
 Apache Config Files is under /etc/httpd/conf
 Apache Log Files is under /etc/httpd/logs
 CGI BIN is at /home/httpd/cgi-bin
 Zope is at /usr/local/servers/Zope


Here is my httpd.conf:

  ServerType standalone
  ServerName mars.littlecircle.com
  PidFile logs/zap.pid
  ScoreBoardFile logs/zap.scoreboard
  Timeout 300
  KeepAlive On
  MaxKeepAliveRequests 100
  KeepAliveTimeout 15
  MinSpareServers 5
  MaxSpareServers 10
  StartServers 5
  MaxClients 150
  MaxRequestsPerChild 30
  User nobody
  Group nobody

  ServerAdmin kcheung@littlecircle.com
  ServerRoot /etc/httpd

  LoadModule env_module         modules/mod_env.so
  LoadModule config_log_module  modules/mod_log_config.so
  LoadModule mime_module        modules/mod_mime.so
  LoadModule negotiation_module modules/mod_negotiation.so
  LoadModule status_module      modules/mod_status.so
  LoadModule includes_module    modules/mod_include.so
  LoadModule autoindex_module   modules/mod_autoindex.so
  LoadModule dir_module         modules/mod_dir.so
  LoadModule cgi_module         modules/mod_cgi.so
  LoadModule asis_module        modules/mod_asis.so
  LoadModule imap_module        modules/mod_imap.so
  LoadModule action_module      modules/mod_actions.so
  LoadModule userdir_module     modules/mod_userdir.so
  LoadModule proxy_module       modules/libproxy.so
  LoadModule alias_module       modules/mod_alias.so
  LoadModule rewrite_module     modules/mod_rewrite.so
  LoadModule access_module      modules/mod_access.so
  LoadModule auth_module        modules/mod_auth.so
  LoadModule setenvif_module    modules/mod_setenvif.so

  ClearModuleList
  AddModule mod_env.c
  AddModule mod_log_config.c
  AddModule mod_mime.c
  AddModule mod_negotiation.c
  AddModule mod_status.c
  AddModule mod_include.c
  AddModule mod_autoindex.c
  AddModule mod_dir.c
  AddModule mod_cgi.c
  AddModule mod_asis.c
  AddModule mod_imap.c
  AddModule mod_actions.c
  AddModule mod_userdir.c
  AddModule mod_proxy.c
  AddModule mod_alias.c
  AddModule mod_rewrite.c
  AddModule mod_access.c
  AddModule mod_auth.c
  AddModule mod_so.c
  AddModule mod_setenvif.c

  Port 80

  DocumentRoot /home/httpd/html
  ScriptAlias /cgi-bin/ /home/httpd/cgi-bin/
  TypesConfig /etc/httpd/conf/mime.types

  <Directory /home/httpd/cgi-bin>
  AllowOverride None
  Options ExecCGI
  Order allow,deny
  Allow from all
  </Directory>

  RewriteEngine On
  RewriteLog logs/zap_rewrite_log
  RewriteLogLevel 9

  RewriteCond %{HTTP:Authorization} ^(.*)
  RewriteRule ^/Zope(.*) /home/httpd/cgi-bin/Zope.cgi$1
[e=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l]

  ErrorLog logs/error_log
  LogLevel warn

  LogFormat "%h %l %u %t \"%r\" %>s %b" common
  CustomLog logs/access_log common

  BrowserMatch "Mozilla/2" nokeepalive
  BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0

  BrowserMatch "RealPlayer 4\.0" force-response-1.0
  BrowserMatch "Java/1\.0" force-response-1.0
  BrowserMatch "JDK/1\.0" force-response-1.0



  #<Location /server-status>
  #    SetHandler server-status
  #    Order deny,allow
  #    Deny from all
  #    Allow from .your_domain.com
  #</Location>

  #<Location /server-info>
  #    SetHandler server-info
  #    Order deny,allow
  #    Deny from all
  #    Allow from .your_domain.com
  #</Location>

  #<IfModule mod_proxy.c>
  #ProxyRequests On
  #
  #<Directory proxy:*>
  #    Order deny,allow
  #    Deny from all
  #    Allow from .your_domain.com
  #</Directory>
  #
  #ProxyVia On
  #</IfModule>
  # End of proxy directives.


(NOTE: RewriteRule, of course, is in one line, it just got wrapped in this
message)


With this set up, Zope was actually working when I viewed the site by going
to:
    http://mars.littlecircle.com/cgi-bin/Zope.cgi


But when I tried to go to the manage page, I kept getting Authorization
Error. The result looked like this on my browser:

  You are not authorized to access this resource. No Authorization header
  found.

  Traceback (innermost last):
    File lib/python/ZPublisher/Publish.py, line 877, in publish_module
    File lib/python/ZPublisher/Publish.py, line 531, in publish
      (Info: /manage)
    File lib/python/ZPublisher/Publish.py, line 297, in unauthorized
  Unauthorized: (see above)



Here is the log that I got in the rewrite_log file:
  209.19.117.18 - - [07/Jul/1999:08:25:26 -0400]
   [mars.littlecircle.com/sid#80774ac][rid#808f3e4/initial]
   (2) init rewrite engine with requested uri /cgi-bin/Zope.cgi/manage
   
  209.19.117.18 - - [07/Jul/1999:08:25:26 -0400]
   [mars.littlecircle.com/sid#80774ac][rid#808f3e4/initial]
   (3) applying pattern '^/Zope(.*)' to uri '/cgi-bin/Zope.cgi/manage'
   
  209.19.117.18 - - [07/Jul/1999:08:25:26 -0400]
   [mars.littlecircle.com/sid#80774ac][rid#808f3e4/initial]
   (1) pass through /cgi-bin/Zope.cgi/manage
   
  209.19.117.18 - - [07/Jul/1999:08:25:26 -0400]
   [mars.littlecircle.com/sid#80774ac][rid#8091994/subreq]
   (2) init rewrite engine with requested uri /manage
   
  209.19.117.18 - - [07/Jul/1999:08:25:26 -0400]
   [mars.littlecircle.com/sid#80774ac][rid#8091994/subreq]
   (3) applying pattern '^/Zope(.*)' to uri '/manage'
   
  209.19.117.18 - - [07/Jul/1999:08:25:26 -0400]
   [mars.littlecircle.com/sid#80774ac][rid#8091994/subreq]
   (1) pass through /manage


(The authorization problem doesn't generate new entry in the error_log.)


I admitted that I am a newbie. I have never touched a Linux, or strictly
speaking, UNIX machine 3 days ago. But judging from the discussion that I
have found in this list, I should be pretty close to getting it work -- at
least I didn't get a "document not found". Anyone can help?



Kam On Cheung