Well... still no succes with trying to get Zope to work. It seems to me that in order to get Zope to work I have to completely scrap my Apache and turn it into a Zope web server. I guess I am failing to see the concept here. Does Zope take over everything? I know this seems to be a strange question, but it seems from the rewrite rules that I have seen, that the only way to get Zope to work is if one configures the rewrite rule to examine and rewrite all cgi's so it will go through Zope. However, If I have a cgi-bin and I want to run a cgi from that directory then it is going to get filtered by the rewrite rule. The rewrite rule has a condition of ^/cgi-bin/Zope/(.*) and rewrites it to /home/httpd/cgi-bin/Zope/$1 according to the rewrite log (pasted below) I belive it is doing the rewrite correctly. (2) init rewrite engine with requested uri /cgi-bin/Zope/Zope.cgi/manage (3) applying pattern '^/cgi-bin/Zope/(.*)' to uri '/cgi-bin/Zope/Zope.cgi/manage' (4) RewriteCond: input='' pattern='^(.*)' => matched (2) rewrite /cgi-bin/Zope/Zope.cgi/manage -> /home/httpd/cgi-bin/Zope/Zope.cgi/manage (5) setting env variable 'HTTP_CGI_AUTHORIZATION' to '' (2) remember /home/httpd/cgi-bin/Zope/Zope.cgi/manage to have MIME-type 'application/x-httpd-cgi' (2) local path result: /home/httpd/cgi-bin/Zope/Zope.cgi/manage (1) go-ahead with /home/httpd/cgi-bin/Zope/Zope.cgi/manage [OK] (1) force filename /home/httpd/cgi-bin/Zope/Zope.cgi to have MIME-type 'application/x-httpd-cgi' I have created a var directory under the httpd directory and included everything that was under the /var/local/Zope directory, and given everything there owner:nobody group:nobody rwxrwxrwx. Yes. I altered the Zope.cgi to reflect these directory changes as well. Now the question is what does Apache do with the Zope.cgi? My access.conf includes a "<Directory /home/httpd/cgi-bin/Zope> Options ExecCGI </Directory>", and my srm.conf includes the line "ScriptAlias /cgi-bin/Zope/ /home/httpd/cgi-bin/Zope/" When I go to my browser and type http://localhost/cgi-bin/Zope/Zope.cgi I get this error: ! Temporarily Unavailable The rescource you have requested is temporarily unavailable - please try again later. (102) failure during connect Can someone tell me what this means, what cuases it? -- robert canary system services OhioCounty.Net rwcanary@ohiocounty.net (270)298-9331 Office (270)298-7449 Fax
"Robert W. Canary" wrote:
Well... still no succes with trying to get Zope to work.
It seems to me that in order to get Zope to work I have to completely scrap my Apache and turn it into a Zope web server. I guess I am failing to see the concept here. Does Zope take over everything? I
No, "Zope" doesn't take over everything. In fact, the thing that you are getting frustrated about -- the Apache rewrite rule -- has nothing to do with Zope. It is Apache software and has been in Apache for about the last two years. The fact that it is hard to use and debug is definately a problem for software like Zope that wants to integrate with Apache. This is why the Zope community works *very* hard to help people integrate Apache and Zope, even though technically you're asking Apache questions. In the end, though, the answer is no -- the rewrite rule should not take over the rest of Apache. I've used it many times with some URLs being served off disk and others being served out of various Zope installations.
know this seems to be a strange question, but it seems from the rewrite rules that I have seen, that the only way to get Zope to work is if one configures the rewrite rule to examine and rewrite all cgi's so it will
What evidence leads to that conclusion? Perhaps many of the examples are running Zope in the top of the URL tree, but the "Zap" distribution of Apache provided at zope.org serves up the "/" URL as a static page. Did you try Zap? Even if you are going to throw it out and use your own, it is still a useful existance proof that Zope integration works as advertised. Finally, as proof, here are some lines from our internal development machine which is running Apache. Requests to "/" go to the Document Root on the filesystem. Requests to ~paul go to my public_html directory on the filesystem. Finally, one of the many rewrite rules send "/dav/" to a Zope installation: DocumentRoot /usr/local/apache/htdocs UserDir public_html RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^/dav(.*) /usr/local/apache/dev/dav$1 [e=HTTP_CGI_AUTHORIZATION:%1, t=application/x-httpd-cgi,l] This is Apache 1.3.4.
go through Zope. However, If I have a cgi-bin and I want to run a cgi from that directory then it is going to get filtered by the rewrite rule. The rewrite rule has a condition of ^/cgi-bin/Zope/(.*) and rewrites it to /home/httpd/cgi-bin/Zope/$1 according to the rewrite log (pasted below) I belive it is doing the rewrite correctly.
(2) init rewrite engine with requested uri /cgi-bin/Zope/Zope.cgi/manage
(3) applying pattern '^/cgi-bin/Zope/(.*)' to uri '/cgi-bin/Zope/Zope.cgi/manage' (4) RewriteCond: input='' pattern='^(.*)' => matched (2) rewrite /cgi-bin/Zope/Zope.cgi/manage -> /home/httpd/cgi-bin/Zope/Zope.cgi/manage (5) setting env variable 'HTTP_CGI_AUTHORIZATION' to '' (2) remember /home/httpd/cgi-bin/Zope/Zope.cgi/manage to have MIME-type 'application/x-httpd-cgi' (2) local path result: /home/httpd/cgi-bin/Zope/Zope.cgi/manage (1) go-ahead with /home/httpd/cgi-bin/Zope/Zope.cgi/manage [OK] (1) force filename /home/httpd/cgi-bin/Zope/Zope.cgi to have MIME-type 'application/x-httpd-cgi'
I have created a var directory under the httpd directory and included everything that was under the /var/local/Zope directory, and given everything there owner:nobody group:nobody rwxrwxrwx. Yes. I altered the Zope.cgi to reflect these directory changes as well.
Now the question is what does Apache do with the Zope.cgi?
My access.conf includes a "<Directory /home/httpd/cgi-bin/Zope> Options ExecCGI </Directory>", and my srm.conf includes the line "ScriptAlias /cgi-bin/Zope/ /home/httpd/cgi-bin/Zope/"
Note that the "Zap" distribution puts everything in an httpd.conf file, which I think is the new Apache way of doing things.
When I go to my browser and type http://localhost/cgi-bin/Zope/Zope.cgi I get this error:
! Temporarily Unavailable The rescource you have requested is temporarily unavailable - please try again later. (102) failure during connect
Can someone tell me what this means, what cuases it?
First, it means that the Zope.cgi file _was_ executed by Apache. This file is a shell script which runs the binary PCGI wrapper executable. This executable checks to see if Zope is running. If it isn't, it tries to start it. See if a pcgi.log file is created in your var directory, as well as a .soc file. --Paul
Paul Everitt wrote:
"Robert W. Canary" wrote:
Well... still no succes with trying to get Zope to work.
It seems to me that in order to get Zope to work I have to completely scrap my Apache and turn it into a Zope web server. I guess I am failing to see the concept here. Does Zope take over everything? I
No, "Zope" doesn't take over everything. In fact, the thing that you are getting frustrated about -- the Apache rewrite rule -- has nothing to do with Zope. It is Apache software and has been in Apache for about the last two years.
The fact that it is hard to use and debug is definately a problem for software like Zope that wants to integrate with Apache. This is why the Zope community works *very* hard to help people integrate Apache and Zope, even though technically you're asking Apache questions.
In the end, though, the answer is no -- the rewrite rule should not take over the rest of Apache. I've used it many times with some URLs being served off disk and others being served out of various Zope installations.
That good to here.
know this seems to be a strange question, but it seems from the rewrite rules that I have seen, that the only way to get Zope to work is if one configures the rewrite rule to examine and rewrite all cgi's so it will
What evidence leads to that conclusion? Perhaps many of the examples are running Zope in the top of the URL tree, but the "Zap" distribution of Apache provided at zope.org serves up the "/" URL as a static page.
RewriteRule ^/(.*) /home/cgi-bin/Zope.cgi/$1
Did you try Zap? Even if you are going to throw it out and use your own, it is still a useful existance proof that Zope integration works as advertised.
I ran Zap. I examined it. I studied it.
Finally, as proof, here are some lines from our internal development machine which is running Apache. Requests to "/" go to the Document Root on the filesystem. Requests to ~paul go to my public_html directory on the filesystem. Finally, one of the many rewrite rules send "/dav/" to a Zope installation:
DocumentRoot /usr/local/apache/htdocs UserDir public_html RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^/dav(.*) /usr/local/apache/dev/dav$1 [e=HTTP_CGI_AUTHORIZATION:%1, t=application/x-httpd-cgi,l]
This is Apache 1.3.4.
I have seen a site where it did work. That alone is proof that it will work. I don't doubt it.
go through Zope. However, If I have a cgi-bin and I want to run a cgi from that directory then it is going to get filtered by the rewrite rule. The rewrite rule has a condition of ^/cgi-bin/Zope/(.*) and rewrites it to /home/httpd/cgi-bin/Zope/$1 according to the rewrite log (pasted below) I belive it is doing the rewrite correctly.
(2) init rewrite engine with requested uri /cgi-bin/Zope/Zope.cgi/manage
(3) applying pattern '^/cgi-bin/Zope/(.*)' to uri '/cgi-bin/Zope/Zope.cgi/manage' (4) RewriteCond: input='' pattern='^(.*)' => matched (2) rewrite /cgi-bin/Zope/Zope.cgi/manage -> /home/httpd/cgi-bin/Zope/Zope.cgi/manage (5) setting env variable 'HTTP_CGI_AUTHORIZATION' to ''
Does this line look strang to you?
(2) remember /home/httpd/cgi-bin/Zope/Zope.cgi/manage to have MIME-type 'application/x-httpd-cgi' (2) local path result: /home/httpd/cgi-bin/Zope/Zope.cgi/manage (1) go-ahead with /home/httpd/cgi-bin/Zope/Zope.cgi/manage [OK] (1) force filename /home/httpd/cgi-bin/Zope/Zope.cgi to have MIME-type 'application/x-httpd-cgi'
I have created a var directory under the httpd directory and included everything that was under the /var/local/Zope directory, and given everything there owner:nobody group:nobody rwxrwxrwx. Yes. I altered the Zope.cgi to reflect these directory changes as well.
Now the question is what does Apache do with the Zope.cgi?
My access.conf includes a "<Directory /home/httpd/cgi-bin/Zope> Options ExecCGI </Directory>", and my srm.conf includes the line "ScriptAlias /cgi-bin/Zope/ /home/httpd/cgi-bin/Zope/"
Note that the "Zap" distribution puts everything in an httpd.conf file, which I think is the new Apache way of doing things.
That should not make difference. Once all the conf files are read then Apache is configured. It does not matter if it comes from one file or three.
When I go to my browser and type http://localhost/cgi-bin/Zope/Zope.cgi I get this error:
! Temporarily Unavailable The rescource you have requested is temporarily unavailable - please try again later. (102) failure during connect
Can someone tell me what this means, what cuases it?
First, it means that the Zope.cgi file _was_ executed by Apache. This file is a shell script which runs the binary PCGI wrapper executable. This executable checks to see if Zope is running. If it isn't, it tries to start it.
Hmm, then what causes the 102 error? What is it that is "unavailable"?
See if a pcgi.log file is created in your var directory, as well as a .soc file.
No. No pcgi.log was created.
--Paul
-- robert canary system services OhioCounty.Net rwcanary@ohiocounty.net (270)298-9331 Office (270)298-7449 Fax
Hi, can someone give me a simple example how to do the following: I`d like to have an enhanced Image-Upload-Form, which takes the image (on the local file system) you choose, adds some properties to this image which you can fill in the Form (a few text strings like URL e.g.) and returns the reply I wish (not this ok-Buttons..). The problem is, that I wish to do that in one step (I could use stuff like manage_addImageForm, manage_uploadForm, but I could not explain to a user why this is so complicated ..) help welcome. I feel like running against a wall here :-) Tom
On Sun, Jun 13, 1999 at 01:27:02PM -0100, Tom Schwaller wrote:
Hi, can someone give me a simple example how to do the following:
I`d like to have an enhanced Image-Upload-Form, which takes the image (on the local file system) you choose, adds some properties to this image which you can fill in the Form (a few text strings like URL e.g.) and returns the reply I wish (not this ok-Buttons..).
Tom - I've done something similar with a generic file upload/exchange site. I wanted to tag each File with the (authenticated) user who uploaded it. There's three tricks involved. The first is the standard Zopeism of having a user interface Form method/page, which then calls a non-interface Action method/page. The second is to discover that the various manage_* methods will return to your method if called without a REQUEST variable being set. The third to another Zopeism: using the :method tag on a FORM input NAME to call a method, but not have it show up in the URL. That way, all these file/object management pages bookmark as my main interface page. A couple notes about my (ugly, but functional) methods below: It still implements a click through 'ok', but it returns to my page, not the standard management interface. I've still got some functionality to implement, (i.e. the comment in the code about name collisions), but I think I'm bumping up against what should be done in DTML and what should be moved into external methods. Anyone have any suggestions on improving this code, feel free to comment. Here's my addFileForm (mostly stolen from the imageUpload.dtml source): <!--#var standard_html_header--> <FORM ACTION="<!--#var URL1-->" METHOD="POST" ENCTYPE="multipart/form-data"> <TABLE CELLSPACING="2"> <TR> <TD ALIGN="LEFT" VALIGN="TOP"> <STRONG>File to upload:</STRONG> </TD> <TD ALIGN="LEFT" VALIGN="TOP"> <INPUT TYPE="file" NAME="file" SIZE="25" VALUE=""> </TD> </TR> <TR> <TD></TD> <TD> <BR><INPUT TYPE="SUBMIT" NAME="addFileAction:method" VALUE=" Add "> </TD> </TR> </TABLE> </FORM> <!--#var standard_html_footer--> And here's addFileAction: <!--#var standard_html_header--> <!--#comment--> We need to set the 'id' to the filename if it's not set. The second line strips the last component from the filename passed in the REQUEST.file object, in a platform neutral hack. It fails if someone uses the path seperator component from one platforn in the filename on another platform. E.g. slashed dates in filenames on Macs. I stole it from cookId in Image.py <!--#/comment--> <!--#unless REQUEST['id']--> <!--#call "REQUEST.set('filename',REQUEST['file'].filename)"--> <!--#call "REQUEST.set('id',filename[_.max( _.string.rfind(filename, '/'), _.string.rfind(filename, '\\'), _.string.rfind(filename, ':'), )+1:])"--> <!--#/unless--> <!--#if "REQUEST['id'] in objectIds()"--> <H4>Sorry! That name exists, try again (use your browser's back button)</H4> <!--#comment--> fix this up Would you like to: New Name: rename existing file replace existing file Upload with new name <!--#/comment--> <!--#else--> <!--#call "manage_addFile(id=REQUEST['id'],file=REQUEST['file'])"--> <!--#call "_.getitem(REQUEST['id']).manage_addProperty( 'addedby',REQUEST.get('AUTHENTICATED_USER'), 'string')"--> <FORM ACTION=<!--#var "URL1"--> METHOD="GET"> <H3>File Added</H3> <INPUT type=submit value="OK"> </FORM> <!--#/if--> <!--#var standard_html_footer--> -- Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu> NSBRI Research Scientist/Programmer Computer and Information Technology Institute Rice University, 6100 S. Main St., Houston, TX 77005
"Ross J. Reedstrom" wrote:
On Sun, Jun 13, 1999 at 01:27:02PM -0100, Tom Schwaller wrote:
Hi, can someone give me a simple example how to do the following:
I`d like to have an enhanced Image-Upload-Form, which takes the image (on the local file system) you choose, adds some properties to this image which you can fill in the Form (a few text strings like URL e.g.) and returns the reply I wish (not this ok-Buttons..).
Tom - I've done something similar with a generic file upload/exchange site. I wanted to tag each File with the (authenticated) user who uploaded it. There's three tricks involved. The first is the standard Zopeism of having a user interface Form method/page, which then calls a non-interface Action method/page. The second is to discover that the various manage_* methods will return to your method if called without a REQUEST variable being set. The third to another Zopeism: using the :method tag on a FORM input NAME to call a method, but not have it show up in the URL. That way, all these file/object management pages bookmark as my main interface page.
A couple notes about my (ugly, but functional) methods below: It still implements a click through 'ok', but it returns to my page, not the standard management interface.
I've still got some functionality to implement, (i.e. the comment in the code about name collisions), but I think I'm bumping up against what should be done in DTML and what should be moved into external methods.
Anyone have any suggestions on improving this code, feel free to comment.
Here's my addFileForm (mostly stolen from the imageUpload.dtml source):
Hi Ross, cool, thanks a lot. Not kind of obvious. Your example is of GREAT help to me. I think I can now implement what I want... When I upload an image with the code you postet, the resulting object is not a "normal" image object (although it has every attribute one wants, including the "addedby"). The icon although is different and there's also a thing called Precondition (which is empty..) Any idea what that is? cu and it is fun to be on this list :-) -- Tom http://www.linux-magazin.de/
On Tue, Jun 15, 1999 at 10:08:39AM -0100, Tom Schwaller wrote:
When I upload an image with the code you postet, the resulting object is not a "normal" image object (although it has every attribute one wants, including the "addedby"). The icon although is different and there's also a thing called
Right, that's because I use manage_addFile for all the uploads, rather than manage_addImage. It might be possible to do some sort of magic with mimetypes, but if your users can be trusted to check the right box, you could use the trick the management form does, and pass in a variable from the form from a checklist or dropbox, like "kind" and "Kind" in the snippet from imageAdd.html below: ---------- You can create a new <!--#var kind--> in the system using the form below. Select an <!--#var kind--> from your local computer by clicking the <em>Browse</em> button. The <!--#var kind--> you select will be uploaded to the application. <FORM ACTION="manage_add<!--#var Kind-->" METHOD="POST" ENCTYPE="multipart/form-data"> <TABLE CELLSPACING="2"> ----------
Precondition (which is empty..)
Any idea what that is?
Don't know, looks interesting... Here's where it gets called, in the index_html method for the File object: def index_html(self, REQUEST, RESPONSE): """ The default view of the contents of a File or Image. Returns the contents of the file or image. Also, sets the Content-Type HTTP header to the objects content type. """ if self.precondition and hasattr(self,self.precondition): # Grab whatever precondition was defined and then # execute it. The precondition will raise an exception # if something violates its terms. c=getattr(self,self.precondition) if hasattr(c,'isDocTemp') and c.isDocTemp: c(REQUEST['PARENTS'][1],REQUEST) else: c() RESPONSE.setHeader('content-type', self.content_type) return self.data So, it looks like you can set a precondition to be an arbitary method of your file object, and it will be called (either in the context of this File object, or it's parent, depending on if your precondition includes a 'isDocTemp' attribute itself) Any one at DC have an example of what this is useful for? Nothing shows up in the source outside the File creation code. Ross -- Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu> NSBRI Research Scientist/Programmer Computer and Information Technology Institute Rice University, 6100 S. Main St., Houston, TX 77005
I think I've solved both of these problems for my situation with the following Rewrite rules... I'm running ZServer on port 9673 and via pcgi. I use the 9673 approach internally while externally folks go through apache and use pcgi. note that access to /cgi-bin doesn't go through zope.... but /foo* and /zope/foo* and /zope* all map to Zope.cgi/foo... This way you can mix a filesystem (apache only, cgi, html) based site with zope, if that floats your boat. ;-) On the Zope server I have a root level folder called 'foo' that contains the foo site. This way I can have a single zope server that handles may different virtual hosts all running through apache (including ssl) without using :9673 etc.... <VirtualHost foo.spvi.com> Port 80 ServerAdmin steve@spvi.com DocumentRoot /usr/local/www/sites/foo/Pages Alias /Images "/usr/local/www/sites/foo/Images" ServerName foo.spvi.com ErrorLog /var/log/foo_error.log TransferLog /var/log/foo_access.log RewriteEngine on RewriteRule ^/zope/foo(.*) /zope$1 RewriteRule ^/foo(.*) /zope$1 RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^/zope(.*) /usr/local/etc/zope/Zope.cgi/foo$1 [e=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l] </VirtualHost>
On Thu, Jun 10, 1999 at 08:54:38PM +0200, Alexander Staubo wrote:
I'm having a similar problem. I'm running zope behind apache on port 9673. And I'm using a rewrite rule to redirect anything under http://mysite.com/mydir into http://mysite.com:9673/mydir
After the first page load, zope puts in the base tag as http://mysite.com:9673/mydir and all subsequent links on the page use that.
"Robert W. Canary" wrote:
Well... still no succes with trying to get Zope to work.
It seems to me that in order to get Zope to work I have to completely scrap my Apache and turn it into a Zope web server. I guess I am failing to see the concept here. Does Zope take over everything? I
.....
I think this may answer this question as well.... the URLs that get requestes here are not /cgi-bin/zope/Zope.cgi/foo$ but rather just: http://foo.spvi.com/zope (takes me to zopes root 'foo' folder..) http://foo.spvi.com/anything/else/but/zope/or/foo/index.html (takes me to a filesystem object) http://foo.spvi.com/foo/some/zope/path (takes me through zope....) also.. once you are authenticated... you need to shut down your browser to 'deauthenticate'. I know of no way to 'log out'. -steve
participants (5)
-
Paul Everitt -
Robert W. Canary -
Ross J. Reedstrom -
Steve Spicklemire -
Tom Schwaller