You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Joshua Slive <jo...@slive.ca> on 2007/10/04 05:05:42 UTC
Re: [users@httpd] snooping on cgi data
On 10/3/07, Eric S. Johansson <es...@harvee.org> wrote:
> are there any tools/techniques for snooping on the data sent to and from a cgi
> program? I'm thinking something like wireshark for webservers.
I think you should be more specific about what you are trying to
accomplish. You can try the ScriptLog directive, but really the info
sent to and from CGI scripts is almost identical to the info sent to
and from the http server itself. There is only a little header
manipulation and some environment variables set.
Joshua.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Re: snooping on cgi data
Posted by Nick Kew <ni...@webthing.com>.
On Thu, 04 Oct 2007 10:47:31 -0400
"Eric S. Johansson" <es...@harvee.org> wrote:
> So, unless you have a different suggestion, I believe some method of
> looking at the data streams to and from the CGI would be what I need.
cg-eye might help with that. It's a test kit that emulates CGI
and produces diagnostic information. So if you can reproduce
your error while running under cg-eye, you probably have it.
(it's at valet.webthing.com or www.htmlhelp.com)
--
Nick Kew
Application Development with Apache - the Apache Modules Book
http://www.apachetutor.org/
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
[users@httpd] Re: snooping on cgi data
Posted by "Eric S. Johansson" <es...@harvee.org>.
Joshua Slive wrote:
> As I said, there is the ScriptLog.
that worked. I posted in another note that I wasn't able to get it to work.
Then I reread the documentation and saw that it was very sensitive to
permissions and when I redirected the log file to /tmp, I got the output I
needed. Thank you for the pointer.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Re: snooping on cgi data
Posted by Joshua Slive <jo...@slive.ca>.
On 10/4/07, Eric S. Johansson <es...@harvee.org> wrote:
> Joshua Slive wrote:
> > On 10/3/07, Eric S. Johansson <es...@harvee.org> wrote:
> >> are there any tools/techniques for snooping on the data sent to and from a cgi
> >> program? I'm thinking something like wireshark for webservers.
> >
> > I think you should be more specific about what you are trying to
> > accomplish. You can try the ScriptLog directive, but really the info
> > sent to and from CGI scripts is almost identical to the info sent to
> > and from the http server itself. There is only a little header
> > manipulation and some environment variables set.
>
> What I'm specifically trying to accomplish is what I said. I want to be able to
> snoop on the data stream to and from a CGI program. What's driving me in this
> direction is that I occasionally get errors in the output of the CGI in which
> causes the Web server to throw up a 500 message and put totally useless debug
> information into the error log. If I can look at the stream, I can usually
> determine the source of the problem and a fix much more quickly than I can with
> any other technique. For example, right now I have an errant print statement
> somewhere in my code. I'm having to go through all the print statements listed
> and tried to determine which one is the message getting in the way. If I can
> look at the Stream, I would be able to find the text Apache strips out before
> dumping to the error log and home in on the message location.
>
> So, unless you have a different suggestion, I believe some method of looking at
> the data streams to and from the CGI would be what I need.
As I said, there is the ScriptLog.
But if you're getting usage stuff in the error log with 500 messages,
it's because your cgi script is writing useless debugging info to
stderr.
Also, what "data stream" is going to and from the CGI depends on the
specifics of how you are using the interface. In the basic case of
GET, most data is passed in environment variables, so there is no
"stream" as such.
Joshua.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
[users@httpd] Re: snooping on cgi data
Posted by "Eric S. Johansson" <es...@harvee.org>.
Joshua Slive wrote:
> On 10/3/07, Eric S. Johansson <es...@harvee.org> wrote:
>> are there any tools/techniques for snooping on the data sent to and from a cgi
>> program? I'm thinking something like wireshark for webservers.
>
> I think you should be more specific about what you are trying to
> accomplish. You can try the ScriptLog directive, but really the info
> sent to and from CGI scripts is almost identical to the info sent to
> and from the http server itself. There is only a little header
> manipulation and some environment variables set.
What I'm specifically trying to accomplish is what I said. I want to be able to
snoop on the data stream to and from a CGI program. What's driving me in this
direction is that I occasionally get errors in the output of the CGI in which
causes the Web server to throw up a 500 message and put totally useless debug
information into the error log. If I can look at the stream, I can usually
determine the source of the problem and a fix much more quickly than I can with
any other technique. For example, right now I have an errant print statement
somewhere in my code. I'm having to go through all the print statements listed
and tried to determine which one is the message getting in the way. If I can
look at the Stream, I would be able to find the text Apache strips out before
dumping to the error log and home in on the message location.
So, unless you have a different suggestion, I believe some method of looking at
the data streams to and from the CGI would be what I need.
---eric
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org