This is a discussion on Variation of mod_include -- pointers? within the Linux Web Servers forums, part of the Web Server and Related Forums category; Dear Apache Module Experts, I would like to write an Apache module that is variation of 'mod_include'. For SSI, mod_include ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Dear Apache Module Experts, I would like to write an Apache module that is variation of 'mod_include'. For SSI, mod_include parses the file, extracts code segments, execute them, and send the results (along with non-code text) back to client. Does anyone have pointers (examples, docs, anything) on how to - get the entire content of file as single string, and - give a replacement string back to Apache to send to client. ? Background: I'm trying to write "mod_bash" where the embedded code is shell script, instead of PHP, Java (JSP), or MS-Basic (ASP). Right now, I can do the whole thing from command line. But, obviously, I have to do this from Apache inside. Yours truly, -- William Park, Open Geometry Consulting, <opengeometry@yahoo.ca> No, I will not fix your computer! I'll reformat your harddisk, though. |
|
|||
|
In article <2jip4jF10qf6jU1@uni-berlin.de>,
William Park <opengeometry@yahoo.ca> writes: > Does anyone have pointers (examples, docs, anything) on how to > - get the entire content of file as single string, and > - give a replacement string back to Apache to send to client. That's simple enough. But also very inefficient. > Background: That's more helpful. > I'm trying to write "mod_bash" where the embedded code is > shell script, The easy way to do that would be either to use CGI or to hook it in with mod_ext_filter. I think hooking bash in in the manner of mod_perl or mod_python would be a rather big job. -- Nick Kew Nick's manifesto: http://www.htmlhelp.com/~nick/ |
|
|||
|
Nick Kew <nick@hugin.webthing.com> wrote:
> In article <2jip4jF10qf6jU1@uni-berlin.de>, > William Park <opengeometry@yahoo.ca> writes: > > > Does anyone have pointers (examples, docs, anything) on how to > > - get the entire content of file as single string, and > > - give a replacement string back to Apache to send to client. > > That's simple enough. But also very inefficient. > > > > Background: > > That's more helpful. > > > I'm trying to write "mod_bash" where the embedded code is > > shell script, > > The easy way to do that would be either to use CGI or to hook it in > with mod_ext_filter. I think hooking bash in in the manner of > mod_perl or mod_python would be a rather big job. Yes, CGI (with PATH_INFO) was my first thought, but I'm looking for a way to reduce the 2-step to just one. I'll see what I can steal from mod_cgi or mod_ext_filter. My command line solution for HTML template can be found at http://freshmeat.net/projects/basp/ which I've named it Bash Active Server Pages (BASP) for now. :-) -- William Park, Open Geometry Consulting, <opengeometry@yahoo.ca> No, I will not fix your computer! I'll reformat your harddisk, though. |