Mod_perl help

Problems with the Linux version of XAMPP, questions, comments, and anything related.

Mod_perl help

Postby the2baddavid » 08. July 2012 22:22

howdy everyone,

i installed the newest version of xampp this week (1.7.7) on Linux Mint 13. Well, since I recently learned perl, I was hoping to try out mod_perl. However, i really am not sure what else to do now.

the printenv script in the cgi-bin folder runs, however when i try to run a hello world script i get a 403 error. however, the folder and files permissions for everything in the lampp has the owner as nobody:root with 755.

Any help would be greatly appreciated.

-David
the2baddavid
 
Posts: 3
Joined: 08. July 2012 22:13
XAMPP Version: 5.6.3
Operating System: Linux Mint 13

Re: Mod_perl help

Postby JonB » 09. July 2012 14:51

what did you name your script?

Did you run printenv from the command line or in a browser?
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
XAMPP Version: 1.8.3-2
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Mod_perl help

Postby the2baddavid » 09. July 2012 18:58

JonB wrote:what did you name your script?

Did you run printenv from the command line or in a browser?

i named the script hello.pl and called both of them from the browser
the2baddavid
 
Posts: 3
Joined: 08. July 2012 22:13
XAMPP Version: 5.6.3
Operating System: Linux Mint 13

Re: Mod_perl help

Postby JonB » 09. July 2012 20:19

A. - Did you make your script executable?

to make a file executable:

as root (or sudo)

# chmod +x your-file.pl

B. - Check in

/opt/lampp/etc/extra/httpd-xampp.conf

make sure lines 41-46 are not commented out.

C. - Just a BTW, use an editor to look at test-cgi - its a shell script, printenv uses a shebang that points to perl, so neither is a really good test of mod_perl. The fact that they run only indicates that the server is set up for CGI correctly. My forum software doesn't use mod_perl, so I can't test that aspect, they run correctly with a shebang line. (at least right now)

Upon some reflection, I think LAMPP will fail standard mod_perl tests, as LAMPP is NOT a stack, but a self-contained bash script, and I don't think that mod_perl will be found in the %ENV server environment variables. You can definitely run your Perl scripts via a standard shebang line... (I have several LAMPP servers with Perl driven forums and blogs.)

Last update - you can easily check if mod_perl is running by forcing an error 404 (go to a page that deosn't exist)- and examining the Server Signature
localhost
Mon 09 Jul 2012 05:07:22 PM EDT
Apache/2.2.21 (Unix) DAV/2 mod_ssl/2.2.21 OpenSSL/1.0.0c PHP/5.3.8 mod_apreq2-20090110/2.7.1 mod_perl/2.0.5 Perl/v5.10.1

The best page I could find to explain things:
http://perl.apache.org/docs/2.0/user/in ... _fast.html

Good Luck
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
XAMPP Version: 1.8.3-2
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Mod_perl help

Postby the2baddavid » 13. July 2012 17:48

A - yes it is excetable, i set the mode to 755

B - no, i uncommented them, which were the lines for demo mod_perl responsehandler and apache current time. when i did that though, and restarted it made apache not want to start. after re adding the comments it now starts.

C - Ok so mod_perl is at least running ( i pulled the 404 )
localhost
Fri 13 Jul 2012 12:44:16 PM EDT
Apache/2.2.21 (Unix) DAV/2 mod_ssl/2.2.21 OpenSSL/1.0.0c PHP/5.3.8 mod_apreq2-20090110/2.7.1 mod_perl/2.0.5 Perl/v5.10.1

As for the shebang, i have it set in my script despite that it has the pl extension

#!/usr/bin/perl
print "hello cgi!";

#End Script

Actually, would runningperl from the /usr/ directory be what is causing the 403?

Lastly, I tried following that tutorial and the one from the mod_perl book published by oreilly and neither were successful for me. However I attributed it to using Linux Mint 13 which might have some conflicting packages, which is why I resolved to try out LAMPP and see what happened. :/
the2baddavid
 
Posts: 3
Joined: 08. July 2012 22:13
XAMPP Version: 5.6.3
Operating System: Linux Mint 13

Re: Mod_perl help

Postby JonB » 15. July 2012 18:28

You should point to the Perl that is included with LAMPP - /opt/lampp/bin/perl

I 'believe' for mod_perl to be used properly you have to use (include) its methods in your code.

Read this page and good luck with Mod_perl. Let me know how it goes.

http://perl.apache.org/docs/1.0/guide/config.html

Good luck
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
XAMPP Version: 1.8.3-2
Operating System: Windows XP/7 - Fedora 15 1.7.7


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 5 guests