[Zope] Problem refering to a subfolder object

Kam Cheung zope@littlecircle.com
Sun, 11 Jul 1999 15:43:58 -0400


> Something like this also works::
> 
> <!--#if "_.hasattr(images.global, section)"-->
>     <img src="images/global/<!--#var section-->">
> <!--#else-->
>     <img src="images/global/default">
> <!--#/if-->

It works! But I found out another problem, I got an "You are not authorized
to access images. " error when viewing the page as an anonymous user.
Actually, even the <!--#with--> method gave me the same error (I didn't
check it as an anonymous user when I used it).

Here is the rewrite log that I got:
216.46.86.13 - - [10/Jul/1999:11:25:14 -0400]
 [mars.littlecircle.com/sid#80774ac]
 [rid#80919e4/initial]
 (2) init rewrite engine with requested uri /Zope/

216.46.86.13 - - [10/Jul/1999:11:25:14 -0400]
 [mars.littlecircle.com/sid#80774ac]
 [rid#80919e4/initial]
 (3) applying pattern '^/Zope(.*)' to uri '/Zope/'

216.46.86.13 - - [10/Jul/1999:11:25:14 -0400]
 [mars.littlecircle.com/sid#80774ac]
 [rid#80919e4/initial]
 (4) RewriteCond: input='' pattern='^(.*)' => matched

216.46.86.13 - - [10/Jul/1999:11:25:14 -0400]
 [mars.littlecircle.com/sid#80774ac]
 [rid#80919e4/initial]
 (2) rewrite /Zope/ -> /home/httpd/cgi-bin/Zope.cgi/

216.46.86.13 - - [10/Jul/1999:11:25:14 -0400]
 [mars.littlecircle.com/sid#80774ac]
 [rid#80919e4/initial]
 (5) setting env variable 'HTTP_CGI_AUTHORIZATION' to ''

216.46.86.13 - - [10/Jul/1999:11:25:14 -0400]
 [mars.littlecircle.com/sid#80774ac]
 [rid#80919e4/initial]
 (2) remember /home/httpd/cgi-bin/Zope.cgi/
  to have MIME-type 'application/x-httpd-cgi'

216.46.86.13 - - [10/Jul/1999:11:25:14 -0400]
 [mars.littlecircle.com/sid#80774ac]
 [rid#80919e4/initial]
 (2) local path result: /home/httpd/cgi-bin/Zope.cgi/

216.46.86.13 - - [10/Jul/1999:11:25:14 -0400]
 [mars.littlecircle.com/sid#80774ac]
 [rid#80919e4/initial]
 (1) go-ahead with /home/httpd/cgi-bin/Zope.cgi/ [OK]

216.46.86.13 - - [10/Jul/1999:11:25:14 -0400]
 [mars.littlecircle.com/sid#80774ac]
 [rid#80919e4/initial]
 (1) force filename /home/httpd/cgi-bin/Zope.cgi
  to have MIME-type 'application/x-httpd-cgi'

216.46.86.13 - - [10/Jul/1999:11:25:14 -0400]
 [mars.littlecircle.com/sid#80774ac]
 [rid#8093f94/subreq]
 (2) init rewrite engine with requested uri /

216.46.86.13 - - [10/Jul/1999:11:25:14 -0400]
 [mars.littlecircle.com/sid#80774ac]
 [rid#8093f94/subreq]
 (3) applying pattern '^/Zope(.*)' to uri '/'

216.46.86.13 - - [10/Jul/1999:11:25:14 -0400]
 [mars.littlecircle.com/sid#80774ac]
 [rid#8093f94/subreq]
 (1) pass through /

216.46.86.13 - - [10/Jul/1999:11:25:14 -0400]
 [mars.littlecircle.com/sid#80774ac]
 [rid#80919e4/initial]
 (2) init rewrite engine with requested uri /Zope/

216.46.86.13 - - [10/Jul/1999:11:25:14 -0400]
 [mars.littlecircle.com/sid#80774ac]
 [rid#80919e4/initial]
 (3) applying pattern '^/Zope(.*)' to uri '/Zope/'

216.46.86.13 - - [10/Jul/1999:11:25:14 -0400]
 [mars.littlecircle.com/sid#80774ac]
 [rid#80919e4/initial]
 (4) RewriteCond: input='' pattern='^(.*)' => matched

216.46.86.13 - - [10/Jul/1999:11:25:14 -0400]
 [mars.littlecircle.com/sid#80774ac]
 [rid#80919e4/initial]
 (2) rewrite /Zope/ -> /home/httpd/cgi-bin/Zope.cgi/

216.46.86.13 - - [10/Jul/1999:11:25:14 -0400]
 [mars.littlecircle.com/sid#80774ac]
 [rid#80919e4/initial]
 (5) setting env variable 'HTTP_CGI_AUTHORIZATION' to ''

216.46.86.13 - - [10/Jul/1999:11:25:14 -0400]
 [mars.littlecircle.com/sid#80774ac]
 [rid#80919e4/initial]
 (2) remember /home/httpd/cgi-bin/Zope.cgi/
  to have MIME-type 'application/x-httpd-cgi'

216.46.86.13 - - [10/Jul/1999:11:25:14 -0400]
 [mars.littlecircle.com/sid#80774ac]
 [rid#80919e4/initial]
 (2) local path result: /home/httpd/cgi-bin/Zope.cgi/

216.46.86.13 - - [10/Jul/1999:11:25:14 -0400]
 [mars.littlecircle.com/sid#80774ac]
 [rid#80919e4/initial]
 (1) go-ahead with /home/httpd/cgi-bin/Zope.cgi/ [OK]

216.46.86.13 - - [10/Jul/1999:11:25:14 -0400]
 [mars.littlecircle.com/sid#80774ac]
 [rid#80919e4/initial]
 (1) force filename /home/httpd/cgi-bin/Zope.cgi
  to have MIME-type 'application/x-httpd-cgi'

216.46.86.13 - - [10/Jul/1999:11:25:14 -0400]
 [mars.littlecircle.com/sid#80774ac]
 [rid#8093f94/subreq]
 (2) init rewrite engine with requested uri /

216.46.86.13 - - [10/Jul/1999:11:25:14 -0400]
 [mars.littlecircle.com/sid#80774ac]
 [rid#8093f94/subreq]
 (3) applying pattern '^/Zope(.*)' to uri '/'

216.46.86.13 - - [10/Jul/1999:11:25:14 -0400]
 [mars.littlecircle.com/sid#80774ac]
 [rid#8093f94/subreq]
 (1) pass through /



I think that may have something to do with my httpd.conf, but I am not sure.
This 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



My security setting is very simple, it's just the Zope's default --
Anonymous only has "View" access, while Managers have full access.



Kam