Fix headings
[catagits/Catalyst-Manual.git] / lib / Catalyst / Manual / Deployment / DevelopmentServer.pod
1 =head2 Development server deployment
2
3 The development server is a mini web server written in perl.  If you
4 expect a low number of hits or you don't need mod_perl/FastCGI speed,
5 you could use the development server as the application server with a
6 lightweight proxy web server at the front.
7
8 XXX - FIXME Starman!
9
10 =head3 Pros
11
12 =head4 Simple
13
14 The development server is what you create your code on, so if it works
15 here, it should work in production!
16
17 =head3 Cons
18
19 =head4 Speed
20
21 Not as fast as mod_perl or FastCGI. Needs to fork for each request
22 that comes in - make sure static files are served by the web server to
23 save forking.
24
25 =head3 Setup
26
27 =head4 Start up the development server
28
29    script/myapp_server.pl -p 8080 -k -f -pidfile=/tmp/myapp.pid
30
31 You will probably want to write an init script to handle stop/starting
32 the app using the pid file.
33
34 =head4 Configuring Apache
35
36 Make 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
59 You can wrap the above within a VirtualHost container if you want
60 different apps served on the same host.
61
62 =head1 AUTHORS
63
64 Catalyst Contributors, see Catalyst.pm
65
66 =head1 COPYRIGHT
67
68 This library is free software. You can redistribute it and/or modify it under
69 the same terms as Perl itself.
70
71 =cut