Skip to content

Instantly share code, notes, and snippets.

@wboykinm
Created September 26, 2012 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wboykinm/3788367 to your computer and use it in GitHub Desktop.
Save wboykinm/3788367 to your computer and use it in GitHub Desktop.
publicmapping apache config
<IfDefine !nobuilder>
<VirtualHost *:80>
ServerAdmin AzaveaDev@azavea.com
WSGIDaemonProcess geodjango user=www-data group=www-data processes=10 threads=1 display-name=publicmapping
WSGIProcessGroup geodjango
WSGIApplicationGroup %{GLOBAL}
WSGIScriptAlias / /projects/DistrictBuilder/django/publicmapping.wsgi
Alias /static-media/ /projects/DistrictBuilder/django/publicmapping/static-media/
<Directory /projects//DistrictBuilder/django/publicmapping/static-media>
Order deny,allow
Allow from all
</Directory>
Alias /reports/ /projects/local/reports/
<Directory /projects/local/reports/>
Options Indexes FollowSymLinks
Order deny,allow
Allow from all
</Directory>
Alias /sld/ /projects/DistrictBuilder/sld/
<Directory /projects/DistrictBuilder/sld/>
Options Indexes
Order deny,allow
Allow from all
</Directory>
Alias /docs/ /projects/DistrictBuilder/docs/html/
<Directory /projects/DistrictBuilder/docs/html/>
Options Indexes
Order deny,allow
Allow from all
</Directory>
Alias /data/ /projects/local/data/
<Directory /projects/local/data/>
Options Indexes
Order deny,allow
Allow from all
</Directory>
ErrorLog /var/log/apache2/publicmapping-error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/publicmapping-access.log combined
RewriteEngine On
# This redirects report requests to an alternate port.
RewriteRule ^/reporting/getreport/$ http://localhost:8081/getreport/ [NC,P]
# You can comment out this rewriterule and adjust your map server name accordingly to stop proxying
# map requests through apache
RewriteRule /geoserver/(.*) http://%{HTTP_HOST}:8080/geoserver/$1 [NC,P]
RewriteLog /var/log/apache2/publicmapping-rewrite.log
RewriteLogLevel 0
</VirtualHost>
</IfDefine>
<IfDefine !noreporting>
<IfDefine nobuilder>
# All traffic on port 80 should be redirected to the reporting port
<VirtualHost *:80>
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*) http://%{HTTP_HOST}:8081$1 [R,L]
</VirtualHost>
</IfDefine>
# Necessary to keep rPy2 from throwing exceptions
WSGIRestrictStdout Off
# This virtual host is responsible for running a multithreaded environment for reports
NameVirtualHost *:8081
Listen 8081
<VirtualHost *:8081>
ServerAdmin AzaveaDev@azavea.com
WSGIDaemonProcess bard-reports user=www-data group=www-data processes=1 threads=1 display-name=publicmapping-reports
WSGIScriptAlias / /projects/DistrictBuilder/django/reports.wsgi
WSGIProcessGroup bard-reports
WSGIApplicationGroup bard-reports
ErrorLog /var/log/apache2/bard-reporting-error.log
CustomLog /var/log/apache2/bard-reporting-access.log combined
LogLevel warn
# This virtual host needs a longer timeout because of reports
Timeout 600
# These requests are proxied through the secure server. Non-local access forbidden.
<IfDefine !nobuilder>
<Directory />
Order deny,allow
Deny from all
Allow from 127.0.0.1/16
</Directory>
</IfDefine>
</VirtualHost>
</IfDefine>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment