Expand
[catagits/Catalyst-Manual.git] / lib / Catalyst / Manual / Deployment / DevelopmentServer.pod
CommitLineData
c34dd09b 1=head2 Development server deployment
2
3The development server is a mini web server written in perl. If you
4expect a low number of hits or you don't need mod_perl/FastCGI speed,
5you could use the development server as the application server with a
6lightweight proxy web server at the front. However, consider using
7L<Catalyst::Engine::HTTP::Prefork> for this kind of deployment instead, since
8it can better handle multiple concurrent requests without forking, or can
9prefork a set number of servers for improved performance.
10
11=head3 Pros
12
13As this is an application server setup, the pros are the same as
14FastCGI (with the exception of speed).
15It is also:
16
17=head4 Simple
18
19The development server is what you create your code on, so if it works
20here, it should work in production!
21
22=head3 Cons
23
24=head4 Speed
25
26Not as fast as mod_perl or FastCGI. Needs to fork for each request
27that comes in - make sure static files are served by the web server to
28save forking.
29
30=head3 Setup
31
32=head4 Start up the development server
33
34 script/myapp_server.pl -p 8080 -k -f -pidfile=/tmp/myapp.pid
35
36You will probably want to write an init script to handle stop/starting
37the app using the pid file.
38
39=head4 Configuring Apache
40
41Make sure mod_proxy is enabled and add:
42
43 # Serve static content directly
44 DocumentRoot /var/www/MyApp/root
45 Alias /static /var/www/MyApp/root/static
46
47 ProxyRequests Off
48 <Proxy *>
49 Order deny,allow
50 Allow from all
51 </Proxy>
52
53 # Need to specifically stop these paths from being passed to proxy
54 ProxyPass /static !
55 ProxyPass /favicon.ico !
56
57 ProxyPass / http://localhost:8080/
58 ProxyPassReverse / http://localhost:8080/
59
60 # This is optional if you'd like to show a custom error page
61 # if the proxy is not available
62 ErrorDocument 502 /static/error_pages/http502.html
63
64You can wrap the above within a VirtualHost container if you want
65different apps served on the same host.
66
67=head1 AUTHORS
68
69Catalyst Contributors, see Catalyst.pm
70
71=head1 COPYRIGHT
72
73This library is free software. You can redistribute it and/or modify it under
74the same terms as Perl itself.
75
76=cut