aboutsummaryrefslogtreecommitdiffstats
path: root/conf
diff options
context:
space:
mode:
Diffstat (limited to 'conf')
-rw-r--r--conf/apache-vhost.conf.example34
-rw-r--r--conf/crontab.example28
-rw-r--r--conf/httpd.conf-example40
-rw-r--r--conf/nginx.conf.example75
-rw-r--r--conf/packages.ubuntu-precise16
-rwxr-xr-xconf/sysvinit.example53
6 files changed, 210 insertions, 36 deletions
diff --git a/conf/apache-vhost.conf.example b/conf/apache-vhost.conf.example
new file mode 100644
index 000000000..97a34fe66
--- /dev/null
+++ b/conf/apache-vhost.conf.example
@@ -0,0 +1,34 @@
+# An example Apache virtualhost configuration file.
+#
+# See our installation help at http://code.fixmystreet.com/
+
+<VirtualHost *:80>
+ ServerName fixmystreet.yourservername
+ DocumentRoot /home/yourname/fixmystreet/web/
+
+ # Pull in the specific config
+ Include /home/yourname/fixmystreet/conf/httpd.conf
+
+ <Directory /home/yourname/fixmystreet/web>
+ # You also need to enable cgi files to run as CGI scripts. For example:
+ # on production servers these are run under fastcgi
+ Options +ExecCGI
+ AddHandler cgi-script .cgi
+ AllowOverride None
+ </Directory>
+
+ <Location /admin>
+ #
+ # WARNING - enable auth here on production machine
+ #
+ </Location>
+
+ Alias /admin/ /home/yourname/fixmystreet/web-admin/
+
+ Alias /jslib/ /home/yourname/fixmystreet/commonlib/jslib/
+ <Location /jslib>
+ AddOutputFilter DEFLATE js
+ Header append Cache-Control "no-transform"
+ </Location>
+
+</VirtualHost>
diff --git a/conf/crontab.example b/conf/crontab.example
new file mode 100644
index 000000000..f33e949e8
--- /dev/null
+++ b/conf/crontab.example
@@ -0,0 +1,28 @@
+# Timed tasks for FixMyStreet.
+
+# This is an example crontab that you may want to use as a basis for
+# one on your own server. You should replace $FMS with the path to the
+# clone of the FixMyStreet repository that you are using. You should
+# also replace $LOCK_DIR with a writeable directory for the lock files.
+
+# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
+# Email: matthew@mysociety.org. WWW: http://www.mysociety.org/
+
+PATH=/usr/local/bin:/usr/bin:/bin
+
+5,10,15,20,25,30,35,40,45,50,55 * * * * "$FMS/commonlib/bin/run-with-lockfile.sh" -n "$FMS/send-reports.lock" "$FMS/bin/cron-wrapper send-reports" || echo "stalled?"
+0 0-8,10,11,13,14,16,17,19-23 * * * "$FMS/commonlib/bin/run-with-lockfile.sh" -n "$LOCK_DIR/send-reports.lock" "$FMS/bin/cron-wrapper send-reports" || echo "stalled?"
+0 9,12,15,18 * * * "$FMS/commonlib/bin/run-with-lockfile.sh" -n "$LOCK_DIR/send-reports.lock" "$FMS/bin/cron-wrapper send-reports --verbose" || echo "stalled?"
+2 * * * * "$FMS/commonlib/bin/run-with-lockfile.sh" -n "$LOCK_DIR/send-alerts.lock" "$FMS/bin/cron-wrapper send-alerts" || echo "stalled?"
+0,30 * * * * "$FMS/commonlib/bin/run-with-lockfile.sh" -n "$LOCK_DIR/send-questionnaires.lock" "$FMS/bin/cron-wrapper send-questionnaires" || echo "stalled?"
+5,10,15,20,25,30,35,40,45,50,55 * * * * "$FMS/commonlib/bin/run-with-lockfile.sh" -n "$LOCK_DIR/send-comments.lock" "$FMS/bin/cron-wrapper send-comments" || echo "stalled?"
+5,10,15,20,25,30,35,40,45,50,55 * * * * "$FMS/commonlib/bin/run-with-lockfile.sh" -n "$LOCK_DIR/fetch-comments.lock" "$FMS/bin/cron-wrapper fetch-comments" || echo "stalled?"
+0,30 * * * * "$FMS/commonlib/bin/run-with-lockfile.sh" -n "$LOCK_DIR/open311-populate-service-list.lock" "$FMS/bin/cron-wrapper open311-populate-service-list" || echo "stalled?"
+
+# Once an hour, update the all reports stats
+13 * * * * "$FMS/bin/cron-wrapper" update-all-reports
+
+# Once a day on all servers
+39 2 * * * "$FMS/bin/problems-filed-graph"
+43 2 * * * "$FMS/bin/problem-creation-graph"
+00 8 * * * "$FMS/bin/check-for-zombies" $UNIX_USER
diff --git a/conf/httpd.conf-example b/conf/httpd.conf-example
index e7900161e..ab17dcec3 100644
--- a/conf/httpd.conf-example
+++ b/conf/httpd.conf-example
@@ -1,42 +1,10 @@
# Apache configuration for FixMyStreet.
#
-# Add lines something like this to your /etc/apache2/sites-enabled/fixmystreet -
-# replacing '/home/yourname/fixmystreet' with the path to your install
+# This file should be included in an Apache <VirtualHost> section. An
+# example of such a virtualhost configuration file can be found in the
+# file apache-vhost.conf.example in this directory.
#
-# # FixMyStreet
-# <VirtualHost *:80>
-# ServerName fixmystreet.yourservername
-# DocumentRoot /home/yourname/fixmystreet/web/
-#
-# # Pull in the specific config
-# Include /home/yourname/fixmystreet/conf/httpd.conf
-#
-# <Directory /home/yourname/fixmystreet/web>
-# # You also need to enable cgi files to run as CGI scripts. For example:
-# # on production servers these are run under fastcgi
-# Options +ExecCGI
-# AddHandler cgi-script .cgi
-# AllowOverride None
-# </Directory>
-#
-# <Location /admin>
-# #
-# # WARNING - enable auth here on production machine
-# #
-# Options +ExecCGI
-# AddHandler cgi-script .cgi
-# </Location>
-#
-# Alias /admin/ /home/yourname/fixmystreet/web-admin/
-#
-# Alias /jslib/ "/home/yourname/fixmystreet/commonlib/jslib/"
-#
-# </VirtualHost>
-#
-#
-# Copyright (c) 2011 UK Citizens Online Democracy. All rights reserved.
-# Email: team@mysociety.org
-# WWW: http://www.mysociety.org
+# See our installation help at http://code.fixmystreet.com/
RewriteEngine on
# RewriteLog /var/log/apache2/rewrite.log
diff --git a/conf/nginx.conf.example b/conf/nginx.conf.example
new file mode 100644
index 000000000..7b26afdbf
--- /dev/null
+++ b/conf/nginx.conf.example
@@ -0,0 +1,75 @@
+# An example configuration for running FixMyStreet under nginx. You
+# will also need to set up the FixMyStreet Catalyst FastCGI backend.
+# An example sysvinit script to help with this is shown given in the file
+# sysvinit-catalyst-fastcgi.example in this directory.
+#
+# See our installation help at http://code.fixmystreet.com/
+
+server {
+
+ access_log /var/www/fixmystreet/logs/access.log;
+ error_log /var/www/fixmystreet/logs/error.log;
+
+ listen 80;
+ root /var/www/fixmystreet/fixmystreet/web;
+ error_page 503 /down.html;
+
+ # Make sure that Javascript and CSS are compressed. (HTML is
+ # already compressed under the default configuration of the nginx
+ # package.)
+
+ gzip on;
+ gzip_disable "msie6";
+ gzip_types application/javascript application/x-javascript text/css;
+
+ # Set a long expiry time for CSS and Javascript, and prevent
+ # the mangling of Javascript by proxies:
+
+ location ~ \.css$ {
+ expires 10y;
+ }
+
+ location ~ \.js$ {
+ add_header Cache-Control no-transform;
+ expires 10y;
+ try_files $uri @catalyst;
+ }
+
+ # These rewrite rules are ported from the Apache configuration in
+ # conf/httpd.conf
+
+ rewrite ^/rss/council/([0-9]+)$ /rss/reports/$1 permanent;
+ rewrite ^/report$ /reports permanent;
+ rewrite '^/{/rss/(.*)}$' /rss/$1 permanent;
+ rewrite '^/reports/{/rss/(.*)}$' /rss/$1 permanent;
+ rewrite ^/alerts/?$ /alert permanent;
+
+ location /mapit {
+ proxy_pass http://mapit.mysociety.org/;
+ proxy_set_header X-Real-IP $remote_addr;
+ }
+
+ location /admin {
+ auth_basic "FixMyStreet admin interface";
+ auth_basic_user_file /var/www/fixmystreet/admin-htpasswd;
+ try_files $uri @catalyst;
+ }
+
+ location / {
+ if (-f $document_root/down.html) {
+ return 503;
+ }
+ try_files $uri @catalyst;
+ }
+
+ location /down.html {
+ internal;
+ }
+
+ 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;
+ }
+}
diff --git a/conf/packages.ubuntu-precise b/conf/packages.ubuntu-precise
new file mode 100644
index 000000000..fc8a7d511
--- /dev/null
+++ b/conf/packages.ubuntu-precise
@@ -0,0 +1,16 @@
+make
+jhead
+liberror-perl
+liblocale-gettext-perl
+libsoap-lite-perl
+memcached
+perl
+perlmagick
+libmath-bigint-gmp-perl
+gettext
+libhaml-ruby
+postgresql-9.1
+postgresql-server-dev-9.1
+gnuplot
+ttf-bitstream-vera
+libexpat1-dev
diff --git a/conf/sysvinit.example b/conf/sysvinit.example
new file mode 100755
index 000000000..44424281b
--- /dev/null
+++ b/conf/sysvinit.example
@@ -0,0 +1,53 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides: application-catalyst-fixmystreet
+# Required-Start: $local_fs $network
+# 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
+### END INIT INFO
+
+# This example sysvinit script is based on the helpful example here:
+# http://richard.wallman.org.uk/2010/02/howto-deploy-a-catalyst-application-using-fastcgi-and-nginx/
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+SITE_HOME=/var/www/fixmystreet
+NAME=fixmystreet
+DESC="FixMyStreet app server"
+USER=fms
+
+echo $DAEMON
+test -f $DAEMON || exit 0
+
+set -e
+
+start_daemon() {
+ su -l -c "cd $SITE_HOME/fixmystreet && bin/cron-wrapper web/fixmystreet_app_fastcgi.cgi -d -l :9000 -n 2" $USER
+}
+
+stop_daemon() {
+ pkill -f perl-fcgi -u $USER || true
+}
+
+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
+ ;;
+esac
+
+exit 0