httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boyle Owen" <>
Subject RE: [users@httpd] Trouble running cgi script from user directory
Date Wed, 13 Nov 2002 15:05:38 GMT
You did the right thing in checking the command line first since if it
doesn't work there, it certainly won't work under CGI. However, that is
not the full story... To execute a script, the server spawns a new
shell. This shell does *not* inherit any environment variables from the
shell which started apache, nor does it execute any .cshrc files of the
apache user or owner of the file - So, check your script doesn't need
any envs. If it does, use PassEnv or declare them explicitly (e.g.
$ENV{LD_LIBRARY_PATH} = "/something/clever";).

If it's not that, switch on ScriptLogging - see "ScriptLog" for details.
Note that this logfile must be owned by apache (not root). This will
trap the STDOUT and STDERR from the script which might illuminate


Owen Boyle

>-----Original Message-----
>Sent: Mittwoch, 13. November 2002 15:56
>Subject: [users@httpd] Trouble running cgi script from user directory
>I am having trouble with running cgi scripts out of a user directory
>(/home/john/public_html/cgi-bin).  In my error_log file I receive the
>message "Premature end of script headers".  I have seen quite a few
>postings on this subject so here is a list of things I have checked:
>- I can run the cgi script by hand without errors
>-  this same script can be run in the main cgi-bin directory without
>- the script is executable
>- the user directory has a mode of 777, then the public_html 
>directory is
>775 and the cgi-bin directory is 775.
>- In my httpd.conf file I have added the following:
><Directory /home/john/public_html/cgi-bin>
>    Options +ExecCGI
>    SetHandler cgi-script
>What am I missing?
>Thanks in advance!!
>The official User-To-User support forum of the Apache HTTP 
>Server Project.
>See <URL:> for more info.
>To unsubscribe, e-mail:
>   "   from the digest:
>For additional commands, e-mail:

This message is for the named person's use only. It may contain
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission.
If you receive this message in error, please notify the sender urgently
and then immediately delete the message and any copies of it from your
system. Please also immediately destroy any hardcopies of the message.
You must not, directly or indirectly, use, disclose, distribute, print,
or copy any part of this message if you are not the intended recipient.
The sender's company reserves the right to monitor all e-mail
communications through their networks. Any views expressed in this
message are those of the individual sender, except where the message
states otherwise and the sender is authorised to state them to be the
views of the sender's company. 

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message