Server Side Questions
Is it possible to execute a cgi script (possibly not python) within a dtml document? Are server side includes possible? And can a web server (say apache) be configured to procces Zope objects as if they are some other type of document that can or should be proccess by the server before being sent to a browser? Mixo
Hi mixio, it is possible to call any external program (including cgi scripts) from Zope via external method. You have to write an external method which creates the environment and uses os.system() (iirc) to call it. The other solution is to use Apaches mod_rewrite and rewrite all /cgi-bin/ urls to use apache and all others to use Zope. Apache cant use zope objects by itself.
From my expirience however, often it makes sense to write the CGIs completely new according to what they are supposed to do.
With zope you get a powerful environment to solve daily and also very special problems quite easy and most often more elegant then most CGIs are. Give it a try Tino Wildenhain --On Montag, 13. August 2001 14:25 +0200 mixo <mixo@beth.uniforum.org.za> wrote:
Is it possible to execute a cgi script (possibly not python) within a dtml document? Are server side includes possible? And can a web server (say apache) be configured to procces Zope objects as if they are some other type of document that can or should be proccess by the server before being sent to a browser?
Mixo
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Is it possible to execute a cgi script (possibly not python) within a dtml document?
There is at least one product that lets you include the data of any other web page in a Zope page. Can't remember the name, but it's been mentioned several times on this list. You could use this to suck data from a cgi URL. Don't know if this is what you're looking for -- I don't imagine that it handles the environment in a very complex way.
Are server side includes possible? And can a web server (say apache) be configured to procces Zope objects as if they are some other type of document that can or should be proccess by the server before being sent to a browser?
Although I can't imagine why you would need to do this (Zope is much better than SSI) I suppose it might be possible. Zope leaves SSI directives in the page, so if you can convince Apache to process pages coming through a ProxyPass or RewriteRule or something then you've got it. Don't know enough about Apache to say how, or if something exists now to do this (I would think so), but you could always write an Apache mod that interferes in the publishing process if nothing exists to help you. (I'm thinking mod_python. Hehe.) --jcc (extensible)
"J. Cameron Cooper" wrote:
Is it possible to execute a cgi script (possibly not python) within a dtml document?
There is at least one product that lets you include the data of any other web page in a Zope page. Can't remember the name, but it's been mentioned several times on this list. You could use this to suck data from a cgi URL. Don't know if this is what you're looking for -- I don't imagine that it handles the environment in a very complex way.
Are server side includes possible? And can a web server (say apache) be configured to procces Zope objects as if they are some other type of document that can or should be proccess by the server before being sent to a browser?
Although I can't imagine why you would need to do this (Zope is much better than SSI) I suppose it might be possible. Zope leaves SSI directives in the page, so if you can convince Apache to process pages coming through a ProxyPass or RewriteRule or something then you've got it. Don't know enough about Apache to say how, or if something exists now to do this (I would think so), but you could always write an Apache mod that interferes in the publishing process if nothing exists to help you. (I'm thinking mod_python. Hehe.)
--jcc (extensible)
I already have cgi scripts (shell scripts) that perform certain functions which are sitting on some remote machine (which is not running Zope). I want to be able to use them, and avoid rewriting them in Python (at least for now). What I am looking for is something like <!--#exec cgi="somescript--> which executes a cgi script. Mixo
Hi mixo, ...snip...
I already have cgi scripts (shell scripts) that perform certain functions which are sitting on some remote machine (which is not running Zope). I want to be able to use them, and avoid rewriting them in Python (at least for now). What I am looking for is something like <!--#exec cgi="somescript--> which executes a cgi script.
<dtml-call somescriptmethod> In Extensions folder make python program like this: import os def somescriptmethod: return os.system('path/to/your/script') Include this as external Method from management interface. Note: it is absolutely no good Idea (especially If you are new to python) to make the program name a parameter. HTH Tino Wildenhain
Tino Wildenhain wrote:
Hi mixo, ...snip...
I already have cgi scripts (shell scripts) that perform certain functions which are sitting on some remote machine (which is not running Zope). I want to be able to use them, and avoid rewriting them in Python (at least for now). What I am looking for is something like <!--#exec cgi="somescript--> which executes a cgi script.
<dtml-call somescriptmethod>
In Extensions folder make python program like this:
import os def somescriptmethod: return os.system('path/to/your/script')
Include this as external Method from management interface.
Note: it is absolutely no good Idea (especially If you are new to python) to make the program name a parameter.
HTH Tino Wildenhain
Actually, since the scripts I want to run are running on a remote machine and, they are accessible through the web, I just added the following lines to python script : import urllib stuff=urllib.urlopen("http://remotehost/cgi-bin/somecgiscript") print stuff.read() And I get the results from the script being executed. Mixo P.S. I have tried this through Zope yet.
O
Actually, since the scripts I want to run are running on a remote machine and, they are accessible through the web, I just added the following lines to python script :
import urllib stuff=urllib.urlopen("http://remotehost/cgi-bin/somecgiscript") print stuff.read()
And I get the results from the script being executed.
you may want to try www.zope.org/Members/kedai/KebasData it's a zope product that gets accessable data thru the web. you can then specify/configure what you want and what you dont want from the data ymmv
Mixo P.S. I have tried this through Zope yet.
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Hey Mixo, You can call external programs/CGI scripts from Zope using "External Methods." You basically wrap the CGI call within a python script (not to be confused with a Zope python script) which returns the result of that call to Zope. There are lots of examples of External Methods out there, look in the Zope book and the mailing list archives. Also, if you scour the mailing list archives, you'll find an example of what you want. Search for CGI and my name and you'll find something on it from about year ago. Be very careful in doing these kind of External Method / CGI calls as it is a potential security risk. Eric.
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of mixo Sent: Tuesday, August 14, 2001 6:32 AM To: zope@zope.org Subject: Re: [Zope] Server Side Questions Importance: High
"J. Cameron Cooper" wrote:
Is it possible to execute a cgi script (possibly not python) within a dtml document?
There is at least one product that lets you include the data of any other web page in a Zope page. Can't remember the name, but it's been mentioned several times on this list. You could use this to suck data from a cgi URL. Don't know if this is what you're looking for -- I don't imagine that it handles the environment in a very complex way.
Are server side includes possible? And can a web server (say apache) be configured to procces Zope objects as if they are some other type of document that can or should be proccess by the server before being sent to a browser?
Although I can't imagine why you would need to do this (Zope is much better than SSI) I suppose it might be possible. Zope leaves SSI directives in the page, so if you can convince Apache to process pages coming through a ProxyPass or RewriteRule or something then you've got it. Don't know enough about Apache to say how, or if something exists now to do this (I would think so), but you could always write an Apache mod that interferes in the publishing process if nothing exists to help you. (I'm thinking mod_python. Hehe.)
--jcc (extensible)
I already have cgi scripts (shell scripts) that perform certain functions which are sitting on some remote machine (which is not running Zope). I want to be able to use them, and avoid rewriting them in Python (at least for now). What I am looking for is something like <!--#exec cgi="somescript--> which executes a cgi script.
Mixo
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (5)
-
bak -
Eric Walstad -
J. Cameron Cooper -
mixo -
Tino Wildenhain