You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Alex Blundell (aj)" <al...@btinternet.com> on 2002/02/12 10:06:46 UTC

Re: 500 internal server error

 Hi, I have set up my server and I thought everything was ok within apache
until I tried to upload a cgi script.

I use newspro and this works fine.
But I have tried about 4 different image scripts and i allways get an error
500 returned.

http://www.aj2k.net/cgi-bin/image.cgi

and I also get the same with another version of the script

http://www.aj2k.net/cgi-bin/image.pl

Internal Server Error

I have checked my error logs and it says :

[Tue Feb 12 03:39:10 2002] [error] (2)No such file or directory: exec of
/home/aj/public_html/cgi-bin/image.cgi failed
[Tue Feb 12 03:39:10 2002] [error] [client 213.1.135.xx] Premature end of
script headers: /home/aj/public_html/cgi-bin/image.cgi
[Tue Feb 12 03:39:27 2002] [error] (13)Permission denied: exec of
/home/aj/public_html/cgi-bin/image.pl failed
[Tue Feb 12 03:39:27 2002] [error] [client 213.1.135.xx] Premature end of
script headers: /home/aj/public_html/cgi-bin/image.pl

Please could someone shed some light on this for me??

Thanks Alex


---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org


Re: 500 internal server error

Posted by Hasanuddin Tamir <sa...@trabas.com>.
On Tue, 12 Feb 2002, Owen Boyle <ob...@bourse.ch> wrote,

> "Alex Blundell (aj)" wrote:
> >
> > Thanks fisrt the image.cgi was set to #!/usr/local/bin/perl when infact it
> > should have been #!/usr/bin/perl and the image.pl was only chmod 644. .. I
> > cant beleive I didnt check that :)
> >
> > Is there any reason why most scripts are #!/usr/local/bin/perl and my
> > configuration is #!/usr/bin/perl ?
>
> Traditionally, /usr/local/bin is for dodgy, third-party software that
> you download off the web. /usr/bin is for tried and tested programs and
> utilities that come with your OS distribution.
>
> Originally, perl was dodgy third-party etc... so usually was installed
> in /usr/local/bin (that's still its default install path). Nowadays,
> perl is tried and tested and most Unix distributors bundle a version
> with their OS and so put it in /usr/bin.

All softwares built in GNU style (autoconf, automake, etc) come with
/usr/local as the default path (apache is not an exception). The OS
distributions usually set the path to /usr. So if you install software
outside of distribution package, you have option to install it in /usr or
stick with the default.


-- 
san->http(www.trabas.com)



---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org


Re: 500 internal server error

Posted by Alex Dyas <ad...@twowaytv.co.uk>.
On Tue, 12 Feb 2002, Owen Boyle wrote:
> "Alex Blundell (aj)" wrote:
> >
> > OK so if i were to get perl off the web and install it .. could I install it
> > to /usr/local/bin/perl so that I could update it and keep people from
> > changiong the path to perl all the time?
>
> Sure. Read the INSTALL file carefully to see where it plans to install
> itself (/usr/local or /opt apparently) and change it if you like. Then
> you can keep this one up-to-date and add CPAN modules and stuff.
>
> If I were you, I'd leave your /usr/bin/perl well alone (I wouldn't even
> update it). This is because it may be used by several utilities that
> came with your OS and they might barf if it gets screwed up.

i try not to use symlinks often, but this is one case where they can come
in very useful.

alex..


---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org


Re: 500 internal server error

Posted by jon <jo...@divisionbyzero.com>.
On Sun, 2002-02-17 at 11:43, Alex Blundell (aj) wrote:
> Hi i want to install perl int a different place but so far all ive found on
> "how-to" is installing modules and not perl itself

do this in the perl source directory:

./configure.gnu --prefix=/your/directory/here

-jon

-- 
jon@divisionbyzero.com || www.divisionbyzero.com
gpg key: www.divisionbyzero.com/pubkey.asc
think i have a virus? www.divisionbyzero.com/pgp.html
"You are in a twisty little maze of Sendmail rules, all confusing." 

Re: 500 internal server error

Posted by "Alex Blundell (aj)" <al...@btinternet.com>.
Hi i want to install perl int a different place but so far all ive found on
"how-to" is installing modules and not perl itself

i was hoping someone could help me further.
thanks

----- Original Message -----
From: "Owen Boyle" <ob...@bourse.ch>
To: <us...@httpd.apache.org>
Sent: Tuesday, February 12, 2002 9:52 AM
Subject: Re: 500 internal server error


> "Alex Blundell (aj)" wrote:
> >
> > OK so if i were to get perl off the web and install it .. could I
install it
> > to /usr/local/bin/perl so that I could update it and keep people from
> > changiong the path to perl all the time?
>
> Sure. Read the INSTALL file carefully to see where it plans to install
> itself (/usr/local or /opt apparently) and change it if you like. Then
> you can keep this one up-to-date and add CPAN modules and stuff.
>
> If I were you, I'd leave your /usr/bin/perl well alone (I wouldn't even
> update it). This is because it may be used by several utilities that
> came with your OS and they might barf if it gets screwed up.
>
> Rgds,
>
> Owen Boyle.
>
> ---------------------------------------------------------------------
> 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
> 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
For additional commands, e-mail: users-help@httpd.apache.org


Re: 500 internal server error

Posted by Owen Boyle <ob...@bourse.ch>.
"Alex Blundell (aj)" wrote:
> 
> OK so if i were to get perl off the web and install it .. could I install it
> to /usr/local/bin/perl so that I could update it and keep people from
> changiong the path to perl all the time?

Sure. Read the INSTALL file carefully to see where it plans to install
itself (/usr/local or /opt apparently) and change it if you like. Then
you can keep this one up-to-date and add CPAN modules and stuff.

If I were you, I'd leave your /usr/bin/perl well alone (I wouldn't even
update it). This is because it may be used by several utilities that
came with your OS and they might barf if it gets screwed up. 

Rgds,

Owen Boyle.

---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org


Re: 500 internal server error

Posted by "Alex Blundell (aj)" <al...@btinternet.com>.
OK so if i were to get perl off the web and install it .. could I install it
to /usr/local/bin/perl so that I could update it and keep people from
changiong the path to perl all the time?

----- Original Message -----
From: "Owen Boyle" <ob...@bourse.ch>
To: <us...@httpd.apache.org>
Sent: Tuesday, February 12, 2002 9:33 AM
Subject: Re: 500 internal server error


> "Alex Blundell (aj)" wrote:
> >
> > Thanks fisrt the image.cgi was set to #!/usr/local/bin/perl when infact
it
> > should have been #!/usr/bin/perl and the image.pl was only chmod 644. ..
I
> > cant beleive I didnt check that :)
> >
> > Is there any reason why most scripts are #!/usr/local/bin/perl and my
> > configuration is #!/usr/bin/perl ?
>
> Traditionally, /usr/local/bin is for dodgy, third-party software that
> you download off the web. /usr/bin is for tried and tested programs and
> utilities that come with your OS distribution.
>
> Originally, perl was dodgy third-party etc... so usually was installed
> in /usr/local/bin (that's still its default install path). Nowadays,
> perl is tried and tested and most Unix distributors bundle a version
> with their OS and so put it in /usr/bin.
>
> I'd say your /usr/bin/perl came with your OS - nothing wrong with it,
> it's probably just a bit light on modules and will be a bit out-of-date
> by now.
>
> Personally, I keep two versions - the "official OS" /usr/bin/perl which
> is used by many other system tools, I leave unaltered and never add
> modules etc. to it. This is usually a bit ancient (since it came with
> Solaris - it's version 5.005_03). I then have an up-to-date, off-the-web
> version (currently 5.6.0) which I keep in /home/perl/bin/perl. To this,
> I add any modules I need or fancy and generally use this one for CGIs,
> cronjobs and general programs.
>
> Rgds,
>
> Owen Boyle.
>
> ---------------------------------------------------------------------
> 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
> 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
For additional commands, e-mail: users-help@httpd.apache.org


Re: 500 internal server error

Posted by Owen Boyle <ob...@bourse.ch>.
"Alex Blundell (aj)" wrote:
> 
> Thanks fisrt the image.cgi was set to #!/usr/local/bin/perl when infact it
> should have been #!/usr/bin/perl and the image.pl was only chmod 644. .. I
> cant beleive I didnt check that :)
> 
> Is there any reason why most scripts are #!/usr/local/bin/perl and my
> configuration is #!/usr/bin/perl ?

Traditionally, /usr/local/bin is for dodgy, third-party software that
you download off the web. /usr/bin is for tried and tested programs and
utilities that come with your OS distribution. 

Originally, perl was dodgy third-party etc... so usually was installed
in /usr/local/bin (that's still its default install path). Nowadays,
perl is tried and tested and most Unix distributors bundle a version
with their OS and so put it in /usr/bin.

I'd say your /usr/bin/perl came with your OS - nothing wrong with it,
it's probably just a bit light on modules and will be a bit out-of-date
by now.

Personally, I keep two versions - the "official OS" /usr/bin/perl which
is used by many other system tools, I leave unaltered and never add
modules etc. to it. This is usually a bit ancient (since it came with
Solaris - it's version 5.005_03). I then have an up-to-date, off-the-web
version (currently 5.6.0) which I keep in /home/perl/bin/perl. To this,
I add any modules I need or fancy and generally use this one for CGIs,
cronjobs and general programs. 

Rgds,

Owen Boyle.

---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org


Re: 500 internal server error

Posted by "Alex Blundell (aj)" <al...@btinternet.com>.
Thanks fisrt the image.cgi was set to #!/usr/local/bin/perl when infact it
should have been #!/usr/bin/perl and the image.pl was only chmod 644. .. I
cant beleive I didnt check that :)


Is there any reason why most scripts are #!/usr/local/bin/perl and my
configuration is #!/usr/bin/perl ?

Thanks .. I cant beleive i didnt check that :)

----- Original Message -----
From: "Owen Boyle" <ob...@bourse.ch>
To: <us...@httpd.apache.org>
Sent: Tuesday, February 12, 2002 9:10 AM
Subject: Re: 500 internal server error


> "Alex Blundell (aj)" wrote:
> >
> >  Hi, I have set up my server and I thought everything was ok within
apache
> > until I tried to upload a cgi script.
>
> I presume you mean "execute a cgi script"... "upload" just means copying
> it onto the server - did you manage to do this?
>
> >
> > I use newspro and this works fine.
>
> No idea what "newspro" is..
>
> > But I have tried about 4 different image scripts and i allways get an
error
> > 500 returned.
> > http://www.aj2k.net/cgi-bin/image.cgi
> > and I also get the same with another version of the script
> > http://www.aj2k.net/cgi-bin/image.pl
> >
> > Internal Server Error
> >
> > I have checked my error logs and it says :
> > [Tue Feb 12 03:39:10 2002] [error] (2)No such file or directory: exec of
> > /home/aj/public_html/cgi-bin/image.cgi failed
>
> This message means that there is no such file as
> /home/aj/public_html/cgi-bin/image.cgi, or, the shebang line which
> defines the script interpreter is wrong (e.g. #!/usr/bin/perl when it
> should be #!/usr/local/bin/perl).
>
> > [Tue Feb 12 03:39:10 2002] [error] [client 213.1.135.xx] Premature end
of
> > script headers: /home/aj/public_html/cgi-bin/image.cgi
> > [Tue Feb 12 03:39:27 2002] [error] (13)Permission denied: exec of
> > /home/aj/public_html/cgi-bin/image.pl failed
>
> This means that the script does not have execute permission set ("chmod
> +x image.pl" to fix), or, this directory is not enabled for CGI (Options
> ExecCGI in httpd.conf for this directory to fix).
>
> > [Tue Feb 12 03:39:27 2002] [error] [client 213.1.135.xx] Premature end
of
> > script headers: /home/aj/public_html/cgi-bin/image.pl
>
> To debug further, try executing the scripts on the server from the
> commmand-line. They must work flawlessly there before you have any
> chance.
>
> There are a lot of things to get right before CGIs will work - read the
> docs for more details, but a brief list is:
>
> - prog is executable
> - directory allows CGI
> - prog produces proper CGI header before any other output
> - prog has to work form command-line on server
> - prog has to work as apache User on server (not same as previous!)
>
> Rgds,
>
> Owen Boyle.
>
> ---------------------------------------------------------------------
> 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
> 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
For additional commands, e-mail: users-help@httpd.apache.org


Re: 500 internal server error

Posted by Owen Boyle <ob...@bourse.ch>.
"Alex Blundell (aj)" wrote:
> 
>  Hi, I have set up my server and I thought everything was ok within apache
> until I tried to upload a cgi script.

I presume you mean "execute a cgi script"... "upload" just means copying
it onto the server - did you manage to do this?

> 
> I use newspro and this works fine.

No idea what "newspro" is..

> But I have tried about 4 different image scripts and i allways get an error
> 500 returned.
> http://www.aj2k.net/cgi-bin/image.cgi
> and I also get the same with another version of the script
> http://www.aj2k.net/cgi-bin/image.pl
> 
> Internal Server Error
> 
> I have checked my error logs and it says :
> [Tue Feb 12 03:39:10 2002] [error] (2)No such file or directory: exec of
> /home/aj/public_html/cgi-bin/image.cgi failed

This message means that there is no such file as
/home/aj/public_html/cgi-bin/image.cgi, or, the shebang line which
defines the script interpreter is wrong (e.g. #!/usr/bin/perl when it
should be #!/usr/local/bin/perl).

> [Tue Feb 12 03:39:10 2002] [error] [client 213.1.135.xx] Premature end of
> script headers: /home/aj/public_html/cgi-bin/image.cgi
> [Tue Feb 12 03:39:27 2002] [error] (13)Permission denied: exec of
> /home/aj/public_html/cgi-bin/image.pl failed

This means that the script does not have execute permission set ("chmod
+x image.pl" to fix), or, this directory is not enabled for CGI (Options
ExecCGI in httpd.conf for this directory to fix).

> [Tue Feb 12 03:39:27 2002] [error] [client 213.1.135.xx] Premature end of
> script headers: /home/aj/public_html/cgi-bin/image.pl

To debug further, try executing the scripts on the server from the
commmand-line. They must work flawlessly there before you have any
chance. 

There are a lot of things to get right before CGIs will work - read the
docs for more details, but a brief list is:

- prog is executable
- directory allows CGI
- prog produces proper CGI header before any other output
- prog has to work form command-line on server
- prog has to work as apache User on server (not same as previous!)

Rgds,

Owen Boyle.

---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org