Sunday, March 2, 2008

Install Mod perl on Cpanel Server

link for tutorial http://perl.apache.org/docs/tutorials/index.html
---------------
This set of instructions will show you how to easily install mod_perl onto a cpanel server.
1) Create a new account, or choose an existing account where you will install mod_perl. I typically choose either the rvskin admin account or fantastico admin account. This tutorials will assume you install it in the rvadmin account.
2) SSH into the server, and go to:
cd /home/rvadmin/ directory
3) Get the mod_perl-1.29.tar.gz
wget http://perl.apache.org/dist/mod_perl-1.0-current.tar.gz 4) Unpack the file:
tar -xzf mod_perl-1.29.tar.gz

5) Move to the mod_perl directoy:
cd mod_perl-1.29

6) Configure
perl Makefile.PL USE_APXS=1 WITH_APXS=/usr/local/apache/bin/apxs EVERYTHING=1

7) Run Make
make

8) Run Install
make install

9) Activate Mod Perl
/usr/local/apache/bin/apxs -a -n perl -i libperl.so

#########

Create the script below, and add it to the root directory of the mod_perl account holder (in this case rvadmin), and change the permissions (chmod +x add-mod-perl.sh), so to add mod_perl back into apache, you just need to run the script, and then verify that apache restarted with mod perl in it, you can check in WHM/News to see if mod_perl is listed .

#########

That last line is the one you’ll need to run if you re-compile Apache. The mod_perl binary is at
/home/rvadmin/mod_perl-1.29/apaci/libperl.so, so a simple way to do this would be to put the following lines in a file:

— cut here —
#!/bin/sh

libperl=/home/rvadmin/mod_perl-1.29/apaci/libperl.so
apxs=/usr/local/apache/bin/apxs

$apxs -a -n perl -i $libperl

/etc/init.d/httpd stop
/etc/init.d/httpd start
— cut here —

Name the file add-mod-perl.sh and execute “chmod +x add-mod-perl.sh”. Then, after compileing apache run the script (”./add-mod-perl.sh”) and it should all work.

No comments: