httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boyle Owen" <Owen.Bo...@swx.com>
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
things..

Rgds,

Owen Boyle

>-----Original Message-----
>From: Rebecca.R.Hepper@seagate.com 
>[mailto:Rebecca.R.Hepper@seagate.com]
>Sent: Mittwoch, 13. November 2002 15:56
>To: users@httpd.apache.org
>Subject: [users@httpd] Trouble running cgi script from user directory
>
>
>Hello,
>
>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
>problems
>- 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
></Directory>
>
>What am I missing?
>
>Thanks in advance!!
>
>
>---------------------------------------------------------------------
>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
>
>

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: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


Mime
View raw message