Commit | Line | Data |
eaeeb5e6 |
1 | =head1 NAME |
c34dd09b |
2 | |
eaeeb5e6 |
3 | Catalyst::Manual::DevelopmentServer - Development server deployment |
c34dd09b |
4 | |
5abded07 |
5 | The development server is a mini web server written in Perl. However, if |
6 | you supply the C<-f> option to the development server, it will load the |
7 | higher performance L<Starman> server, which can be used as an |
eaeeb5e6 |
8 | application server with a lightweight proxy web server at the front. |
c34dd09b |
9 | |
eaeeb5e6 |
10 | =head1 Setup |
c34dd09b |
11 | |
eaeeb5e6 |
12 | =head2 Start up the development server |
c34dd09b |
13 | |
eaeeb5e6 |
14 | script/myapp_server.pl -p 8080 -k -f --pidfile=/tmp/myapp.pid |
c34dd09b |
15 | |
16 | You will probably want to write an init script to handle stop/starting |
17 | the app using the pid file. |
18 | |
eaeeb5e6 |
19 | =head2 Configuring Apache |
c34dd09b |
20 | |
21 | Make sure mod_proxy is enabled and add: |
22 | |
23 | # Serve static content directly |
24 | DocumentRoot /var/www/MyApp/root |
25 | Alias /static /var/www/MyApp/root/static |
26 | |
27 | ProxyRequests Off |
28 | <Proxy *> |
29 | Order deny,allow |
30 | Allow from all |
31 | </Proxy> |
32 | |
33 | # Need to specifically stop these paths from being passed to proxy |
34 | ProxyPass /static ! |
35 | ProxyPass /favicon.ico ! |
36 | |
37 | ProxyPass / http://localhost:8080/ |
38 | ProxyPassReverse / http://localhost:8080/ |
39 | |
40 | # This is optional if you'd like to show a custom error page |
41 | # if the proxy is not available |
42 | ErrorDocument 502 /static/error_pages/http502.html |
43 | |
44 | You can wrap the above within a VirtualHost container if you want |
45 | different apps served on the same host. |
46 | |
eaeeb5e6 |
47 | =head2 Other web servers |
48 | |
5abded07 |
49 | The proxy configuration above can also be replicated with a different |
50 | frontend server or proxy, such as varnish, nginx, or lighttpd. |
eaeeb5e6 |
51 | |
c34dd09b |
52 | =head1 AUTHORS |
53 | |
54 | Catalyst Contributors, see Catalyst.pm |
55 | |
56 | =head1 COPYRIGHT |
57 | |
58 | This library is free software. You can redistribute it and/or modify it under |
59 | the same terms as Perl itself. |
60 | |
506ff3c8 |
61 | =cut |