LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   How to run perl scripts outside cgi-bin? (https://www.linuxquestions.org/questions/linux-server-73/how-to-run-perl-scripts-outside-cgi-bin-545464/)

xpucto 04-12-2007 11:07 AM

How to run perl scripts outside cgi-bin?
 
Hi!
I would like to run perl scripts outside my cgi-bin (if you ask why, have a look at my other thread).
so I put my scripts under
Quote:

/var/www/wikicalc
in httpd.conf I added:
Quote:

Alias /wikicalc /var/www/wikicalc

<Directory /var/www/wikicakc*>
<IfModule mod_perl.c>
<Files *.pl> # requires mod_perl
SetHandler perl-script
PerlResponseHandler ModPerl::PerlRun
PerlOptions +ParseHeaders
Options -Indexes +ExecCGI
</Files>
</IfModule>
Options +ExecCGI
AddHandler cgi-script .pl
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "now plus 0 seconds"
</IfModule>
</Directory>
and
Quote:

# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
AddHandler cgi-script .cgi
but it doesnt work. I try to run the perl script, the browser just shows me the code but doent run it. What did I forget?

forrestt 04-12-2007 11:57 AM

If you cut and pasted this from your conf file, then at least one problem is that you have wikicakc instead of wicicalc in your Directory definition.

xpucto 04-18-2007 05:04 AM

Quote:

Originally Posted by forrestt
If you cut and pasted this from your conf file, then at least one problem is that you have wikicakc instead of wicicalc in your Directory definition.

thanks. I corrected it. now its being compiled and I getting an Internal Server Error. I looked in error_logs and found this:
Quote:

[Wed Apr 18 10:23:17 2007] [error] Can't locate WKC.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 . /etc/httpd) at /var/www/wikicalc/wikicalccgi.pl line 23.\nBEGIN failed--compilation aborted at /var/www/wikicalc/wikicalccgi.pl line 23.\n
I do not understand what is the problem because, WKC.pm is in /var/www/wikicalc, so it should be found without problem. do I have to configure something in the perl environment?

xpucto 04-20-2007 03:23 AM

Im still looking around and Im very surprised to have difficulty finding an answer to my problem. Does really have noone any advice?


All times are GMT -5. The time now is 04:42 PM.