Skip to content
Snippets Groups Projects
site-conf 2.67 KiB
Newer Older
<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        #ServerName www.example.com

        ServerAdmin david.hoese@ssec.wisc.edu
        DocumentRoot /var/www/html

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf

        # Custom CSPP Geo
        RewriteEngine on
        # helper function to lowercase product name
        RewriteMap lc int:tolower

        SetEnv MAPSERVER_CONFIG_FILE /usr/local/etc/mapserver.conf
        # /wms/g16/abi/radf/l1b?...
        # /wms/g16/abi/radf/borders?...
        RewriteRule   "^/wms/([^/]+)/([^/]+)/([^/]+)/([^/]+)?(.*)" "/cgi-bin/mapserv.fcgi?map=/work/mapfiles/$1_$2_$3_$4.map&$5" [PT,QSA]
        RewriteRule   "^/wms/([^/]+)?(.*)" "/cgi-bin/mapserv.fcgi?map=/work/mapfiles/$1.map&$2" [PT,QSA]
        # Regular CGI version of the URL (put last since it should be used less often)
        RewriteRule   "^/wms_cgi/([^/]+)/([^/]+)/([^/]+)/([^/]+)?(.*)" "/cgi-bin/mapserv?map=/work/mapfiles/$1_$2_$3_$4.map&$5" [PT,QSA]
        RewriteRule   "^/wms_cgi/([^/]+)?(.*)" "/cgi-bin/mapserv?map=/work/mapfiles/$1.map&$2" [PT,QSA]

        # handler should be added by the enabled module
        #AddHandler fcgid-script fcgi
        <IfModule mod_fcgid.c>
           FcgidMaxProcessesPerClass 10
           FcgidInitialEnv PROJ_LIB /usr/local/share/proj
           FcgidInitialEnv LD_LIBRARY_PATH "/usr/local/lib:/usr/local/pgsql/lib:/usr3/pkg3/oracle9/lib"
        </IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet