Configuring Apache
From MapbenderWiki
This page decribes the details required for a Mapbender Installation.
Installing Apache
Please refer to the Apache httpd documentation for your operating system.
Configuration
After installation create a virtual directory. It will allow you to access the Mapbender scripts from a browser. Follow the schema below and exchange <path-to-mapbender-http> with the path to the web directory of the Mapbender directory ./mapbender/http/
Alias /mapbender /<path-to-mapbender-http>
<Directory /<path-to-mapbender-http>
Options MultiViews
DirectoryIndex index.php
Order allow,deny
Allow from all
</Directory>
The location of the Apache configuration files varies depending on version your are using, for example:
/etc/apache/httpd.conf /etc/apache2/sites-available/default
Remember to reload the configuration file so that Apache knows about the changes.
Apache Output Compression
For best performance, enable output compression of your web server. Here's an instruction for Apache (see http://httpd.apache.org/docs/2.0/mod/mod_deflate.html for more details). Just append the content in bold to your Directory settings
<Directory /var/www/apache2-default/mapbender/http> # (exchange with your path)
Options MultiViews
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
# Insert filter
SetOutputFilter DEFLATE
# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
# BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
# the above regex won't work. You can use the following
# workaround to get the desired effect:
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
# Don't compress images
SetEnvIfNoCase Request_URI \
\.(?:gif|jpe?g|png)$ no-gzip dont-vary
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</Directory>
Make sure you have loaded the required modules (for example, Ubuntu and Apache2)
a2enmod deflate a2enmod headers a2enmod setenvif (for BrowserMatch)
For Windows and Apache2, you have to activate the modules in the configuraiton file httpd.conf.
LoadModule deflate_module modules/mod_deflate.so LoadModule headers_module modules/mod_headers.so
Mapbender will load almost twice as fast!
