fa3b2b6d5c161c8d8adb1ded04a05a42882a9ee6
[catagits/Catalyst-Manual.git] / lib / Catalyst / Manual / Deployment / SharedHosting.pod
1 =head1 NAME
2
3 Catalyst::Manual::Deployment::SharedHosting - Deploying Catalyst on Shared Hosting
4
5 =head1 Catalyst on shared hosting
6
7 So, you want to put your Catalyst application out there for the whole
8 world to see, but you don't want to break the bank. There is an answer -
9 if you can get shared hosting with FastCGI and a shell, you can install
10 your Catalyst app in a local directory on your shared host. First, run
11
12     perl -MCPAN -e shell
13
14 and go through the standard CPAN configuration process. Then exit
15 without installing anything. Next, download the latest L<local::lib>
16 package and follow its 'bootstrap' instructions to get it installed
17 and the local configuration added to your C<< ~/.bashrc >>.
18
19 Now log out, then back in again (or run C<". .bashrc"> if you
20 prefer).
21
22 Now you can install the modules you need using CPAN as normal; they will
23 be installed into your local directory, and Perl will pick them up.
24 Finally, change into the root directory of your virtual host, and
25 symlink your application's script directory:
26
27     cd path/to/mydomain.com
28     ln -s ~/lib/MyApp/script script
29
30 And add the following lines to your .htaccess file (assuming the server
31 is setup to handle .pl as fcgi - you may need to rename the script to
32 myapp_fastcgi.fcgi and/or use a SetHandler directive):
33
34   RewriteEngine On
35   RewriteCond %{REQUEST_URI} !^/?script/myapp_fastcgi.pl
36   RewriteRule ^(.*)$ script/myapp_fastcgi.pl/$1 [PT,L]
37
38 Now C<http://mydomain.com/> should now Just Work. Congratulations, now
39 you can tell your friends about your new website. 
40
41 =head1 AUTHORS
42
43 Catalyst Contributors, see Catalyst.pm
44
45 =head1 COPYRIGHT
46
47 This library is free software. You can redistribute it and/or modify it under
48 the same terms as Perl itself.
49
50 =cut
51