Re: [Zope] hard-code pcgi
At 02:50 PM 2/3/99 -0500, Kevin Dangoor wrote:
On Wed, Feb 03, 1999 at 02:04:10PM -0500, Phillip J. Eby wrote: ,----- | Oops, that was unclear. I meant to say that if your host gives you your | own ID, *and* executes CGI under that ID, then you have nothing else to do | except keep permissions straight.
Ahh! That's ideal! Does someone out there set it up like that?
Hmmmmm. Sometimes suEXEC is configured so that the command the request wishes to execute cannot be a symbolic link. Might this pose a problem for pcgi?
Except for the RS/Apa platform, where PCGI presents process-start problems that FastCGI doesn't. On the RS/Apa platform, the cgi-fcgi wrapper is available, and all CGI's execute as the correct user ID to begin with, so the need for a setuid wrapper is eliminated. And some hosting brands that use the RS/Apa platform offer hosting with CGI for as little as $25/month.
Any clues as to what would it take to get Zope to work with the apache fastCGI module? Clint
Clint Shelby McCulloch wrote:
Hmmmmm. Sometimes suEXEC is configured so that the command the request wishes to execute cannot be a symbolic link. Might this pose a problem for pcgi?
It could. OTOH, you're no longer restricted to publishing modules via symlink (see: "Death of symlink" thread on the Bobo list). Also, Amos is now experimenting with getting pcgi to work with ZServer. This potentially removes the process-launch issue some people/platforms have experienced, yet permits Medusa to coexist with an ISP's web server. (This isn't the only way.)
use the RS/Apa platform
What is an RS/Apa platform? Regards, Jeff Bauer Rubicon, Inc.
At 10:33 AM 2/4/99 -0600, Clint Shelby McCulloch wrote:
Any clues as to what would it take to get Zope to work with the apache fastCGI module?
I'm running a production Zope application (albeit a small one) on FastCGI right now. I just added a lockfile (to prevent multiple process instantiation). I'm using cgi-fcgi as a CGI-to-FastCGI gateway, rather than mod_fcgi, but the result is the same. I hope in the next few days to tackle a multithreaded, 100% Python FastCGI front-end for ZPublisher. When it works, I'll share code, as I'd like to see it get back into Zope the way my CGI front-end code did. :)
"Phillip J. Eby" wrote:
At 10:33 AM 2/4/99 -0600, Clint Shelby McCulloch wrote:
Any clues as to what would it take to get Zope to work with the apache fastCGI module?
I'm running a production Zope application (albeit a small one) on FastCGI right now. I just added a lockfile (to prevent multiple process instantiation). I'm using cgi-fcgi as a CGI-to-FastCGI gateway, rather than mod_fcgi, but the result is the same.
I hope in the next few days to tackle a multithreaded, 100% Python FastCGI front-end for ZPublisher. When it works, I'll share code, as I'd like to see it get back into Zope the way my CGI front-end code did. :)
ZServer *will* support FastCGI. I was thinking of doing this myself, but don't know when I'll get to it. You might consider working on the ZServer (Medusa) FastCGI support. It should be easier and will be more useful to others, I think. Jim -- Jim Fulton mailto:jim@digicool.com Technical Director (888) 344-4332 Python Powered! Digital Creations http://www.digicool.com http://www.python.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
At 09:07 AM 2/5/99 -0500, Jim Fulton wrote:
"Phillip J. Eby" wrote:
I hope in the next few days to tackle a multithreaded, 100% Python FastCGI front-end for ZPublisher. When it works, I'll share code, as I'd like to see it get back into Zope the way my CGI front-end code did. :)
ZServer *will* support FastCGI. I was thinking of doing this myself, but don't know when I'll get to it. You might consider working on the ZServer (Medusa) FastCGI support. It should be easier and will be more useful to others, I think.
I have an immediate need for the standalone FastCGI, though. Also, unless ZServer will be able to be configured to die off the way my standalone FastCGI support already does, ZServer won't be appropriate for my operating environment at present. Next, the standalone is an easier project for me to tackle first because it's just a grafting of an existing 100% Python FastCGI front-end onto ZPublisher with some threading glue. And finally, it'd be nice to have that PCGI example to look at first before tackling a ZServer publishing protocol. :)
"Phillip J. Eby" wrote:
And finally, it'd be nice to have that PCGI example to look at first before tackling a ZServer publishing protocol. :)
One goal, I suppose, would be to have all LRP mechanisms editable from a single Zope.cgi file. This would permit the user to adopt whatever is most convenient for their circumstances, e.g. 1) direct ZServer 2) direct PCGI 3) direct FCGI (either cgi-fcgi, or mod_fcgi) 4) ZServer + PCGI | FCGI That being the case, we could work out a set of directlves for Zope.cgi that would be common to both approachs. Amos already has ZServer ignore specific PCGI directives that don't apply to Medusa. This assumes that FCGI uses (or will use) Zope.cgi. Best regards, Jeff Bauer Rubicon, Inc.
At 09:37 AM 2/5/99 -0600, Jeff Bauer wrote:
"Phillip J. Eby" wrote:
And finally, it'd be nice to have that PCGI example to look at first before tackling a ZServer publishing protocol. :)
One goal, I suppose, would be to have all LRP mechanisms editable from a single Zope.cgi file. This would permit the user to adopt whatever is most convenient for their circumstances, e.g.
1) direct ZServer 2) direct PCGI 3) direct FCGI (either cgi-fcgi, or mod_fcgi) 4) ZServer + PCGI | FCGI
That being the case, we could work out a set of directlves for Zope.cgi that would be common to both approachs. Amos already has ZServer ignore specific PCGI directives that don't apply to Medusa. This assumes that FCGI uses (or will use) Zope.cgi.
By Zope.cgi, do you mean ZCGI.py? Or...? I would like to standardize parameters, in any event. So far, here are some of the ones I know of: Common: ======= PUBLISHED_MODULE = 'name of module to publish' INCLUDE_PATHS = ['paths/to/add','to/sys.path'] ZCGI.py ======= Z_DEBUG_MODE = boolean IIS_HACK = boolean Launcher.py =========== IDLE_TIMEOUT = # of seconds after which idle process dies MAX_REQUESTS = retire process after # requests MAX_LIFETIME = retire process after # seconds PROCESS_LOCK_FILE = '/path/to/file/for/mutual/exclusion' SOFTWARE_HOME = 'path/to/published/module' Currently, Launcher handles SOFTWARE_HOME the way cgi-module-publisher used to, i.e., it appends "Components" and "Components/sys.platform" to make additional variants added to the INCLUDE_PATHS. It also does all the symlink sniffing and is fully (AFAIK) backward compatible with earlier Bobo launchers. It even defaults PUBLISHED_MODULE to the basename of sys.argv[0]. Now, in addition to all of the above, I've noticed that Zope 1.9 looks for some variables in the environment, and others in __main__. Perhaps what we need is a "ZConfig" object that handles retrieving configuration parameters automatically, looking first in __main__, then in os.environ, and finally returning a caller-supplied default. E.g.: import __main__, os class ZConfig: def __init__(self): self.__dict__.update(os.environ) self.__dict__.update(__main__.__dict__) self.get = self.__dict__.get def default(self,item,val): setattr(self,item,self.get(item,val)) __main__.__builtins__.ZConfig = ZConfig = ZConfig() Now, you could say from anywhere: ZConfig.default("Z_DEBUG_MODE",1) to set a default, ZConfig.Z_DEBUG_MODE to retrieve the current setting, or: ZConfig.get("IIS_HACK",0) to retrieve a setting with an in-line default. Once we had this, ZCGI and any other plumbing module could just import ZConfig, set any additional defaults that were needed, and then chug right along with the meat of the publishing process. Thoughts anyone? Seems like this would fit nicely in the ZPublisher package as "import ZPublisher.ZConfig". With a few more additions, it could handle some defaults for the other things (e.g. SOFTWARE_HOME, PUBLISHED_MODULE) as well.
Have you considered httpdapy? :) Jeff Bauer wrote:
"Phillip J. Eby" wrote:
And finally, it'd be nice to have that PCGI example to look at first before tackling a ZServer publishing protocol. :)
One goal, I suppose, would be to have all LRP mechanisms editable from a single Zope.cgi file. This would permit the user to adopt whatever is most convenient for their circumstances, e.g.
1) direct ZServer 2) direct PCGI 3) direct FCGI (either cgi-fcgi, or mod_fcgi) 4) ZServer + PCGI | FCGI
That being the case, we could work out a set of directlves for Zope.cgi that would be common to both approachs. Amos already has ZServer ignore specific PCGI directives that don't apply to Medusa. This assumes that FCGI uses (or will use) Zope.cgi.
Best regards,
Jeff Bauer Rubicon, Inc.
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
participants (5)
-
Clint Shelby McCulloch -
Gregory (Grisha) Trubetskoy -
Jeff Bauer -
Jim Fulton -
Phillip J. Eby