in reply to loading Perl modules onto virtual web host

I used to use a provider called http://ipowerweb.com. They were pretty good, actually, and the reason I don't use them any more was because I wanted the power and flexibility (e.g. dns, mod_perl) of having my own virtual linux node (at http://www.linode.com/).

I got a few Perl applications going on http://ipowerweb.com like twiki which required additional CPAN modules.

What I would do is download the necessary CPAN modules onto my local machine and make the module. Note that you MUST build a Perl version as binaries are unlikely to work on a remote virtual host.

Next, I would bundle up my modules into a particular location, and FTP them onto my virtual server (e.g. into the /home/myusername/perllib/ directory).

Lastly I would ensure my Perl script would have a

use lib '/home/myusername/perllib';
statement so that Perl would know where to find my modules.

In the case of twiki, which already has several Perl modules that are used by the application, I bundled my CPAN modules into the same directory as those that came with the application and ensured the library path was correctly set in the application configuration file.

Replies are listed 'Best First'.
Re^2: loading Perl modules onto virtual web host
by monarch (Priest) on Oct 11, 2006 at 10:08 UTC
    Actually another trick to be aware of is the fact that some providers (like http://ipowerweb.com) permit you to upload a .htaccess file.

    How would this be a help? Well..

    You can set up a .htaccess file in the directory that your script is located, then set the PERL5LIB environment variable to point to the directory in which you stored your uploaded (FTP'd) CPAN modules. In particular, look into the SetEnv directive.

    At a guess I would suggest a .htaccess file that looks like:

    <Files ~ "\.pl$"> Options +ExecCGI SetHandler cgi-script SetEnv PERL5LIB /home/myusername/myperl/lib </Files>
      Than you very much moarch! I knew there have to be a way to fix this without having ssh access there. The only thing left now is to find out how to build Perl version :). /Alexander