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] 500 internal server error, Apache/1.3.26
Date Thu, 15 May 2003 15:00:28 GMT
>-----Original Message-----
>From: timo ochmann [mailto:public@carukia.net]
>
>Thanks for your reply, but like I stated in my original post 
>'printenv' 
>executes just fine from the command line. There's nothing wrong with 
>the perl path.

The particular error you quoted is characteristic of a faulty
interpreter path... You are certain that same file works on the command
line and fails when invoked with http://www.DOMAIN.net/cgi-bin/printenv?

Note that the shell which runs the command line must be on the webserver
(if you have a distributed environment and log in on one machine and
mount /var/www/DOMAIN-cgi from the web server then obviously /usr/bin
would exist locally and not on the server). But maybe you just have one
machine?

Other ideas:

Delete and retype (in vi) the shebang line - invisible control
characters have been know to screw this up...

Try a trivial hello_world.pl (i.e. print "Content-type:
text/html\n\nHello world";) Does that work for the CL? in the browser?

Activate ScriptLogging to trap output from the program (although this is
unlikely to show you much - but it might be useful for later debugging
of a more complex program).

Are you using suexec? There have been a rash of problems lately with
people unwittingly using a broken suexec configuration...

Rgds,
Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored. 


>
>On Wednesday, May 14, 2003, at 07:15  PM, Jeff Cohen wrote:
>
>> Check the first line:
>> #!/usr/bin/perl
>> Maybe you have the perl executable somewhere else.
>>
>> All the best,
>> Jeff Cohen
>> Jeff@GEJ-IT.com
>> Tel. (416) 917-2324
>> www.GEJ-IT.com
>> GEJ-IT Networks!
>>
>>> -----Original Message-----
>>> From: timo ochmann [mailto:public@carukia.net]
>>> Sent: Wednesday, May 14, 2003 9:37 PM
>>> To: users@httpd.apache.org
>>> Subject: [users@httpd] 500 internal server error, Apache/1.3.26
>>>
>>> i am encountering an '500 internal server error' under 
>Apache/1.3.26.
>>> httpd runs as user 'www'. i've included paths, the script, error log
>>> and httpd.conf entries below. could someone please take a look?
>>> what am i missing here?
>>>
>>> thanks!
>>>
>>> path to cgi bin and executable:
>>> /var/www
>>> drwxr-xr-x  3 root  daemon   512 May 14 07:33 DOMAIN-cgi
>>> /var/www/DOMAIN-cgi
>>> -rwxr-xr-x  1 root  bin     268 Oct 28  2002 printenv
>>>
>>> content of Apache's sample script 'printenv':
>>> #!/usr/bin/perl
>>> ##
>>> ##  printenv -- demo CGI program which just prints its environment
>>> ##
>>>
>>> print "Content-type: text/plain\n\n";
>>> foreach $var (sort(keys(%ENV))) {
>>>      $val = $ENV{$var};
>>>      $val =~ s|\n|\\n|g;
>>>      $val =~ s|"|\\"|g;
>>>      print "${var}=\"${val}\"\n";
>>> }
>>>
>>> note:
>>> 'printenv' executes from command line without problems.
>>>
>>> error log:
>>> [Wed May 14 08:26:05 2003] [error] (2)No such file or 
>directory: exec 
>>> of
>>>   /DOMAIN-cgi/printenv failed
>>> [Wed May 14 08:26:05 2003] [error] [client 198.238.193.254] 
>Premature 
>>> en
>>> d of script headers: /DOMAIN-cgi/printenv
>>>
>>> httpd.conf:
>>> <VirtualHost www.DOMAIN.net>
>>>      DocumentRoot /var/www/www-html/DOMAIN.net
>>>      ServerName www.DOMAIN.net
>>>      ErrorLog /var/www/logs/www.DOMAIN.net-error_log
>>>      CustomLog /var/www/logs/www.DOMAIN.net-access_log common
>>>      ScriptAlias /cgi-bin/ /var/www/DOMAIN-cgi/
>>> </VirtualHost>
>>>
>>> OR (this seemed redundant, but i thought i'll give it try):
>>>
>>> <VirtualHost DOMAIN.net>
>>>      DocumentRoot /var/www/www-html/DOMAIN.net
>>>      ServerName DOMAIN.net
>>>      ErrorLog /var/www/logs/www.DOMAIN.net-error_log
>>>      CustomLog /var/www/logs/www.DOMAIN.net-access_log common
>>>      ScriptAlias /cgi-bin/ /var/www/DOMAIN-cgi/
>>>      <Directory "/var/www/DOMAIN-cgi">
>>>         AllowOverride None
>>>         Options +ExecCGI
>>>         Order allow,deny
>>>         Allow from all
>>>      </Directory>
>>> </VirtualHost>
>>>
>>>
>>> 
>---------------------------------------------------------------------
>>> 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
>>
>>
>> ---------------------------------------------------------------------
>> 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
>>
>
>
>---------------------------------------------------------------------
>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
>
>
Diese E-mail ist eine private und persönliche Kommunikation. Sie hat
keinen Bezug zur Börsen- bzw. Geschäftstätigkeit der SWX Swiss Exchange.
This e-mail is of a private and personal nature. It is not related to
the exchange or business activities of the SWX Swiss Exchange. Le
présent e-mail est un message privé et personnel, sans rapport avec
l'activité boursière de la SWX Swiss Exchange

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