From 961cc8f53a83dd08152e30a4d6cfc4f3ebb57e94 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Sun, 22 May 2011 08:45:53 -0400 Subject: [PATCH] Update Apache configuration to rel_2_0 standards Signed-off-by: Dan Scott --- apache/eg_vhost.conf | 181 ++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 157 insertions(+), 24 deletions(-) diff --git a/apache/eg_vhost.conf b/apache/eg_vhost.conf index 912dffa523..872882381d 100644 --- a/apache/eg_vhost.conf +++ b/apache/eg_vhost.conf @@ -166,9 +166,9 @@ RewriteRule - - [E=locale:%1] [L] # ---------------------------------------------------------------------------------- # Configure the OPAC # ---------------------------------------------------------------------------------- - -AddOutputFilterByType DEFLATE text/css text/javascript application/javascript - +# +#AddOutputFilterByType DEFLATE text/css text/javascript application/javascript +# 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 + # ---------------------------------------------------------------------------------- + + 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 + + + Header append Vary User-Agent env=!dont-vary + + + + + # ---------------------------------------------------------------------------------- + # Some mod_deflate fun + # ---------------------------------------------------------------------------------- + + 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 + + + Header append Vary User-Agent env=!dont-vary + + + + + + + # ---------------------------------------------------------------------------------- + # Some mod_deflate fun + # ---------------------------------------------------------------------------------- + + 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 + + + Header append Vary User-Agent env=!dont-vary + + + + # ---------------------------------------------------------------------------------- # Force SSL on the OPAC's "My Account" page # ---------------------------------------------------------------------------------- # Removed to test load balancer -# SSLRequireSSL + SSLRequireSSL @@ -228,7 +297,6 @@ AddOutputFilterByType DEFLATE text/css text/javascript application/javascript AddType application/xhtml+xml .xml -RewriteEngine ON RewriteCond %{QUERY_STRING} locale=([^&]*) RewriteRule ^/opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/(.*)$ /opac/%1/extras/slimpac/$1? [redirect] @@ -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] 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] @@ -336,6 +400,13 @@ RewriteRule - - [E=locale:en-CA] [L] PerlSendHeader On allow from all + + SetHandler perl-script + PerlHandler OpenILS::WWW::SuperCat::sru_auth_search + Options +ExecCGI + PerlSendHeader On + allow from all + SetHandler perl-script PerlHandler OpenILS::WWW::SuperCat::changes_feed @@ -350,7 +421,14 @@ RewriteRule - - [E=locale:en-CA] [L] PerlSendHeader On allow from all - + + SetHandler perl-script + PerlHandler OpenILS::WWW::SuperCat::string_startwith + Options +ExecCGI + PerlSendHeader On + allow from all + + # ---------------------------------------------------------------------------------- # Module for displaying OpenSRF API documentation # ---------------------------------------------------------------------------------- @@ -413,6 +491,17 @@ RewriteRule - - [E=locale:en-CA] [L] allow from all + + 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 + + # ---------------------------------------------------------------------------------- # Reporting output lives here # ---------------------------------------------------------------------------------- @@ -449,15 +538,28 @@ RewriteRule - - [E=locale:en-CA] [L] Options +Includes AddOutputFilter INCLUDES;XMLENT .xhtml + - 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 # ---------------------------------------------------------------------------------- +# EDI Message viewer +# ---------------------------------------------------------------------------------- + + SetHandler perl-script + PerlHandler OpenILS::WWW::EDI + Options +ExecCGI + PerlSendHeader On + allow from all + + +# ---------------------------------------------------------------------------------- # XML-RPC gateway # ---------------------------------------------------------------------------------- @@ -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] + 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] @@ -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] # 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 SetHandler perl-script @@ -547,4 +644,40 @@ RewriteRule ^/openurl$ ${openurl:%1} [NE,PT] SetHandler None +# ---------------------------------------------------------------------------------- +# Some mod_deflate logging setup +# ---------------------------------------------------------------------------------- + + 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 + + + + + SetHandler perl-script + PerlHandler OpenILS::WWW::IDL2js + Options +ExecCGI + PerlSendHeader On + allow from all + + + Header append Cache-Control "public" + + + + 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 + + Header append Vary User-Agent env=!dont-vary + + + + -- 2.11.0