diff options
Diffstat (limited to 'conf')
-rw-r--r-- | conf/nginx.conf.example | 9 | ||||
-rwxr-xr-x | conf/sysvinit.example | 42 |
2 files changed, 27 insertions, 24 deletions
diff --git a/conf/nginx.conf.example b/conf/nginx.conf.example index 29d06aee2..bf76332b7 100644 --- a/conf/nginx.conf.example +++ b/conf/nginx.conf.example @@ -63,9 +63,10 @@ server { } location @catalyst { - include /etc/nginx/fastcgi_params; - fastcgi_param PATH_INFO $fastcgi_script_name; - fastcgi_param SCRIPT_NAME ''; - fastcgi_pass 127.0.0.1:9000; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Host $host; + proxy_redirect off; + proxy_pass http://127.0.0.1:9000; } } diff --git a/conf/sysvinit.example b/conf/sysvinit.example index 9ad97e6ab..3c457dd64 100755 --- a/conf/sysvinit.example +++ b/conf/sysvinit.example @@ -5,8 +5,8 @@ # Required-Stop: $local_fs $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 -# Short-Description: Starts the FastCGI app server for the "FixMyStreet" site -# Description: The FastCGI application server for the "FixMyStreet" site +# Short-Description: Starts the app server for the "FixMyStreet" site +# Description: The application server for the "FixMyStreet" site ### END INIT INFO # This example sysvinit script is based on the helpful example here: @@ -17,6 +17,8 @@ SITE_HOME=/var/www/fixmystreet NAME=fixmystreet DESC="FixMyStreet app server" USER=fms +PIDFILE=${SITE_HOME}/${NAME}.pid +LOGDIR=${SITE_HOME}/logs echo $DAEMON test -f $DAEMON || exit 0 @@ -24,30 +26,30 @@ test -f $DAEMON || exit 0 set -e start_daemon() { - su -l -c "cd $SITE_HOME/fixmystreet && web/fixmystreet_app_fastcgi.cgi -d -l :9000 -n 2" $USER + su -l -c "cd $SITE_HOME/fixmystreet && script/server --port 9000 --env deployment --daemonize --pid $PIDFILE --access-log $LOGDIR/$NAME.access.log --error-log $LOGDIR/$NAME.error.log" $USER } stop_daemon() { - pkill -f perl-fcgi -u $USER || true + kill -TERM `cat $PIDFILE` } case "$1" in - start) - start_daemon - ;; - stop) - stop_daemon - ;; - reload|restart|force-reload) - stop_daemon - sleep 5 - start_daemon - ;; - *) - N=/etc/init.d/$NAME - echo "Usage: $N {start|stop|reload|restart|force-reload}" >&2 - exit 1 - ;; + start) + start_daemon + ;; + stop) + stop_daemon + ;; + reload|restart|force-reload) + stop_daemon + sleep 5 + start_daemon + ;; + *) + N=/etc/init.d/$NAME + echo "Usage: $N {start|stop|reload|restart|force-reload}" >&2 + exit 1 + ;; esac exit 0 |