[Zope] - newbie PCGI problems (fwd)

Peter J Ulintz pulintz@umich.edu
Tue, 8 Dec 1998 10:14:39 -0500 (EST)


On Mon, 7 Dec 1998, Jeff Bauer wrote:

> 
> > NEWBIE QUESTION I:
> > Exactly where do you put the mod_rewrite config info?  I 
> > tried putting it in the normal three .conf files and got
> > errors.  I DID compile the server with the mod_rewrite
> > included.
>

> The Rewrite directives for Apache normally go in
> httpd.conf.  Actually the Rewrite directives should only
> affect authorization, so if you are denied access *after*
> the user name and password dialog appears, everything
> else with PCGI is probably working.


Cool.  I added em, but it didn't seem to help much.  

> 
> Ah, this points out a potential problem.  If you start using
> Zope with ZopeHTTPServer under your account, then it's possible
> that the database is no longer accessible through your web
> server.  This is something we should document better, because
> it represents a natural progression of tasks.
>

Yea, I probably shoulda mentioned that... I did run the wo_pcgi.py script
first with the ZopeHTTPServer, and it installed flawlessly, and I played
around in there a bit...
  
> > File
> > "/export/home/pulintz/Zope-1.9b1-src/lib/python/
> > Products/sample/Product.py",
> > line 24, in ? 
> >    import OFS.SimpleItem, Persistence, Acquisition, AccessControl.Role
> > ImportError: (<class exceptions.ImportError at ab540>, 
> > 'No module named Persistence') 
> 
> > Went into the Product.py file and changed "Persistence" to
> > "BoboPOS.Persistence", and tried to bring up zope in the 
> > browser again.  I got the authentication window!  But I 
> > couldn't authenticate, getting the error message concerning
> > the authentication headers.  
> 
> Changing the code in Product.py is a no-no at this stage
> unless you're doing something benign (e.g. log file or
> MrCreosote) because you're simply hiding a problem that
> will be more difficult to track later.  See below.
>

Okay, changed that back... actually, to be totally safe, I scrubbed
everything and reinstalled Zope, making the appropriate permissions
changes, and adding the PYTHONPATH to the pcgi info file... I also
rechecked the apache configuration files to make sure the mod_rewrite was
included in the build, and to make sure that I could follow symbolic
links,etc.  Tried to fire up Zope and got the "Serious Application Error"
screen.  Checked the pcgi.log, and had the same permission trouble with
the Data.bbb file, so I reset these permissions to be globally writable
and tried again-- got the authentication screen.  Still can't
authenticate.  Gives the "You are not authorized to access this resource.
No Authorization header found" error.
 
Reading your "Sacrificial Virgin" email:  so on Solaris is it
necessary to have the UNION_SEMUN macro in
pcgi.h?  (I'll try and avoid editing the Publish.unauthorized() method)
Anything else need to be done, or should I just wait for the next
release?
 
> >
> > PCGI info file: /export/home/pulintz/Zope-1.9b1-src/Zope.cgi 
> > PCGI wrapper: /export/home/pulintz/Zope-1.9b1-src/pcgi/pcgi-wrapper 
> > error attempting: 'from cgi_module_publisher import publish_module' 
> > status: FAILURE
> 
> This provides us an important clue, although it's slightly 
> misreported and you actually had it available in your earlier
> traceback.  (Zope was released before pcgifile.py could be 
> updated; to be remedied shortly.)  
> 
> The pcgi_publisher.py module is actually trying to import
> publish_module from ZPublisher.
> 

Yea-- Can't seem to get around this...
<cringe>
Potential stupid question:  Shouldn't there be a ZPublisher module
somewhere?
</cringe>

Anyway, trying your advice below...

> Since your problem (authentication aside) is essentially 
> one of not being able to import the correct module, for
> the time being let's put PYTHONPATH in your Zope.cgi
> info file:
> 
>   PYTHONPATH=/usr/local/bin/python:.
> 
> If the solution still isn't obvious, you can try
> to expedite things by creating a test cgi file, 
> TestZope.cgi:
> 
>     #!/usr/local/bin/python
>     
>     print "Content-type: text/html"
>     print
>     print "Looks OK"
> 
> Get TestZope.cgi working and then add some import statements,
> placed just before print "Looks OK", e.g.:
> 
>     from ZPublisher import publish_module
>     
> As it breaks, you can add to your import path by iteratively
> doing the following, placing the sys.path.append just ahead
> of importing publish_module.
> 
>     import sys
>     sys.path.append('/export/home/...')
> 
> The step above shouldn't be necessary, but it helps to 
> define a small test case so that you can narrow down the 
> real problem.  And it's better than sitting there staring
> at your screen <wink>.
>

The simple script with just "Looks okay" works fine of coarse, but I can't
seem to find a path to ZPublisher anywhere, no matter how many locations I
add to sys.path.  Trying to test pcgi more, I did the Example
/pcgitest/getTime and I got the "Temporarily Unavailable" screen, with no
additional error message. (And I did make sure the directives were set
correctly)

NOW, the ../cgi-bin/pcgifile.py?filename=.../Zope.cgi thing gives me

PCGI info file: /export/home/pulintz/Zope-1.9b1-src/Zope.cgi
PCGI wrapper:   /export/home/pulintz/Zope-1.9b1-src/pcgi/pcgi-wrapper
PCGI_SOCKET_FILE write permission error:
/export/home/pulintz/Zope-1.9b1-src/var/pcgi.soc
status: FAILURE

but I've checked the permissions on everything, and /var is globally
writable.

I'll keep at it... I installed Bobo, and that works, which makes me feel a
bit better.  Maybe I'll content myself to play around with that until the
dust settles a bit.

Thanks for the help so far!
-P