Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Trouble with Perl on Apache

Reply
Thread Tools

Trouble with Perl on Apache

 
 
lhenkel@gmail.com
Guest
Posts: n/a
 
      02-06-2006
I've been at this all day and am stuck. I did SuSE (growing to hate)
online update and now cgi's don't execute. Now any script written in
perl (with .cgi or .pl extension) gets a 500 Internal Server Error
(Permission denied: exec of xx in the log). The weird thing is shell
scripts with .cgi extension (#!/bin/sh) work fine (same directory).

The perl .cgi runs fine from command prompt (./test.cgi and perl
../test.cgi) and permissions
(temporarily 777) and owners (same as httpd process) are identical.

I'm not sure what part of the httpd.conf file is relevent.. I believe
I've (temporarily) set every directory to ExecCGI.

I'd appreciate any pointers.. I don't get why shell works and not
Perl.. thanks.

 
Reply With Quote
 
 
 
 
Jadkit
Guest
Posts: n/a
 
      02-06-2006
Not sure this helps. please make sure that

1. path to perl is correct.
#!/usr/bin/perl or #!/bin/perl
2. you have the below line to tell apache that what type of content
will be displayed
print "Content-Type: text/html\n\n";
3. is it ok when run "perl test.cgi" in command line.

 
Reply With Quote
 
 
 
 
l.
Guest
Posts: n/a
 
      02-06-2006
Jadkit wrote:
> Not sure this helps. please make sure that
>
> 1. path to perl is correct.
> #!/usr/bin/perl or #!/bin/perl


> 2. you have the below line to tell apache that what type of content
> will be displayed
> print "Content-Type: text/html\n\n";


You can also use the OO form

my $q = new CGI;
print $q->header( -type => "text/html");


> 3. is it ok when run "perl test.cgi" in command line.
>


 
Reply With Quote
 
l.
Guest
Posts: n/a
 
      02-06-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> I've been at this all day and am stuck. I did SuSE (growing to hate)
> online update and now cgi's don't execute. Now any script written in
> perl (with .cgi or .pl extension) gets a 500 Internal Server Error
> (Permission denied: exec of xx in the log). The weird thing is shell
> scripts with .cgi extension (#!/bin/sh) work fine (same directory).
>
> The perl .cgi runs fine from command prompt (./test.cgi and perl
> ./test.cgi) and permissions
> (temporarily 777) and owners (same as httpd process) are identical.
>
> I'm not sure what part of the httpd.conf file is relevent.. I believe
> I've (temporarily) set every directory to ExecCGI.
>
> I'd appreciate any pointers.. I don't get why shell works and not
> Perl.. thanks.
>

FWIW I have used Suse for years and it seems a bit odd that you've lost
your Apache config on an update.

This shows the permissions on my cgi-bin directory and a couple of
scripts in that directory.

drwxr-xr-x 2 root root 368 2006-02-05 20:38 cgi-bin
-rwxr-xr-x 1 root root 143 2006-02-05 13:57 atest.pl
-r-xr-xr-x 1 root root 2565 2006-02-06 00:17 default.cgi

I am not claiming that's the best set-up but it works for me.

As another poster said, check your #! is right and then check you are
not running in a chroot jail with a bin/sh already installed there.

It looks like you also need to read up on Apache configuration to get
everything sorted. Apache config is not a Perl thing.

(You don't say what version of SuSE and Apache you are using but SuSE
9.2 shipped with Apache v2.0 which has a different config layout to v1.3
and you need to look at /etc/sysconfig/apache as well as /etc/apache. )

HTH

L.


 
Reply With Quote
 
lhenkel@gmail.com
Guest
Posts: n/a
 
      02-06-2006
Thanks for the replies.. I've been reading through the Apache docs
pretty heavily (I've also set this up several times and never run into
this). Here's the script I'm currently trying:

#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "hi there!";
exit;

It executes from command line by typing ./test.cgi and the
interpretter is where it should be..

I'm using: Apache/2.0.50 and Perl v5.8.3 Suse 9.1

BTW, I tried the OO and got the same results..

Other people suggested ASCII problems with Windows scipts executing on
Linux, but I'm typing in through my SSH shell.

I'm not doing this from the /cgi-bin/ although the scripts don't work
there either (same deal.. shell script works, Perl doesn't).

Thanks for any help!

 
Reply With Quote
 
A. Sinan Unur
Guest
Posts: n/a
 
      02-06-2006
(E-Mail Removed) wrote in news:1139258985.055787.310990
@f14g2000cwb.googlegroups.com:

> Thanks for the replies..


Please quote an appropriate amount of context when you reply.

> I've been reading through the Apache docs
> pretty heavily (I've also set this up several times and never run into
> this). Here's the script I'm currently trying:
>
> #!/usr/bin/perl
> print "Content-type: text/html\n\n";
> print "hi there!";
> exit;
>
> It executes from command line by typing ./test.cgi and the
> interpretter is where it should be..
>
> I'm using: Apache/2.0.50 and Perl v5.8.3 Suse 9.1
>
> BTW, I tried the OO and got the same results..
>
> Other people suggested ASCII problems with Windows scipts executing on
> Linux, but I'm typing in through my SSH shell.
>
> I'm not doing this from the /cgi-bin/ although the scripts don't work
> there either (same deal.. shell script works, Perl doesn't).


I do not see anything Perl related in this question. Now, if you had
actually checked the server error log, and posted the exact error
message, and if that error had anything to do with Perl, we might have
been able to help.

But, you haven't ...

Have you even looked at the error logs?

Have you seen the posting guidelines?

Sinan

--
A. Sinan Unur <(E-Mail Removed)>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/cl...uidelines.html

 
Reply With Quote
 
lhenkel@gmail.com
Guest
Posts: n/a
 
      02-06-2006
"Have you even looked at the error logs?"

- Permission denied: exec of xx in the log (see first post)

"I do not see anything Perl related"

- I am curious why shell scripts work and my Perl scripts do not. Not
sure why that's not Perl related.. thought there might be a Perl expert
who could help diagnose.

"we might have been able to help. "

- Trolls like you make me wonder why/how anyone learns Linux or Perl.

Thanks to everyone else who tried to be constructive towards newbies.
Still appreciate any other insites.

Thanks

Lee

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PERL can't open file for logging (world writable directory Windows XP Home/ Active Perl / Apache) PGPS Perl Misc 10 11-14-2006 01:40 AM
AXIS jars org.apache.axis.wsi.* and org.apache.axis.transport.jms.* unkwb@web.de Java 0 02-23-2005 04:02 PM
#!perl instead of #!/usr/bin/perl on a Unix/Apache webserver joe Perl Misc 8 11-14-2003 10:58 AM
Use perl in apache without #!/path/to/perl Kostas Hatzikokolakis Perl Misc 2 10-19-2003 03:02 AM
How to test speed difference of Perl/Apache and SSI/Apache The Poor Perl Misc 2 09-27-2003 12:26 PM



Advertisments