Mod Debug is designed to help with the CGI programming and debugging process. While programming a CGI script, it is often rather difficult to discover what is actually getting returned to the web server. Rather than chopping up your CGI script with a whole bunch of debug print statements, a single change to the action statement of the calling form will bring up a nicely formatted page with all of the information that the web server sees, including any get and post arguments, and the send and recieve headers.
You can get it from either here via the web or here via ftp.
You are pretty much free to use it as you please. Check out the License file with the distribution for more details. In all likelihood I will switch to either GNU or Apache style licensing at some point in the future.
Send email to cgidebug@tangent.org.
Send email to cgidebug@tangent.org.
Not yet. If you have any bug reports or requests for features, please send email to us at cgidebug@tangent.org
.From the INSTALL file:
Do you use DSO? If so just type make and
as long as apxs is in your path all things
should go smoothly.
If you are not using DSO you should be :)
If for some reason you need to compile apache try the following:
1. Change the current directory to the directory containing your apache source distribution.
2. Call the configure script as you normally would and add the switch:
--add-module=<path-to-mod_cgi_debug-directory>/mod_cgi_debug.c
3. Make sure the build environment is clean by issuing the following
command:
> make clean
4. Build the new httpd binary with:
> make
5. Install the new httpd binary with:
> make install
Once you have mod_cgi_debug set up and going, it's time to modify the httpd.conf file to use it. Add a line that says:
AddHandler cgi_debug .envRestart Apache, and any URL directed to the server with a .env extension will get passed to mod_cgi_debug.
Now is the fun part- take any HTML form (or CGI that generates a form), and tack
a '.env' on the end of the name of the CGI that is processing the form. Pull up a
web browser, fill in the form, press 'submit', and see what the server sees!
All of the directives above customize the appearance of the cgi_debug page, and
change what information is displayed. The CGIDebugKeyColor and CGIDebugValueColor
directives both take a string containing a color in hexidecimal format. (i.e. "#FFFFFF").
The others are simply On or Off.
Yes!. Not a problem, but none of the content from a POST based request will be displayed (ok, this is not entirely true... anything that was an argument to the URI will be displayed but until Apache 2.1 comes out there is nothing we can do about data sent to STDIN. To dink with that would require us to do something like mod_ssl which would mean compiling into Apache... that would be a mess). For it to work you need to tell mod_cgi to handle the content type. For this to work you would need use "CGIDebugHandler cgi-script" or for mod_perl "CGIDebugHandler perl-script". For PHP you would need to use its handler types. To enable different sections to be display add to your URI arguments "_DEBUG=headsersin". The different values that are supported currently are: