500 internal server error, Apache/1.3.26

500 internal server error, Apache/1.3.26

am 15.05.2003 03:37:26 von timo ochmann

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:

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/


OR (this seemed redundant, but i thought i'll give it try):


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/

AllowOverride None
Options +ExecCGI
Order allow,deny
Allow from all




------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See 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: 500 internal server error, Apache/1.3.26

am 15.05.2003 04:15:02 von Jeff Cohen

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
>=20
> 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?
>=20
> thanks!
>=20
> 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
>=20
> content of Apache's sample script 'printenv':
> #!/usr/bin/perl
> ##
> ## printenv -- demo CGI program which just prints its environment
> ##
>=20
> print "Content-type: text/plain\n\n";
> foreach $var (sort(keys(%ENV))) {
> $val =3D $ENV{$var};
> $val =3D~ s|\n|\\n|g;
> $val =3D~ s|"|\\"|g;
> print "${var}=3D\"${val}\"\n";
> }
>=20
> note:
> 'printenv' executes from command line without problems.
>=20
> 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
>=20
> httpd.conf:
>
> 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/
>

>=20
> OR (this seemed redundant, but i thought i'll give it try):
>=20
>
> 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/
>
> AllowOverride None
> Options +ExecCGI
> Order allow,deny
> Allow from all
>

>

>=20
>=20
> ------------------------------------------------------------ ---------
> The official User-To-User support forum of the Apache HTTP Server =
Project.
> See 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 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: 500 internal server error, Apache/1.3.26

am 15.05.2003 16:11:27 von timo ochmann

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.

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

>>
>> OR (this seemed redundant, but i thought i'll give it try):
>>
>>
>> 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/
>>
>> AllowOverride None
>> Options +ExecCGI
>> Order allow,deny
>> Allow from all
>>

>>

>>
>>
>> ------------------------------------------------------------ ---------
>> The official User-To-User support forum of the Apache HTTP Server
>> Project.
>> See 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 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 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: 500 internal server error, Apache/1.3.26

am 15.05.2003 17:00:28 von Boyle Owen

>-----Original Message-----
>From: timo ochmann [mailto:public@carukia.net]
>
>Thanks for your reply, but like I stated in my original post=20
>'printenv'=20
>executes just fine from the command line. There's nothing wrong with=20
>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.=20


>
>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=20
>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 =3D $ENV{$var};
>>> $val =3D~ s|\n|\\n|g;
>>> $val =3D~ s|"|\\"|g;
>>> print "${var}=3D\"${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=20
>directory: exec=20
>>> of
>>> /DOMAIN-cgi/printenv failed
>>> [Wed May 14 08:26:05 2003] [error] [client 198.238.193.254]=20
>Premature=20
>>> en
>>> d of script headers: /DOMAIN-cgi/printenv
>>>
>>> httpd.conf:
>>>
>>> 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/
>>>

>>>
>>> OR (this seemed redundant, but i thought i'll give it try):
>>>
>>>
>>> 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/
>>>
>>> AllowOverride None
>>> Options +ExecCGI
>>> Order allow,deny
>>> Allow from all
>>>

>>>

>>>
>>>
>>>=20
>----------------------------------------------------------- ----------
>>> The official User-To-User support forum of the Apache HTTP Server=20
>>> Project.
>>> See 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=20
>> Project.
>> See 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=20
>Server Project.
>See 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=E9sent e-mail est un message priv=E9 et personnel, sans rapport avec
l'activit=E9 boursi=E8re 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.=20



------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See 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: 500 internal server error, Apache/1.3.26

am 15.05.2003 17:14:24 von Maarten.Broekman

From the error message, it's trying to access /DOMAIN-cgi/printenv
Are you trying to access it as http://your.domain.com/DOMAIN-cgi/printenv
or as http://your.domain.com/cgi-bin/printenv

Without seeing the rest of the httpd.conf I'm not sure what else to check.
Things that come to mind:
Make sure your virtual host entries are in the correct order (if you have
more than one) and that you are accessing the correct one. (Easiest way to
see this is to give each virtual host different log files)
Make sure you have mod_cgi available (yes I know it's silly, but you never
know)
Make sure you are trying to access to correct path.

--Maarten


-----Original Message-----
From: timo ochmann [mailto:public@carukia.net]
Sent: Thursday, May 15, 2003 10:11 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] 500 internal server error, Apache/1.3.26


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.

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

>>
>> OR (this seemed redundant, but i thought i'll give it try):
>>
>>
>> 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/
>>
>> AllowOverride None
>> Options +ExecCGI
>> Order allow,deny
>> Allow from all
>>

>>

>>
>>
>> ------------------------------------------------------------ ---------
>> The official User-To-User support forum of the Apache HTTP Server
>> Project.
>> See 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 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 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 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: 500 internal server error, Apache/1.3.26

am 15.05.2003 22:53:58 von timo ochmann

absolutely certain - and yes, it's just one machine. i did create this=20=

'hello' script and it works fine on the CL, but not in the browser,=20
same error message. i am not using 'suexec'. i forgot to mention=20
'httpd' is running on an OBSD3.2 system. i first thought maybe it's a=20
problem with the ServerRoot being 'chroot'ed, but paths and locations=20
of files are all correct. i just don't get it.

thanks for your help!

On Thursday, May 15, 2003, at 08:00 AM, Boyle Owen wrote:

>> -----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=20
> http://www.DOMAIN.net/cgi-bin/printenv?
>
> Note that the shell which runs the command line must be on the=20
> 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=20=

> 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 =3D $ENV{$var};
>>>> $val =3D~ s|\n|\\n|g;
>>>> $val =3D~ s|"|\\"|g;
>>>> print "${var}=3D\"${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:
>>>>
>>>> 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/
>>>>

>>>>
>>>> OR (this seemed redundant, but i thought i'll give it try):
>>>>
>>>>
>>>> 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/
>>>>
>>>> AllowOverride None
>>>> Options +ExecCGI
>>>> Order allow,deny
>>>> Allow from all
>>>>

>>>>

>>>>
>>>>
>>>>
>> ------------------------------------------------------------ ---------
>>>> The official User-To-User support forum of the Apache HTTP Server
>>>> Project.
>>>> See 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 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 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=20=

> 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=E9sent e-mail est un message priv=E9 et personnel, sans rapport =
avec
> l'activit=E9 boursi=E8re 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=20
> Project.
> See 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 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: 500 internal server error, Apache/1.3.26

am 15.05.2003 22:56:48 von timo ochmann

as 'http://your.domain.com/cgi-bin/printenv'. the path seems to be
correct. what do mean by 'Make sure you have mod_cgi available'? am i
just being thick here?

thanks ... cheers.

On Thursday, May 15, 2003, at 08:14 AM, Broekman, Maarten wrote:

> From the error message, it's trying to access /DOMAIN-cgi/printenv
> Are you trying to access it as
> http://your.domain.com/DOMAIN-cgi/printenv
> or as http://your.domain.com/cgi-bin/printenv
>
> Without seeing the rest of the httpd.conf I'm not sure what else to
> check.
> Things that come to mind:
> Make sure your virtual host entries are in the correct order (if you
> have
> more than one) and that you are accessing the correct one. (Easiest
> way to
> see this is to give each virtual host different log files)
> Make sure you have mod_cgi available (yes I know it's silly, but you
> never
> know)
> Make sure you are trying to access to correct path.
>
> --Maarten
>
>
> -----Original Message-----
> From: timo ochmann [mailto:public@carukia.net]
> Sent: Thursday, May 15, 2003 10:11 AM
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] 500 internal server error, Apache/1.3.26
>
>
> 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.
>
> 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:
>>>
>>> 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/
>>>

>>>
>>> OR (this seemed redundant, but i thought i'll give it try):
>>>
>>>
>>> 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/
>>>
>>> AllowOverride None
>>> Options +ExecCGI
>>> Order allow,deny
>>> Allow from all
>>>

>>>

>>>
>>>
>>> ------------------------------------------------------------ ---------
>>> The official User-To-User support forum of the Apache HTTP Server
>>> Project.
>>> See 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 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 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 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 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: 500 internal server error, Apache/1.3.26

am 15.05.2003 23:05:42 von Joshua Slive

On Thu, 15 May 2003, timo ochmann wrote:

> absolutely certain - and yes, it's just one machine. i did create this
> 'hello' script and it works fine on the CL, but not in the browser,

You need to be more specific about "works fine on the CL" means.

Do you run "perl printenv" or do you run "./printenv". Only the latter
one represents what apache needs to do.

> same error message. i am not using 'suexec'. i forgot to mention
> 'httpd' is running on an OBSD3.2 system. i first thought maybe it's a
> problem with the ServerRoot being 'chroot'ed, but paths and locations
> of files are all correct. i just don't get it.

Ahh.. Chroot. Well then, before you test from the command line (in the
proper way listed above), you better chroot the same way that apache does.
This is almost surely either a problem with the scirpt interpreter path,
or a misconfiguration of your chroot environment causing the os not to be
able to launch perl.

Joshua.

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See 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: 500 internal server error, Apache/1.3.26

am 16.05.2003 18:33:46 von timo ochmann

i got it to work! i had to copy several folders from the /usr directory
into my ServerRoot directory.
i appreciate everybody's help!!!

On Thursday, May 15, 2003, at 02:05 PM, Joshua Slive wrote:

>
> On Thu, 15 May 2003, timo ochmann wrote:
>
>> absolutely certain - and yes, it's just one machine. i did create this
>> 'hello' script and it works fine on the CL, but not in the browser,
>
> You need to be more specific about "works fine on the CL" means.
>
> Do you run "perl printenv" or do you run "./printenv". Only the latter
> one represents what apache needs to do.
>
>> same error message. i am not using 'suexec'. i forgot to mention
>> 'httpd' is running on an OBSD3.2 system. i first thought maybe it's a
>> problem with the ServerRoot being 'chroot'ed, but paths and locations
>> of files are all correct. i just don't get it.
>
> Ahh.. Chroot. Well then, before you test from the command line (in the
> proper way listed above), you better chroot the same way that apache
> does.
> This is almost surely either a problem with the scirpt interpreter
> path,
> or a misconfiguration of your chroot environment causing the os not to
> be
> able to launch perl.
>
> Joshua.
>
> ------------------------------------------------------------ ---------
> The official User-To-User support forum of the Apache HTTP Server
> Project.
> See 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 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: 500 internal server error, Apache/1.3.26

am 17.05.2003 01:57:11 von timo ochmann

i got it running! i needed to copy perl and several lib files into
ServerRoot. chroot was the "culprit".

thanks for everyones help!!

On Thursday, May 15, 2003, at 02:05 PM, Joshua Slive wrote:

>
> On Thu, 15 May 2003, timo ochmann wrote:
>
>> absolutely certain - and yes, it's just one machine. i did create this
>> 'hello' script and it works fine on the CL, but not in the browser,
>
> You need to be more specific about "works fine on the CL" means.
>
> Do you run "perl printenv" or do you run "./printenv". Only the latter
> one represents what apache needs to do.
>
>> same error message. i am not using 'suexec'. i forgot to mention
>> 'httpd' is running on an OBSD3.2 system. i first thought maybe it's a
>> problem with the ServerRoot being 'chroot'ed, but paths and locations
>> of files are all correct. i just don't get it.
>
> Ahh.. Chroot. Well then, before you test from the command line (in the
> proper way listed above), you better chroot the same way that apache
> does.
> This is almost surely either a problem with the scirpt interpreter
> path,
> or a misconfiguration of your chroot environment causing the os not to
> be
> able to launch perl.
>
> Joshua.
>
> ------------------------------------------------------------ ---------
> The official User-To-User support forum of the Apache HTTP Server
> Project.
> See 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 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