Fix headings
[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
0191b435 6lightweight proxy web server at the front.
c34dd09b 7
0191b435 8XXX - FIXME Starman!
c34dd09b 9
0191b435 10=head3 Pros
c34dd09b 11
12=head4 Simple
13
14The development server is what you create your code on, so if it works
15here, it should work in production!
16
17=head3 Cons
18
19=head4 Speed
20
21Not as fast as mod_perl or FastCGI. Needs to fork for each request
22that comes in - make sure static files are served by the web server to
23save forking.
24
25=head3 Setup
26
27=head4 Start up the development server
28
0191b435 29 script/myapp_server.pl -p 8080 -k -f -pidfile=/tmp/myapp.pid
c34dd09b 30
31You will probably want to write an init script to handle stop/starting
32the app using the pid file.
33
34=head4 Configuring Apache
35
36Make sure mod_proxy is enabled and add:
37
38 # Serve static content directly
39 DocumentRoot /var/www/MyApp/root
40 Alias /static /var/www/MyApp/root/static
41
42 ProxyRequests Off
43 <Proxy *>
44 Order deny,allow
45 Allow from all
46 </Proxy>
47
48 # Need to specifically stop these paths from being passed to proxy
49 ProxyPass /static !
50 ProxyPass /favicon.ico !
51
52 ProxyPass / http://localhost:8080/
53 ProxyPassReverse / http://localhost:8080/
54
55 # This is optional if you'd like to show a custom error page
56 # if the proxy is not available
57 ErrorDocument 502 /static/error_pages/http502.html
58
59You can wrap the above within a VirtualHost container if you want
60different apps served on the same host.
61
62=head1 AUTHORS
63
64Catalyst Contributors, see Catalyst.pm
65
66=head1 COPYRIGHT
67
68This library is free software. You can redistribute it and/or modify it under
69the same terms as Perl itself.
70
71=cut