Update Apache configuration to rel_2_0 standards
authorDan Scott <dan@coffeecode.net>
Sun, 22 May 2011 12:45:53 +0000 (08:45 -0400)
committerDan Scott <dan@coffeecode.net>
Sun, 22 May 2011 12:45:53 +0000 (08:45 -0400)
Signed-off-by: Dan Scott <dscott@laurentian.ca>
apache/eg_vhost.conf

index 912dffa..8728823 100644 (file)
@@ -166,9 +166,9 @@ RewriteRule - - [E=locale:%1] [L]
 # ----------------------------------------------------------------------------------
 # Configure the OPAC
 # ----------------------------------------------------------------------------------
-<LocationMatch />
-AddOutputFilterByType DEFLATE text/css text/javascript application/javascript
-</LocationMatch>
+#<LocationMatch />
+#AddOutputFilterByType DEFLATE text/css text/javascript application/javascript
+#</LocationMatch>
 
 <LocationMatch /opac/>
     AddType application/xhtml+xml .xml
@@ -196,6 +196,7 @@ AddOutputFilterByType DEFLATE text/css text/javascript application/javascript
     # In addition to loading images from a static host, you can also load CSS and/or
     # Javascript from a static host or hosts. Protocol will be determined at runtime
     # and/or by configuration options immediately following.
+    
     SetEnvIf Request_URI ".*" OILS_OPAC_CSS_HOST=css.concat.ca/opac/
     SetEnvIf Request_URI ".*" OILS_OPAC_JS_HOST=js.concat.ca/opac/
 
@@ -209,15 +210,83 @@ AddOutputFilterByType DEFLATE text/css text/javascript application/javascript
     # and are willing to accept some increased server load, set this:
     SetEnvIf Request_URI ".*" OILS_OPAC_BYPASS_STATIC_FOR_HTTPS=yes
 
+    # Specify a ChiliFresh account to integrate their services with the OPAC
+    #SetEnv OILS_CHILIFRESH_ACCOUNT
+    #SetEnv OILS_CHILIFRESH_PROFILE
+    #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
+
+    # Specify the initial script URL for Novelist (containing account credentials, etc.)
+    #SetEnv OILS_NOVELIST_URL
+    
+    # Uncomment to force SSL any time a patron is logged in.  This protects 
+    # authentication tokens.  Left commented out for backwards compat for now.
+    SetEnv OILS_OPAC_FORCE_LOGIN_SSL 1
+
+    # ----------------------------------------------------------------------------------
+    # Some mod_deflate fun
+    # ----------------------------------------------------------------------------------
+    <IfModule mod_deflate.c>
+        SetOutputFilter DEFLATE
+
+        BrowserMatch ^Mozilla/4 gzip-only-text/html
+        BrowserMatch ^Mozilla/4\.0[678] no-gzip
+        BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
+
+        SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
+
+        <IfModule mod_headers.c>
+            Header append Vary User-Agent env=!dont-vary
+        </IfModule>
+    </IfModule>
+
 </LocationMatch>
 
+<Location //opac/>
+    # ----------------------------------------------------------------------------------
+    # Some mod_deflate fun
+    # ----------------------------------------------------------------------------------
+    <IfModule mod_deflate.c>
+        SetOutputFilter DEFLATE
+
+        BrowserMatch ^Mozilla/4 gzip-only-text/html
+        BrowserMatch ^Mozilla/4\.0[678] no-gzip
+        BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
+
+        SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
+
+        <IfModule mod_headers.c>
+            Header append Vary User-Agent env=!dont-vary
+        </IfModule>
+    </IfModule>
+
+</Location>
+
+<Location /js/>
+    # ----------------------------------------------------------------------------------
+    # Some mod_deflate fun
+    # ----------------------------------------------------------------------------------
+    <IfModule mod_deflate.c>
+        SetOutputFilter DEFLATE
+
+        BrowserMatch ^Mozilla/4 gzip-only-text/html
+        BrowserMatch ^Mozilla/4\.0[678] no-gzip
+        BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
+
+        SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
+
+        <IfModule mod_headers.c>
+            Header append Vary User-Agent env=!dont-vary
+        </IfModule>
+    </IfModule>
+
+</Location>
 
 # ----------------------------------------------------------------------------------
 # Force SSL on the OPAC's "My Account" page
 # ----------------------------------------------------------------------------------
 <LocationMatch .*/myopac.xml>
 # Removed to test load balancer
-#    SSLRequireSSL
+    SSLRequireSSL
 </LocationMatch>
 
 <LocationMatch /opac/extras/>
@@ -228,7 +297,6 @@ AddOutputFilterByType DEFLATE text/css text/javascript application/javascript
     AddType application/xhtml+xml .xml
 </LocationMatch>
 
-RewriteEngine ON
 RewriteCond %{QUERY_STRING} locale=([^&]*)
 RewriteRule ^/opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/(.*)$ /opac/%1/extras/slimpac/$1? [redirect]
 <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/>
@@ -238,22 +306,19 @@ RewriteRule ^/opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/(.*)$ /opac/%1/extras/slimpa
 # ----------------------------------------------------------------------------------
 # Run server-side XUL and XHTML through xmlent to load the correct XML entities
 # ----------------------------------------------------------------------------------
-RewriteEngine ON
 RewriteCond %{HTTP:Accept-Language} ([a-z]{2}-[A-Z]{2})
 RewriteRule ^/xul/     -       [E=locale:%1]
-RewriteRule ^/reports/ -       [E=locale:%1] [L]
+RewriteRule ^/reports/ -       [E=locale:%1]
 
 # Default to en-CA if we haven't matched a locale of the form xx-YY 
-RewriteEngine ON
 RewriteCond %{HTTP:Accept-Language} !([a-z]{2}-[A-Z]{2})
 RewriteRule ^/xul/     -       [E=locale:en-CA]
-RewriteRule ^/reports/ -       [E=locale:en-CA] [L]
+RewriteRule ^/reports/ -       [E=locale:en-CA]
 
 # Default to en-CA if we are just given en
-RewriteEngine ON
 RewriteCond %{ENV:locale} ^$ [OR]
 RewriteCond %{ENV:locale} ^en$
-RewriteRule - - [E=locale:en-CA] [L]
+RewriteRule . - [E=locale:en-CA]
 
 <LocationMatch /xul/.*\.x?html$>
     Options +Includes
@@ -286,7 +351,6 @@ RewriteRule - - [E=locale:en-CA] [L]
     allow from all
 
     # Force clients to use HTTPS
-    RewriteEngine On
     RewriteCond %{HTTPS} !=on [NC]
     RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
 </Location>
@@ -336,6 +400,13 @@ RewriteRule - - [E=locale:en-CA] [L]
     PerlSendHeader On
     allow from all
 </Location>
+<Location /opac/extras/sru_auth>
+    SetHandler perl-script
+    PerlHandler OpenILS::WWW::SuperCat::sru_auth_search
+    Options +ExecCGI
+    PerlSendHeader On
+    allow from all
+</Location>
 <Location /opac/extras/feed/freshmeat>
     SetHandler perl-script
     PerlHandler OpenILS::WWW::SuperCat::changes_feed
@@ -350,7 +421,14 @@ RewriteRule - - [E=locale:en-CA] [L]
     PerlSendHeader On
     allow from all
 </Location>    
-       
+<Location /opac/extras/startwith>
+    SetHandler perl-script
+    PerlHandler OpenILS::WWW::SuperCat::string_startwith
+    Options +ExecCGI
+    PerlSendHeader On
+    allow from all
+</Location>    
+
 # ----------------------------------------------------------------------------------
 # Module for displaying OpenSRF API documentation
 # ----------------------------------------------------------------------------------
@@ -413,6 +491,17 @@ RewriteRule - - [E=locale:en-CA] [L]
     allow from all
 </Location>
 
+<Location /opac/extras/circ>
+    SetHandler perl-script
+    PerlSetVar OILSProxyTitle "Circ Extras Login"
+    PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to export records"
+    PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
+    PerlHandler OpenILS::WWW::Proxy
+    Options +ExecCGI
+    PerlSendHeader On
+    allow from all
+</Location>
+
 # ----------------------------------------------------------------------------------
 # Reporting output lives here
 # ----------------------------------------------------------------------------------
@@ -449,15 +538,28 @@ RewriteRule - - [E=locale:en-CA] [L]
     Options +Includes
     AddOutputFilter INCLUDES;XMLENT .xhtml
 </LocationMatch>
+
 <LocationMatch /reports/fm_IDL.xml>
-    Options +Includes
-    XMLEntStripDoctype "yes"
-    XMLEntStripComments "no"
-    XMLEntContentType "text/xml; charset=utf-8"
-    AddOutputFilter INCLUDES;XMLENT .xml
+    IDLChunkStripPI "yes"
+    IDLChunkEscapeScript "no"
+    IDLChunkStripComments "yes"
+    IDLChunkStripDoctype "yes"
+    IDLChunkContentType "application/xml; charset=utf-8"
+    AddOutputFilter INCLUDES;IDLCHUNK .xml
 </LocationMatch>
 
 # ----------------------------------------------------------------------------------
+# EDI Message viewer
+# ----------------------------------------------------------------------------------
+<Location /edi>
+    SetHandler perl-script
+    PerlHandler OpenILS::WWW::EDI
+    Options +ExecCGI
+    PerlSendHeader On
+    allow from all
+</Location>    
+
+# ----------------------------------------------------------------------------------
 # XML-RPC gateway
 # ----------------------------------------------------------------------------------
 <Location /xml-rpc>
@@ -471,9 +573,9 @@ RewriteRule - - [E=locale:en-CA] [L]
 # ----------------------------------------------------------------------------------
 # Conify - next-generation Evergreen administration interface
 # ----------------------------------------------------------------------------------
-RewriteEngine on
 RewriteRule ^/conify/([a-z]{2}-[A-Z]{2})/global/(.*)$ /conify/global/$2 [E=locale:$1,L]
 <Location /conify>
+    Options +Includes
     XMLEntStripPI "yes"
     XMLEntEscapeScript "no"
     XMLEntStripComments "no"
@@ -495,7 +597,6 @@ RewriteRule ^/conify/([a-z]{2}-[A-Z]{2})/global/(.*)$ /conify/global/$2 [E=local
 # ----------------------------------------------------------------------------------
 RedirectMatch 301 ^/vandelay/vandelay.xml(.*)$ /vandelay/en-CA/vandelay.xml$1
 
-RewriteEngine on
 RewriteRule ^/vandelay/([a-z]{2}-[A-Z]{2})/(.*)$ /vandelay/$2 [E=locale:$1]
 
 <LocationMatch /vandelay.*xml>
@@ -508,7 +609,6 @@ RewriteRule ^/vandelay/([a-z]{2}-[A-Z]{2})/(.*)$ /vandelay/$2 [E=locale:$1]
        SetHandler perl-script
        PerlSetVar OILSProxyTitle "Vandelay Login"
        PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to import MARC records"
-
        PerlSetVar OILSProxyPermissions "IMPORT_MARC"
        PerlHandler OpenILS::WWW::Proxy
        Options +ExecCGI
@@ -523,13 +623,10 @@ RewriteRule ^/vandelay/([a-z]{2}-[A-Z]{2})/(.*)$ /vandelay/$2 [E=locale:$1]
 </Location>
 
 # OpenURL 0.1 searching based on OpenSearch
-RewriteEngine on
 RewriteMap openurl prg:/openils/bin/openurl_map.pl
 RewriteCond %{QUERY_STRING} (^.*$)
 RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
 
-
-
 # General Evergreen web template processor
 <Location /eg>
     SetHandler perl-script
@@ -547,4 +644,40 @@ RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
     SetHandler None
 </LocationMatch>
 
+# ----------------------------------------------------------------------------------
+# Some mod_deflate logging setup
+# ----------------------------------------------------------------------------------
+<IfModule mod_deflate.c>
+    DeflateFilterNote Input instream
+    DeflateFilterNote Output outstream
+    DeflateFilterNote Ratio ratio
+
+    LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
+    CustomLog /var/log/apache2/deflate_log deflate
+</IfModule>
+
+<Location /IDL2js>
+
+    SetHandler perl-script
+    PerlHandler OpenILS::WWW::IDL2js
+    Options +ExecCGI
+    PerlSendHeader On
+    allow from all
+
+    <IfModule mod_headers.c>
+        Header append Cache-Control "public"
+    </IFModule>
+
+    <IfModule mod_deflate.c>
+        SetOutputFilter DEFLATE
+        BrowserMatch ^Mozilla/4 gzip-only-text/html
+        BrowserMatch ^Mozilla/4\.0[678] no-gzip
+        BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
+        SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
+        <IfModule mod_headers.c>
+            Header append Vary User-Agent env=!dont-vary
+        </IfModule>
+    </IfModule>
+</Location>
+