Author Topic: How do I execute perl.  (Read 12366 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
How do I execute perl.
« on: July 17, 2015, 03:55:28 AM »
New install of panel but i don't seem to be able to execut perl.

Code simply echos out even though file protection is 755

COde for test.pl

#!usr/bin/perl

print "Enter your name: ";
$name=<STDIN>;
print "Hello, ${name} !";

Offline
*
Re: How do I execute perl.
« Reply #1 on: July 29, 2015, 10:02:41 PM »
Did you ever figure this out?
I just installed a cwp today and while apache works, there is no mod_cgi... so, no perl for httpd...


Offline
*
Re: How do I execute perl.
« Reply #2 on: July 29, 2015, 11:22:14 PM »
working on this still...
turns out mod_cgi is included in apache version 2.27.
Code: [Select]
Starting httpd: httpd: Syntax error on line 414 of /usr/local/apache/conf/httpd.conf: module cgi_module is built-in and can't be loaded
That's why I can't find a specific mod_cgi.so file.

More to follow.  (I'm pretty sure this has to do with a <directory> config error.

Offline
*
Re: How do I execute perl.
« Reply #3 on: July 29, 2015, 11:52:07 PM »
Perl execute problem solved.

Instead of doing a configuration change on the domain.conf files or virtual whatever, I did the thingy on:

/usr/local/apache/conf/extra/httpd-userdir.conf

This one (httpd-userdir.conf) is not updated or modded by any of the cwp scripts that I know of, (I went thru multiple cp checks on rebuilding blah blah, couldn't find any script that changed that one file).

Code: [Select]
<Directory /home/*/public_html/cgi-bin>
        Options ExecCGI SymLinksIfOwnerMatch
        SetHandler cgi-script
</Directory>

Just add that at the bottom (before </directory>) and your perl scripts should work just dandy.

Ok all you CWP boyz... you need to add this little bittie thingy to your installation templates.
Thanks for an awesome control panel.

tags: perl script print mod_cgi centos web control panel won't execute apache 2.2 (all hail google).

Offline
*
Re: How do I execute perl.
« Reply #4 on: July 29, 2015, 11:55:50 PM »
WHOOPS!!!
No.... do not add that before the last </directory>,
add it AFTER the last </directory>

<Directory /home/*/public_html/cgi-bin>
        Options ExecCGI SymLinksIfOwnerMatch
        SetHandler cgi-script
</Directory>

sorry folks, beer wednesday, btw, what's up with the forum time anyway?  It says I'm posting at like 11 something, but it's almost 8pm here on the east coast.  You guys that host this thing in Siberia?  Oh well, good job.

Offline
*
Re: How do I execute perl.
« Reply #5 on: July 29, 2015, 11:58:56 PM »
lol... oh I see, it's 11PM server time, not 8pm... so the cwp forum is hosted in the middle of the atlantic ocean.  I like it.
At least my cp works great as well as my domains, (hosted dev-env in my home network).
Thanks for looking!

Offline
*
Re: How do I execute perl.
« Reply #6 on: July 30, 2015, 01:20:19 AM »
New install of panel but i don't seem to be able to execut perl.

Code simply echos out even though file protection is 755

COde for test.pl

#!usr/bin/perl

print "Enter your name: ";
$name=<STDIN>;
print "Hello, ${name} !";

Don't forget to add at the top of this script before your first print statement:
Code: [Select]
print "content-type text/html\n\n"
Otherwise you'll get 500 server errors