diff options
-rw-r--r-- | conf/httpd.conf | 106 | ||||
-rw-r--r-- | conf/httpd.conf-example | 68 |
2 files changed, 68 insertions, 106 deletions
diff --git a/conf/httpd.conf b/conf/httpd.conf deleted file mode 100644 index c8d6a6c0c..000000000 --- a/conf/httpd.conf +++ /dev/null @@ -1,106 +0,0 @@ -# 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 -# -# # 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 -# </Directory> -# -# <Directory /home/yourname/fixmystreet/web-admin> -# # -# # WARNING - enable auth here on production machine -# # -# Options +ExecCGI -# AddHandler cgi-script .cgi -# </Directory> -# -# 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 - -DirectoryIndex index.cgi - -RewriteEngine on -# RewriteLog /var/log/apache2/rewrite.log -# RewriteLogLevel 3 - -# Confirmation tokens -# RewriteRule ^/[Aa]/([0-9A-Za-z]{16,18}).*$ /alert.cgi?token=$1 [QSA,L] -# RewriteRule ^/[Cc]/([0-9A-Za-z]{16,18}).*$ /confirm.cgi?type=update;token=$1 [QSA,L] -# RewriteRule ^/[Qq]/([0-9A-Za-z]{16,18}).*$ /questionnaire.cgi?token=$1 [QSA,L] - -# RSS feeds for updates on a problem -#RewriteRule ^/rss/([0-9]+)$ /rss.cgi?type=new_updates;id=$1 [QSA,L] - -# RSS feeds for new local problems -#RewriteRule ^/rss/([0-9]+)[,/]([0-9]+)$ /rss.cgi?type=local_problems;x=$1;y=$2 [QSA,L] -#RewriteRule ^/rss/n/([0-9]+)[,/]([0-9]+)$ /rss.cgi?type=local_problems;e=$1;n=$2 [QSA,L] -#RewriteRule ^/rss/l/([0-9.-]+)[,/]([0-9.-]+)$ /rss.cgi?type=local_problems;lat=$1;lon=$2 [QSA,L] -#RewriteRule ^/rss/([0-9]+)[,/]([0-9]+)/([0-9]+)$ /rss.cgi?type=local_problems;x=$1;y=$2;d=$3 [QSA,L] -#RewriteRule ^/rss/n/([0-9]+)[,/]([0-9]+)/([0-9]+)$ /rss.cgi?type=local_problems;e=$1;n=$2;d=$3 [QSA,L] -#RewriteRule ^/rss/l/([0-9.-]+)[,/]([0-9.-]+)/([0-9]+)$ /rss.cgi?type=local_problems;lat=$1;lon=$2;d=$3 [QSA,L] -#RewriteRule ^/rss/pc/(.*)/([0-9]+)$ /rss.cgi?type=local_problems;pc=$1;d=$2 [QSA,L] -#RewriteRule ^/rss/pc/(.*)$ /rss.cgi?type=local_problems;pc=$1 [QSA,L] -#RewriteRule ^/rss/problems$ /rss.cgi?type=new_problems [QSA,L] - -# RSS feeds for voting areas -RewriteRule ^/rss/council/([0-9]+)$ /rss/reports/$1 [R=permanent,L] -RewriteRule ^/report$ /reports [R=permanent,L] -#RewriteRule ^/reports/([^/]+)/all$ /reports.cgi?council=$1;all=1 [QSA,L] -#RewriteRule ^/reports/([^/]+)/([^/]+)$ /reports.cgi?council=$1;ward=$2 [QSA,L] -#RewriteRule ^/rss/(reports|area)/([^/]+)/([^/]+)$ /reports.cgi?rss=$1;council=$2;ward=$3 [QSA,L] -#RewriteRule ^/reports/([^/]+)$ /reports.cgi?council=$1 [QSA,L] -#RewriteRule ^/rss/area/([0-9]+)$ /rss.cgi?type=area_problems;id=$1 [QSA,L] -#RewriteRule ^/rss/(reports|area)/([^/]+)$ /reports.cgi?rss=$1;council=$2 [QSA,L] - -# Fix incorrect RSS urls caused by my stupidity -RewriteRule ^/{/rss/(.*)}$ /rss/$1 [R=permanent,L] -RewriteRule ^/reports/{/rss/(.*)}$ /rss/$1 [R=permanent,L] - -# RewriteRule ^/report/([0-9]+)$ /index.cgi?id=$1 [QSA,L] -# RewriteRule ^/report/([0-9]+) /report/$1 [R,L] -RewriteRule ^/alerts/?$ /alert [R=permanent,L] - -# Proxy tilma so that our js code can make calls on the originating server. Use -# a RewriteRule rather than ProxyPass so that Apache's processing order is more -# predictable. ProxyPassReverse is not affected by this. -RewriteRule /tilma/(.*) http://tilma.mysociety.org/$1 [P,L] -ProxyPassReverse /tilma/ http://tilma.mysociety.org/ - -# serve static files directly -RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f -RewriteRule /(.+) /$1 [L] - -# Explicitly capture all cgi files so that we can remove them one by one -# RewriteRule ^/confirm(.*) /confirm.cgi$1 [L] -# RewriteRule ^/questionnaire(.*) /questionnaire.cgi$1 [L] -# RewriteRule ^/reports(.*) /reports.cgi$1 [L] -# RewriteRule ^/rss(.*) /rss.cgi$1 [L] - -RewriteRule ^/jslib(.*) /jslib$1 [L,PT] - -# trap anything that reaches us here and send it to the Catalyst app - this is -# so that we can gradually move functionality into the app without having to -# touch the existing code. -RewriteRule ^(.*)$ /fixmystreet_app_cgi.cgi$1 [L] - - diff --git a/conf/httpd.conf-example b/conf/httpd.conf-example new file mode 100644 index 000000000..54c4b90ac --- /dev/null +++ b/conf/httpd.conf-example @@ -0,0 +1,68 @@ +# 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 +# +# # 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 +# </Directory> +# +# <Directory /home/yourname/fixmystreet/web-admin> +# # +# # WARNING - enable auth here on production machine +# # +# Options +ExecCGI +# AddHandler cgi-script .cgi +# </Directory> +# +# 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 + +RewriteEngine on +# RewriteLog /var/log/apache2/rewrite.log +# RewriteLogLevel 3 + +# RSS feeds for voting areas +RewriteRule ^/rss/council/([0-9]+)$ /rss/reports/$1 [R=permanent,L] +RewriteRule ^/report$ /reports [R=permanent,L] +# Fix incorrect RSS urls caused by my stupidity +RewriteRule ^/{/rss/(.*)}$ /rss/$1 [R=permanent,L] +RewriteRule ^/reports/{/rss/(.*)}$ /rss/$1 [R=permanent,L] +# In case of misspelling +RewriteRule ^/alerts/?$ /alert [R=permanent,L] + +# Proxy tilma so that our js code can make calls on the originating server. Use +# a RewriteRule rather than ProxyPass so that Apache's processing order is more +# predictable. ProxyPassReverse is not affected by this. +RewriteRule /tilma/(.*) http://tilma.mysociety.org/$1 [P,L] +ProxyPassReverse /tilma/ http://tilma.mysociety.org/ + +# serve static files directly +RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f +RewriteRule /(.+) /$1 [L] + +# Don't want jslib being passed to Catalyst +RewriteRule ^/jslib(.*) /jslib$1 [L,PT] + +# trap anything that reaches us here and send it to the Catalyst app +RewriteRule ^(.*)$ /fixmystreet_app_fastcgi.cgi$1 [L] + |