How do I specify the Perl include path for a Catalyst fastcgi process?

1.1k Views Asked by At

i have installed all my dependencies for Catalyst in ~/perl5/lib/perl5 using local::lib

I want to run my app under Apache2 using mod_fcgid, but the fastcgi perl script cannot find the modules in my custom path. How can I specify that (apache config?) my custom lib dir is to be included in the INC directory without explicitly hacking it into myapp_fastcgi.pl? I want to be able to move my app between servers that have the perl includes installed in different directories.

Thanks, Rob

1

There are 1 best solutions below

0
On BEST ANSWER

You can set the environment variables with DefaultInitEnv. You probably want something like this, but with your regular includes too,

DefaultInitEnv PERL5LIB /home/rob/perl5/lib/perl5

You can also do things like setting your app config like that too,

DefaultInitEnv APPNAME_CONFIG /srv/app/appname.conf