You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Brock Palen <br...@umich.edu> on 2003/11/14 23:33:41 UTC

[users@httpd] Perl cgi problem on rh9 apache 2.0

first time running scripts on apache,  have im geting a 500 error.  i have set
all permitions to 755 and have been trying this script

 #!/usr/bin/perl
print "Content-type: text/html\n\n";
print "Hello, World.";

this is a virtual server running with this config

NameVirtualHost *
<VirtualHost *>
	SuexecUserGroup #501 #501
	ServerName palen.serveftp.net
	ServerAlias www.palen.serveftp.net
	DocumentRoot /var/www/html/tiki/
	ErrorLog /home/palen/logs/error_log
	CustomLog /home/palen/logs/access_log "combined"
	ScriptAlias /cgi-bin /var/www/cgi-bin
	LogLevel emerg
		<Directory "/var/www/cgi-bin">
			Options +ExecCGI
			CheckSpelling Off
			AddHandler cgi-script cgi pl
		</Directory>
	<Directory "/var/www/html/tiki/awstat">
	Options +ExecCGI
	</Directory>
</VirtualHost>

I am geting a "premature end of script headers"
Note:  most basic configuration is done with webmin, www.webmin.com
as far as i can tell most of the problems like this were from permitions, but
755 should work right?

__________________________________________________
www.palen.serveftp.net
www.umsolar.com
brockp@umich.edu




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


Re: [users@httpd] Perl cgi problem on rh9 apache 2.0

Posted by Kyle Dent <kd...@seaglass.com>.
On Sat, 15 Nov 2003, Jez Hancock wrote:

> On Sat, Nov 15, 2003 at 01:43:25AM -0500, Brock Palen wrote:
> > This did not make a differnce in the error,  The error log says ,,,, nothing
> > gota fix that, this virtual servers error log isnt showing anything?/  access
> > log is.  As for running perl at the command line,  %perl hello.pl   works just
> > fine.  so still now solution
> The logs being empty is probably because of the LogLevel setting you

> have (emerg) - try changing it to warn or debug.  Unfortunately I don't think
> it'll tell you anything more than what you know already.

I disagree. The log will tell you the stderr output from your
script. In other words, it will give you the reason your script
is not running properly. We can all keep offering guesses as to
why it might happen, but your log will tell you why it is
actually failing in this instance. You definitely want to get
your error logging working. Your can turn it off or down once you
finish troubleshooting.

Kyle


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


Re: [users@httpd] Perl cgi problem on rh9 apache 2.0

Posted by Jez Hancock <je...@munk.nu>.
On Sat, Nov 15, 2003 at 01:43:25AM -0500, Brock Palen wrote:
> This did not make a differnce in the error,  The error log says ,,,, nothing
> gota fix that, this virtual servers error log isnt showing anything?/  access
> log is.  As for running perl at the command line,  %perl hello.pl   works just
> fine.  so still now solution
The logs being empty is probably because of the LogLevel setting you
have (emerg) - try changing it to warn or debug.  Unfortunately I don't think
it'll tell you anything more than what you know already.

More often than not premature end of script errors when running perl cgi scripts
mean that the script produced an error for some reason so instead of
seeing valid headers ("Content-type: text/html"), the server sees only
the error message and complains.  If the script runs ok on the command line 
though then this isn't the problem.

-- 
Jez Hancock
 - System Administrator / PHP Developer

http://munk.nu/

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


Re: [users@httpd] Perl cgi problem on rh9 apache 2.0

Posted by bvr <bv...@xs4all.nl>.
ok, can you run it like './hello.pl' instead of 'perl hello.pl'
or try 'which perl'
in other words is the path to perl correct ?

never used suexecgroup though, have you tried without?

Brock Palen wrote:
> This did not make a differnce in the error,  The error log says ,,,, nothing
> gota fix that, this virtual servers error log isnt showing anything?/  access
> log is.  As for running perl at the command line,  %perl hello.pl   works just
> fine.  so still now solution


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


Re: [users@httpd] Perl cgi problem on rh9 apache 2.0

Posted by Brock Palen <br...@umich.edu>.
This did not make a differnce in the error,  The error log says ,,,, nothing
gota fix that, this virtual servers error log isnt showing anything?/  access
log is.  As for running perl at the command line,  %perl hello.pl   works just
fine.  so still now solution
__________________________________________________
www.palen.serveftp.net
www.umsolar.com
brockp@umich.edu


Quoting Brian Dessent <br...@dessent.net>:

> Brock Palen wrote:
> > 
> > first time running scripts on apache,  have im geting a 500 error.  i have
> set
> > all permitions to 755 and have been trying this script
> > 
> >  #!/usr/bin/perl
> > print "Content-type: text/html\n\n";
> > print "Hello, World.";
> 
> HTTP responses are terminated by \r\n, so you need \r\n\r\n where you
> have \n\n.  Yet another reason to use CGI.pm for everything...
> 
> Brian
> 
> ---------------------------------------------------------------------
> 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


Re: [users@httpd] Perl cgi problem on rh9 apache 2.0

Posted by Brian Dessent <br...@dessent.net>.
Brock Palen wrote:
> 
> first time running scripts on apache,  have im geting a 500 error.  i have set
> all permitions to 755 and have been trying this script
> 
>  #!/usr/bin/perl
> print "Content-type: text/html\n\n";
> print "Hello, World.";

HTTP responses are terminated by \r\n, so you need \r\n\r\n where you
have \n\n.  Yet another reason to use CGI.pm for everything...

Brian

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


Re: [users@httpd] Perl cgi problem on rh9 apache 2.0

Posted by Brock Palen <br...@umich.edu>.
no the origanal script was AWstats.pl for taking stats, (currently use
webalizer)  but as for the test one hello.pl  that was copied and pasted right
out of the apache 2.0 documentation page,  pasted right into emacs so not
generated at all.
__________________________________________________
www.palen.serveftp.net
www.umsolar.com
brockp@umich.edu


Quoting Jack Lauman <jl...@nwcascades.com>:

> Brock:
> 
> If you developed the script on winders and move it to RedHat
> you probably need to run 'dos2unix' against it to remove the
> <CR><LF>.  Be sure to reset permissons on the file afterwards.
> 
> In the past I've experienced the exact same error when moving
> between the two platforms.  Doing what I described above has
> always fixed it.
> 
> Jack
> 
> Brock Palen wrote:
> > 
> > ok so i didnt notice the error log level i set to low,  i now get this
> > 
> > [Sat Nov 15 16:35:33 2003] [error] [client 127.0.0.1] Premature end of
> script
> > headers: hello.pl
> > 
> > in debug,  Also yes i can run ./hello.pl at command line,  which perl did
> return
> > a differn perl exe than the one i was useing, this did not make a
> differnce
> > though.   Would it have anything to do with mod perl?
> > __________________________________________________
> > www.palen.serveftp.net
> > www.umsolar.com
> > brockp@umich.edu
> > 
> > Quoting Kyle Dent <kd...@seaglass.com>:
> > 
> > >
> > >
> > > On Fri, 14 Nov 2003, Brock Palen wrote:
> > >
> > > > nope, sory its not a space there.  So that is not it any other ideas?
> > >
> > > What does your error_log say?
> > >
> > > Kyle
> > >
> > > >
> > > > Quoting Kyle Dent <kd...@seaglass.com>:
> > > >
> > > > > On Fri, 14 Nov 2003, Brock Palen wrote:
> > > > >
> > > > > > first time running scripts on apache,  have im geting a 500 error. 
> i
> > > have
> > > > > set
> > > > > > all permitions to 755 and have been trying this script
> > > > > >
> > > > >
> > > > > >  #!/usr/bin/perl
> > > > > > print "Content-type: text/html\n\n";
> > > > > > print "Hello, World.";
> > > > >
> > > > > Do you really have a space in the first postion of the first
> > > > > line? If so, that's a problem. Otherwise, check your error_log.
> > > > > Yes, 755 is executable.
> > > > >
> > > > > Kyle
> > > > >
> > > > >
> > > > >
> ---------------------------------------------------------------------
> > > > > 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
> > >
> > >
> > 
> > ---------------------------------------------------------------------
> > 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


Re: [users@httpd] Perl cgi problem on rh9 apache 2.0

Posted by Jack Lauman <jl...@nwcascades.com>.
Brock:

If you developed the script on winders and move it to RedHat
you probably need to run 'dos2unix' against it to remove the
<CR><LF>.  Be sure to reset permissons on the file afterwards.

In the past I've experienced the exact same error when moving
between the two platforms.  Doing what I described above has
always fixed it.

Jack

Brock Palen wrote:
> 
> ok so i didnt notice the error log level i set to low,  i now get this
> 
> [Sat Nov 15 16:35:33 2003] [error] [client 127.0.0.1] Premature end of script
> headers: hello.pl
> 
> in debug,  Also yes i can run ./hello.pl at command line,  which perl did return
> a differn perl exe than the one i was useing, this did not make a differnce
> though.   Would it have anything to do with mod perl?
> __________________________________________________
> www.palen.serveftp.net
> www.umsolar.com
> brockp@umich.edu
> 
> Quoting Kyle Dent <kd...@seaglass.com>:
> 
> >
> >
> > On Fri, 14 Nov 2003, Brock Palen wrote:
> >
> > > nope, sory its not a space there.  So that is not it any other ideas?
> >
> > What does your error_log say?
> >
> > Kyle
> >
> > >
> > > Quoting Kyle Dent <kd...@seaglass.com>:
> > >
> > > > On Fri, 14 Nov 2003, Brock Palen wrote:
> > > >
> > > > > first time running scripts on apache,  have im geting a 500 error.  i
> > have
> > > > set
> > > > > all permitions to 755 and have been trying this script
> > > > >
> > > >
> > > > >  #!/usr/bin/perl
> > > > > print "Content-type: text/html\n\n";
> > > > > print "Hello, World.";
> > > >
> > > > Do you really have a space in the first postion of the first
> > > > line? If so, that's a problem. Otherwise, check your error_log.
> > > > Yes, 755 is executable.
> > > >
> > > > Kyle
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > 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
> >
> >
> 
> ---------------------------------------------------------------------
> 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


Re: [users@httpd] Perl cgi problem on rh9 apache 2.0

Posted by Jez Hancock <je...@munk.nu>.
On Sat, Nov 15, 2003 at 04:37:24PM -0500, Brock Palen wrote:
> ok so i didnt notice the error log level i set to low,  i now get this 
> 
> [Sat Nov 15 16:35:33 2003] [error] [client 127.0.0.1] Premature end of script
> headers: hello.pl
> 
> in debug,  Also yes i can run ./hello.pl at command line,  which perl did return
> a differn perl exe than the one i was useing, this did not make a differnce
> though.   Would it have anything to do with mod perl?
I would follow the advice of the other chap and remove any dodgy end of
line chars using dos2unix or vim or bc.

The hello world script looks as though it should work ok given your
originally pasted httpd.conf config and the fact that you've verified
the script works in a shell by running './hello.pl' in the directory the
hello.pl script exists.

-- 
Jez Hancock
 - System Administrator / PHP Developer

http://munk.nu/

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


Re: [users@httpd] Perl cgi problem on rh9 apache 2.0

Posted by Sebastian Wolfgarten <se...@gmx.net>.
Hi,

add a \n\n to the Content-type line and it should work.

Bye,
Seb


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


Re: [users@httpd] Perl cgi problem on rh9 apache 2.0

Posted by Brock Palen <br...@umich.edu>.
ok problem solved,  when useing mod_suexe,  if the script is not owned by the
user specified by suexe i get this error.  Once comented out the suexe
directive for that virtual server it worked,  thus then the script is ran by
the webserver s user.  on the other hand though, is why it would not run
anyway,  the script and previous directories were 755 thus anyone should be
able to ex. the script.  so im still confused but im glad figured out the
problem.  and now have the users virtual server suexe stuff worked out.  (for
when auser uplaods to there cgi-bin dir for there virtual server it is owned by
them thus suexe to run all cgi for that virtual server as the user who uploaded
it.  BALH  
Thanks guys hope you can make sence of all this,  if you have any questions
email me.  
__________________________________________________
www.palen.serveftp.net
www.umsolar.com
brockp@umich.edu


Quoting Kyle Dent <kd...@seaglass.com>:

> On Sat, 15 Nov 2003, Brock Palen wrote:
> 
> > That was a great idea i didn't think of and will be very helpfull in the
> past
> > but still worked as teh webserers user,  not running chroot'ed
> >
> > bash-2.05b$ ./hello.pl
> > Content-type: text/html
> >
> > Hello, World.bash-2.05b$
> >
> > So any more ideas?  so running in the cgi directory as teh
> > webservers user lets me know if the webserver can ex the
> > binary.
> 
> Hmm, I think you need to do some real troubleshooting. Why don't
> you try executing a CGI program that doesn't need an interpreter.
> If you have a C compiler available, here's a simple snippet of
> code:
> 
> 	#include <stdio.h>
> 
> 	int
> 	main(void)
> 	{
>         	puts("Content-type: text/plain\n");
>         	puts("Hello, World.");
>         	return(0);
> 	}
> 
> Save that to a file called something like hello.cgi.c. Then
> compile it in your CGI directory like this:
> 
> 	cc -o hello.cgi hello.cgi.c
> 
> Set it executable
> 
> 	chmod 755 hello.cgi
> 
> And try that one. If you get the same results then you should
> look very closely at your Apache config and build.
> 
> If hello.cgi works then it's something to do with executing Perl.
> If you'd like to send the results of the following, fresh eyes on
> the list could see if anything seems amiss. You can delete any
> private info from the results:
> 
> 	grep 501 /etc/passwd
> 	grep 501 /etc/group
> 	ls -l /usr/bin/perl
> 	ls -ld /usr/bin
> 	ls -ld /usr
> 	ls -ld /
> 	ls -ld /var/www
> 	ls -ld /var/www/cgi-bin
> 	/usr/bin/perl -V
> 	perl -V
> 
> Kyle
> 
> 
> ---------------------------------------------------------------------
> 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


Re: [users@httpd] Perl cgi problem on rh9 apache 2.0

Posted by Kyle Dent <kd...@seaglass.com>.
On Sat, 15 Nov 2003, Brock Palen wrote:

> That was a great idea i didn't think of and will be very helpfull in the past
> but still worked as teh webserers user,  not running chroot'ed
>
> bash-2.05b$ ./hello.pl
> Content-type: text/html
>
> Hello, World.bash-2.05b$
>
> So any more ideas?  so running in the cgi directory as teh
> webservers user lets me know if the webserver can ex the
> binary.

Hmm, I think you need to do some real troubleshooting. Why don't
you try executing a CGI program that doesn't need an interpreter.
If you have a C compiler available, here's a simple snippet of
code:

	#include <stdio.h>

	int
	main(void)
	{
        	puts("Content-type: text/plain\n");
        	puts("Hello, World.");
        	return(0);
	}

Save that to a file called something like hello.cgi.c. Then
compile it in your CGI directory like this:

	cc -o hello.cgi hello.cgi.c

Set it executable

	chmod 755 hello.cgi

And try that one. If you get the same results then you should
look very closely at your Apache config and build.

If hello.cgi works then it's something to do with executing Perl.
If you'd like to send the results of the following, fresh eyes on
the list could see if anything seems amiss. You can delete any
private info from the results:

	grep 501 /etc/passwd
	grep 501 /etc/group
	ls -l /usr/bin/perl
	ls -ld /usr/bin
	ls -ld /usr
	ls -ld /
	ls -ld /var/www
	ls -ld /var/www/cgi-bin
	/usr/bin/perl -V
	perl -V

Kyle


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


Re: [users@httpd] Perl cgi problem on rh9 apache 2.0

Posted by Brock Palen <br...@umich.edu>.
That was a great idea i didn't think of and will be very helpfull in the past
but still worked as teh webserers user,  not running chroot'ed

bash-2.05b$ ./hello.pl
Content-type: text/html
 
Hello, World.bash-2.05b$

So any more ideas?  so running in the cgi directory as teh webservers user lets
me know if the webserver can ex the binary.
__________________________________________________
www.palen.serveftp.net
www.umsolar.com
brockp@umich.edu


Quoting Kyle Dent <kd...@seaglass.com>:

> On Sat, 15 Nov 2003, Brock Palen wrote:
> 
> > ok so i didnt notice the error log level i set to low,  i now get this
> >
> > [Sat Nov 15 16:35:33 2003] [error] [client 127.0.0.1] Premature end of
> script
> > headers: hello.pl
> 
> If you don't have any other errors besides that one, then your
> Perl interpreter is not being invoked. That means there is
> something wrong with your first line
> 
> #!/usr/bin/perl
> 
> If it works for you from the command line, but not from the web
> server then it has something to do with the web server's context
> and the perl binary located at /usr/bin. Do the permissions allow
> the web server/cgi user to execute it? Does the server user have
> read access along the entire path /usr/bin? Is your web server
> running in a chroot?
> 
> One thing to try is to log in as the web user (you may have to
> temporarily assign the account a password and shell) and try to
> execute the script. This doesn't give you exactly the same
> context as the web server, but it might uncover something.
> 
> Kyle
> 
> 
> ---------------------------------------------------------------------
> 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


Re: [users@httpd] Perl cgi problem on rh9 apache 2.0

Posted by Kyle Dent <kd...@seaglass.com>.
On Sat, 15 Nov 2003, Brock Palen wrote:

> ok so i didnt notice the error log level i set to low,  i now get this
>
> [Sat Nov 15 16:35:33 2003] [error] [client 127.0.0.1] Premature end of script
> headers: hello.pl

If you don't have any other errors besides that one, then your
Perl interpreter is not being invoked. That means there is
something wrong with your first line

#!/usr/bin/perl

If it works for you from the command line, but not from the web
server then it has something to do with the web server's context
and the perl binary located at /usr/bin. Do the permissions allow
the web server/cgi user to execute it? Does the server user have
read access along the entire path /usr/bin? Is your web server
running in a chroot?

One thing to try is to log in as the web user (you may have to
temporarily assign the account a password and shell) and try to
execute the script. This doesn't give you exactly the same
context as the web server, but it might uncover something.

Kyle


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


Re: [users@httpd] Perl cgi problem on rh9 apache 2.0

Posted by Brock Palen <br...@umich.edu>.
ok so i didnt notice the error log level i set to low,  i now get this 

[Sat Nov 15 16:35:33 2003] [error] [client 127.0.0.1] Premature end of script
headers: hello.pl

in debug,  Also yes i can run ./hello.pl at command line,  which perl did return
a differn perl exe than the one i was useing, this did not make a differnce
though.   Would it have anything to do with mod perl?
__________________________________________________
www.palen.serveftp.net
www.umsolar.com
brockp@umich.edu


Quoting Kyle Dent <kd...@seaglass.com>:

> 
> 
> On Fri, 14 Nov 2003, Brock Palen wrote:
> 
> > nope, sory its not a space there.  So that is not it any other ideas?
> 
> What does your error_log say?
> 
> Kyle
> 
> >
> > Quoting Kyle Dent <kd...@seaglass.com>:
> >
> > > On Fri, 14 Nov 2003, Brock Palen wrote:
> > >
> > > > first time running scripts on apache,  have im geting a 500 error.  i
> have
> > > set
> > > > all permitions to 755 and have been trying this script
> > > >
> > >
> > > >  #!/usr/bin/perl
> > > > print "Content-type: text/html\n\n";
> > > > print "Hello, World.";
> > >
> > > Do you really have a space in the first postion of the first
> > > line? If so, that's a problem. Otherwise, check your error_log.
> > > Yes, 755 is executable.
> > >
> > > Kyle
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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
> 
> 

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


Re: [users@httpd] Perl cgi problem on rh9 apache 2.0

Posted by Kyle Dent <kd...@seaglass.com>.

On Fri, 14 Nov 2003, Brock Palen wrote:

> nope, sory its not a space there.  So that is not it any other ideas?

What does your error_log say?

Kyle

>
> Quoting Kyle Dent <kd...@seaglass.com>:
>
> > On Fri, 14 Nov 2003, Brock Palen wrote:
> >
> > > first time running scripts on apache,  have im geting a 500 error.  i have
> > set
> > > all permitions to 755 and have been trying this script
> > >
> >
> > >  #!/usr/bin/perl
> > > print "Content-type: text/html\n\n";
> > > print "Hello, World.";
> >
> > Do you really have a space in the first postion of the first
> > line? If so, that's a problem. Otherwise, check your error_log.
> > Yes, 755 is executable.
> >
> > Kyle
> >
> >
> > ---------------------------------------------------------------------
> > 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


Re: [users@httpd] Perl cgi problem on rh9 apache 2.0

Posted by Jez Hancock <je...@munk.nu>.
On Fri, Nov 14, 2003 at 07:32:53PM -0500, Brock Palen wrote:
> nope, sory its not a space there.  So that is not it any other ideas?
What happens when you run the script from the command line?


-- 
Jez Hancock
 - System Administrator / PHP Developer

http://munk.nu/

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


Re: [users@httpd] Perl cgi problem on rh9 apache 2.0

Posted by Brock Palen <br...@umich.edu>.
nope, sory its not a space there.  So that is not it any other ideas?
__________________________________________________
www.palen.serveftp.net
www.umsolar.com
brockp@umich.edu


Quoting Kyle Dent <kd...@seaglass.com>:

> On Fri, 14 Nov 2003, Brock Palen wrote:
> 
> > first time running scripts on apache,  have im geting a 500 error.  i have
> set
> > all permitions to 755 and have been trying this script
> >
> 
> >  #!/usr/bin/perl
> > print "Content-type: text/html\n\n";
> > print "Hello, World.";
> 
> Do you really have a space in the first postion of the first
> line? If so, that's a problem. Otherwise, check your error_log.
> Yes, 755 is executable.
> 
> Kyle
> 
> 
> ---------------------------------------------------------------------
> 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


Re: [users@httpd] Perl cgi problem on rh9 apache 2.0

Posted by Kyle Dent <kd...@seaglass.com>.
On Fri, 14 Nov 2003, Brock Palen wrote:

> first time running scripts on apache,  have im geting a 500 error.  i have set
> all permitions to 755 and have been trying this script
>

>  #!/usr/bin/perl
> print "Content-type: text/html\n\n";
> print "Hello, World.";

Do you really have a space in the first postion of the first
line? If so, that's a problem. Otherwise, check your error_log.
Yes, 755 is executable.

Kyle


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