+++ /dev/null
-# :vim set syntax apache
-
-LogLevel info
-# - log locally
-CustomLog /var/log/apache2/access.log combined
-ErrorLog /var/log/apache2/error.log
-# - log to syslog
-# CustomLog "|/usr/bin/logger -p local7.info" common
-# ErrorLog "|logger -p local7.error"
-
-
-# ----------------------------------------------------------------------------------
-# Set up Perl
-# ----------------------------------------------------------------------------------
-
-# - needed by CGIs
-PerlRequire /etc/apache2/startup.pl
-PerlChildInitHandler OpenILS::WWW::Reporter::child_init
-PerlChildInitHandler OpenILS::WWW::SuperCat::child_init
-PerlChildInitHandler OpenILS::WWW::AddedContent::child_init
-PerlChildInitHandler OpenILS::WWW::PasswordReset::child_init
-PerlChildInitHandler OpenILS::WWW::AutoSuggest::child_init
-
-# ----------------------------------------------------------------------------------
-# Set some defaults for our working directories
-# ----------------------------------------------------------------------------------
-<Directory /openils/var/web>
- Order allow,deny
- Allow from all
-</Directory>
-
-
-# ----------------------------------------------------------------------------------
-# XUL directory
-# ----------------------------------------------------------------------------------
-<Directory /openils/var/web/xul>
- Options Indexes FollowSymLinks
- AllowOverride None
- Order allow,deny
- Allow from all
-</Directory>
-
-
-# ----------------------------------------------------------------------------------
-# Remove the language portion from the URL
-# ----------------------------------------------------------------------------------
-AliasMatch ^/opac/.*/skin/(.*)/(.*)/(.*) /openils/var/web/opac/skin/$1/$2/$3
-AliasMatch ^/opac/.*/extras/slimpac/(.*) /openils/var/web/opac/extras/slimpac/$1
-AliasMatch ^/opac/.*/extras/selfcheck/(.*) /openils/var/web/opac/extras/selfcheck/$1
-
-
-
-# ----------------------------------------------------------------------------------
-# System config CGI scripts go here
-# ----------------------------------------------------------------------------------
-Alias /cgi-bin/offline/ "/openils/var/cgi-bin/offline/"
-<Directory "/openils/var/cgi-bin/offline">
- AddHandler cgi-script .cgi .pl
- AllowOverride None
- Options None
- Order deny,allow
- Deny from all
- Allow from 10.0.0.0/8
- Options FollowSymLinks ExecCGI Indexes
-</Directory>
-
-
-# ----------------------------------------------------------------------------------
-# Updates folder
-# ----------------------------------------------------------------------------------
-Alias /updates/ "/openils/var/updates/pub/"
-<Directory "/openils/var/updates/pub">
- <Files check>
- ForceType cgi-script
- </Files>
- <Files update.rdf>
- ForceType cgi-script
- </Files>
- <Files manualupdate.html>
- ForceType cgi-script
- </Files>
- <Files download>
- ForceType cgi-script
- </Files>
- AllowOverride None
- Options None
- Allow from all
- Options ExecCGI
-</Directory>
-
-
-# ----------------------------------------------------------------------------------
-# OPTIONAL: Set how long the client will cache our content. Change to suit
-# ----------------------------------------------------------------------------------
-ExpiresActive On
-ExpiresDefault "access plus 1 month"
-ExpiresByType text/html "access plus 18 hours"
-ExpiresByType application/xhtml+xml "access plus 18 hours"
-ExpiresByType application/x-javascript "access plus 18 hours"
-ExpiresByType application/javascript "access plus 18 hours"
-ExpiresByType text/css "access plus 50 minutes"
-
-# ----------------------------------------------------------------------------------
-# Set up our SSL virtual host
-# ----------------------------------------------------------------------------------
-#Listen 443
-NameVirtualHost *:443
-<VirtualHost *:443>
- DocumentRoot "/openils/var/web"
- ServerName localhost:443
- ServerAlias 127.0.0.1:443
- SSLEngine on
- SSLHonorCipherOrder On
- SSLCipherSuite ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH:!AESGCM
-
- # If you don't have an SSL cert, you can create self-signed
- # certificate and key with:
- # openssl req -new -x509 -nodes -out server.crt -keyout server.key
- SSLCertificateFile ssl/server.crt
- SSLCertificateKeyFile ssl/server.key
-
- # - absorb the shared virtual host settings
- Include eg_vhost.conf
-
- # help IE along with SSL pages
- SetEnvIf User-Agent ".*MSIE [1-5].*" \
- nokeepalive ssl-unclean-shutdown \
- downgrade-1.0 force-response-1.0
-
- SetEnvIf User-Agent ".*MSIE [6-9].*" \
- ssl-unclean-shutdown
-
-</VirtualHost>
-
-# ----------------------------------------------------------------------------------
-# Set up our main virtual host
-# Port 80 comes after 443 to avoid "unknown protocol speaking not SSL to HTTPS port!?"
-# errors, per http://wiki.apache.org/httpd/InternalDummyConnection
-# ----------------------------------------------------------------------------------
-
-# Commented to avoid warnings from duplicate "NameVirtualHost: *80" directives
-#NameVirtualHost *:80
-<VirtualHost *:80>
- ServerName localhost:80
- ServerAlias 127.0.0.1:80
- DocumentRoot /openils/var/web/
- DirectoryIndex index.xml index.html index.xhtml
- # - absorb the shared virtual host settings
- Include eg_vhost.conf
-</VirtualHost>
-
--- /dev/null
+# :vim set syntax apache
+
+LogLevel info
+# - log locally
+# CustomLog /var/log/apache2/access.log combined
+# ErrorLog /var/log/apache2/error.log
+# - log to syslog
+CustomLog "|/usr/bin/logger -p local7.info" common
+ErrorLog syslog:local7
+
+
+# ----------------------------------------------------------------------------------
+# Set up Perl
+# ----------------------------------------------------------------------------------
+
+# - needed by CGIs
+PerlRequire /etc/apache2/eg_startup
+PerlChildInitHandler OpenILS::WWW::Reporter::child_init
+PerlChildInitHandler OpenILS::WWW::SuperCat::child_init
+PerlChildInitHandler OpenILS::WWW::AddedContent::child_init
+PerlChildInitHandler OpenILS::WWW::PasswordReset::child_init
+PerlChildInitHandler OpenILS::WWW::AutoSuggest::child_init
+
+# ----------------------------------------------------------------------------------
+# Set some defaults for our working directories
+# ----------------------------------------------------------------------------------
+<Directory @localstatedir@/web>
+ Order allow,deny
+ Allow from all
+</Directory>
+
+
+# ----------------------------------------------------------------------------------
+# XUL directory
+# ----------------------------------------------------------------------------------
+<Directory @localstatedir@/web/xul>
+ Options Indexes FollowSymLinks
+ AllowOverride None
+ Order allow,deny
+ Allow from all
+</Directory>
+
+
+# ----------------------------------------------------------------------------------
+# Remove the language portion from the URL
+# ----------------------------------------------------------------------------------
+AliasMatch ^/opac/.*/skin/(.*)/(.*)/(.*) @localstatedir@/web/opac/skin/$1/$2/$3
+AliasMatch ^/opac/.*/extras/slimpac/(.*) @localstatedir@/web/opac/extras/slimpac/$1
+AliasMatch ^/opac/.*/extras/selfcheck/(.*) @localstatedir@/web/opac/extras/selfcheck/$1
+
+
+
+# ----------------------------------------------------------------------------------
+# System config CGI scripts go here
+# ----------------------------------------------------------------------------------
+Alias /cgi-bin/offline/ "@localstatedir@/cgi-bin/offline/"
+<Directory "@localstatedir@/cgi-bin/offline">
+ AddHandler cgi-script .cgi .pl
+ AllowOverride None
+ Options None
+ Order deny,allow
+ Deny from all
+ Allow from 10.0.0.0/8
+ Options FollowSymLinks ExecCGI Indexes
+</Directory>
+
+
+# ----------------------------------------------------------------------------------
+# Updates folder
+# ----------------------------------------------------------------------------------
+Alias /updates/ "@localstatedir@/updates/pub/"
+<Directory "@localstatedir@/updates/pub">
+ <Files check>
+ ForceType cgi-script
+ </Files>
+ <Files update.rdf>
+ ForceType cgi-script
+ </Files>
+ <Files manualupdate.html>
+ ForceType cgi-script
+ </Files>
+ <Files download>
+ ForceType cgi-script
+ </Files>
+ AllowOverride None
+ Options None
+ Allow from all
+ Options ExecCGI
+</Directory>
+
+
+# ----------------------------------------------------------------------------------
+# OPTIONAL: Set how long the client will cache our content. Change to suit
+# ----------------------------------------------------------------------------------
+ExpiresActive On
+ExpiresDefault "access plus 1 month"
+ExpiresByType text/html "access plus 18 hours"
+ExpiresByType application/xhtml+xml "access plus 18 hours"
+ExpiresByType application/x-javascript "access plus 18 hours"
+ExpiresByType application/javascript "access plus 18 hours"
+ExpiresByType text/css "access plus 50 minutes"
+
+# ----------------------------------------------------------------------------------
+# Set up our SSL virtual host
+# ----------------------------------------------------------------------------------
+#Listen 443
+NameVirtualHost *:443
+<VirtualHost *:443>
+ DocumentRoot "@localstatedir@/web"
+ ServerName localhost:443
+ ServerAlias 127.0.0.1:443
+ SSLEngine on
+ SSLHonorCipherOrder On
+ SSLCipherSuite ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH:!AESGCM
+
+ # If you don't have an SSL cert, you can create self-signed
+ # certificate and key with:
+ # openssl req -new -x509 -nodes -out server.crt -keyout server.key
+ SSLCertificateFile ssl/server.crt
+ SSLCertificateKeyFile ssl/server.key
+
+ # - absorb the shared virtual host settings
+ Include eg_vhost.conf
+
+ # help IE along with SSL pages
+ SetEnvIf User-Agent ".*MSIE [1-5].*" \
+ nokeepalive ssl-unclean-shutdown \
+ downgrade-1.0 force-response-1.0
+
+ SetEnvIf User-Agent ".*MSIE [6-9].*" \
+ ssl-unclean-shutdown
+
+</VirtualHost>
+
+# ----------------------------------------------------------------------------------
+# Set up our main virtual host
+# Port 80 comes after 443 to avoid "unknown protocol speaking not SSL to HTTPS port!?"
+# errors, per http://wiki.apache.org/httpd/InternalDummyConnection
+# ----------------------------------------------------------------------------------
+
+# Commented to avoid warnings from duplicate "NameVirtualHost: *80" directives
+#NameVirtualHost *:80
+<VirtualHost *:80>
+ ServerName localhost:80
+ ServerAlias 127.0.0.1:80
+ DocumentRoot @localstatedir@/web/
+ DirectoryIndex index.xml index.html index.xhtml
+ # - absorb the shared virtual host settings
+ Include eg_vhost.conf
+</VirtualHost>
+
--- /dev/null
+#!/usr/bin/perl
+use OpenSRF::AppSession;
+
+# default ingress value for all Apache/mod_perl clients
+OpenSRF::AppSession->ingress('apache');
+
+use OpenILS::WWW::Exporter qw( @sysconfdir@/opensrf_core.xml );
+use OpenILS::WWW::SuperCat qw( @sysconfdir@/opensrf_core.xml );
+use OpenILS::WWW::AddedContent qw( @sysconfdir@/opensrf_core.xml );
+use OpenILS::WWW::Proxy ('@sysconfdir@/opensrf_core.xml');
+use OpenILS::WWW::Vandelay qw( @sysconfdir@/opensrf_core.xml );
+use OpenILS::WWW::TemplateBatchBibUpdate qw( @sysconfdir@/opensrf_core.xml );
+use OpenILS::WWW::EGWeb;
+use OpenILS::WWW::PasswordReset ('@sysconfdir@/opensrf_core.xml');
+use OpenILS::WWW::IDL2js ('@sysconfdir@/opensrf_core.xml');
+use OpenILS::WWW::FlatFielder;
+
+# - Uncoment the following 2 lines to make use of the IP redirection code
+# - The IP file should to contain a map with the following format:
+# - actor.org_unit.shortname <start_ip> <end_ip>
+# - e.g. LIB123 10.0.0.1 10.0.0.254
+
+#use OpenILS::WWW::Redirect qw(@sysconfdir@/opensrf_core.xml);
+#OpenILS::WWW::Redirect->parse_ips_file('@sysconfdir@/lib_ips.txt');
+
+
+
+1;
+
+++ /dev/null
-# ----------------------------------------------------------------------------------
-# This is the global Evergreen virtual host config. Anything you want published
-# through all virtual hosts (port 80, port 443, etc.) should live in here.
-# ----------------------------------------------------------------------------------
-
-# ----------------------------------------------------------------------------------
-# Point / to the opac - if you have a custom skin or locale, point at it here
-# ----------------------------------------------------------------------------------
-RedirectMatch 301 ^/$ /opac/en-US/skin/default/xml/index.xml
-
-# ----------------------------------------------------------------------------------
-# Point / to the IP address redirector
-# ----------------------------------------------------------------------------------
-#<LocationMatch ^/$>
-# SetHandler perl-script
-# PerlHandler OpenILS::WWW::Redirect
-# Options +ExecCGI
-# PerlSendHeader On
-# #PerlSetVar OILSRedirectSkin "default"
-# # OILSRedirectDepth defaults to the depth of the branch that the OPAC was directed to
-# #PerlSetVar OILSRedirectDepth "0"
-# #PerlSetVar OILSRedirectLocale "en-US"
-# # Use the template-toolkit opac
-# #PerlSetVar OILSRedirectTpac "true"
-# allow from all
-#</LocationMatch>
-
-
-# ----------------------------------------------------------------------------------
-# Assign a default locale to the accessible OPAC
-# ----------------------------------------------------------------------------------
-RedirectMatch 301 ^/opac/extras/slimpac/start.html$ /opac/en-US/extras/slimpac/start.html
-RedirectMatch 301 ^/opac/extras/slimpac/advanced.html$ /opac/en-US/extras/slimpac/advanced.html
-
-# ----------------------------------------------------------------------------------
-# Configure the gateway
-# ----------------------------------------------------------------------------------
-OSRFGatewayConfig /openils/conf/opensrf_core.xml
-# Translator memcache server. Default is localhost
-# OSRFTranslatorCacheServer 127.0.0.1:11211
-
-
-# ----------------------------------------------------------------------------------
-# Added content plugin
-# ----------------------------------------------------------------------------------
-<Location /opac/extras/ac/>
- SetHandler perl-script
- PerlHandler OpenILS::WWW::AddedContent
- Options +ExecCGI
- PerlSendHeader On
- allow from all
-</Location>
-
-# Autosuggest for searches
-<Location /opac/extras/autosuggest>
- SetHandler perl-script
- PerlHandler OpenILS::WWW::AutoSuggest
- PerlSendHeader On
- Allow from All
-</Location>
-
-# Flattener service
-<Location /opac/extras/flattener>
- SetHandler perl-script
- PerlHandler OpenILS::WWW::FlatFielder
- PerlSendHeader On
- Allow from All
-</Location>
-
-# ----------------------------------------------------------------------------------
-# Replace broken cover images with a transparent GIF by default
-# ----------------------------------------------------------------------------------
-RewriteEngine ON
-RewriteRule ^/opac/extras/ac/jacket/(small|medium|large)/$ \
- /opac/images/blank.png [P,L]
-
-# ----------------------------------------------------------------------------------
-# Add the row ID (RID) and date so we can make unAPI happy
-# ----------------------------------------------------------------------------------
-RewriteCond %{QUERY_STRING} (^r|&r)=(\d+)
-RewriteRule . - [E=OILS_OPAC_RID:%2,E=OILS_TIME_YEAR:%{TIME_YEAR}]
-
-# ----------------------------------------------------------------------------------
-# Pull the locale from the URL
-# ----------------------------------------------------------------------------------
-RewriteCond %{REQUEST_URI} ^/opac/(.*?)/
-RewriteRule . - [E=locale:%1]
-
-# ----------------------------------------------------------------------------------
-# For sanity reasons, default indexes to Off
-# ----------------------------------------------------------------------------------
-Options -Indexes
-
-# ----------------------------------------------------------------------------------
-# Configure the OPAC
-# ----------------------------------------------------------------------------------
-<LocationMatch /opac/>
- AddType application/xhtml+xml .xml
-
- # - configure mod_xmlent
- XMLEntStripPI "yes"
- XMLEntEscapeScript "no"
- XMLEntStripComments "yes"
- XMLEntContentType "text/html; charset=utf-8"
- # forces quirks mode which we want for now
- XMLEntStripDoctype "yes"
-
- # - set up the include handlers
- Options +Includes
- AddOutputFilter INCLUDES .xsl
- AddOutputFilter INCLUDES;XMLENT .xml
-
- SetEnvIf Request_URI ".*" OILS_OPAC_BASE=/opac/
-
- # This gives you the option to configure a different host to serve OPAC images from
- # Specify the hostname (without protocol) and path to the images. Protocol will
- # be determined at runtime
- #SetEnvIf Request_URI ".*" OILS_OPAC_IMAGES_HOST=static.example.org/opac/
-
- # 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=static.example.org/opac/
- #SetEnvIf Request_URI ".*" OILS_OPAC_JS_HOST=static.example.org/opac/
-
- # If you are not able to serve static content via https and
- # wish to force http:// (and are comfortable with mixed-content
- # warnings in client browsers), set this:
- #SetEnvIf Request_URI ".*" OILS_OPAC_STATIC_PROTOCOL=http
-
- # If you would prefer to fall back to your non-static servers for
- # https pages, avoiding mixed-content warnings in client browsers
- # 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
- #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.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
-
- # If set, the skin uses the combined JS file at $SKINDIR/js/combined.js
- #SetEnv OILS_OPAC_COMBINED_JS 1
-
-</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 //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>
-
-# ----------------------------------------------------------------------------------
-# Force SSL on the OPAC's "My Account" page
-# ----------------------------------------------------------------------------------
-<LocationMatch .*/myopac.xml>
- SSLRequireSSL
-</LocationMatch>
-
-<LocationMatch /opac/extras/>
- # Force to en-US for now to satisfy bbags.xml
- SetEnv locale en-US
- Options +Includes
- AddOutputFilter INCLUDES .xml
- AddType application/xhtml+xml .xml
-</LocationMatch>
-
-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/>
- AddOutputFilter INCLUDES;XMLENT .html
-</LocationMatch>
-
-# ----------------------------------------------------------------------------------
-# Run server-side XUL and XHTML through xmlent to load the correct XML entities
-# ----------------------------------------------------------------------------------
-RewriteCond %{HTTP:Accept-Language} ^([a-z]{2}-[A-Z]{2})$
-# Default to en-US if we haven't matched a locale of the form xx-YY
-RewriteRule .? - [S=4]
-RewriteRule ^/xul/ - [E=locale:en-US]
-RewriteRule ^/reports/ - [E=locale:en-US]
-RewriteRule .? - [E=locale:en-US]
-RewriteRule .? - [S=3]
-# Otherwise, set our real locale
-RewriteRule ^/xul/ - [E=locale:%{HTTP:Accept-Language}]
-RewriteRule ^/reports/ - [E=locale:%{HTTP:Accept-Language}]
-RewriteRule .? - [E=locale:%{HTTP:Accept-Language}]
-
-<LocationMatch /xul/.*\.x?html$>
- Options +Includes
- XMLEntEscapeScript "no"
- XMLEntStripComments "yes"
- XMLEntStripPI "yes"
- XMLEntStripDoctype "yes"
- XMLEntContentType "text/html; charset=utf-8"
- AddOutputFilter INCLUDES;XMLENT .xhtml
- AddOutputFilter INCLUDES;XMLENT .html
- SetEnv no-gzip
- allow from all
-</LocationMatch>
-
-
-<LocationMatch /xul/.*\.xul$>
- Options +Includes
- XMLEntContentType "application/vnd.mozilla.xul+xml"
- AddOutputFilter INCLUDES;XMLENT .xul
- SetEnv no-gzip
- allow from all
-</LocationMatch>
-
-# ----------------------------------------------------------------------------------
-# Self-serve password interface
-# ----------------------------------------------------------------------------------
-<Location /opac/password>
- SetHandler perl-script
- PerlHandler OpenILS::WWW::PasswordReset::password_reset
- Options +ExecCGI
- PerlSendHeader On
- allow from all
-
- # Force clients to use HTTPS
- RewriteCond %{HTTPS} !=on [NC]
- RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
-</Location>
-
-# ----------------------------------------------------------------------------------
-# Supercat feeds
-# ----------------------------------------------------------------------------------
-<Location /opac/extras/oisbn>
- SetHandler perl-script
- PerlHandler OpenILS::WWW::SuperCat::oisbn
- Options +ExecCGI
- PerlSendHeader On
- allow from all
-</Location>
-<Location /opac/extras/supercat>
- SetHandler perl-script
- PerlHandler OpenILS::WWW::SuperCat::supercat
- Options +ExecCGI
- PerlSendHeader On
- allow from all
-</Location>
-<Location /opac/extras/unapi>
- SetHandler perl-script
- PerlHandler OpenILS::WWW::SuperCat::unapi
- Options +ExecCGI
- PerlSendHeader On
- allow from all
-</Location>
-<Location /opac/extras/feed/bookbag>
- SetHandler perl-script
- PerlHandler OpenILS::WWW::SuperCat::bookbag_feed
- Options +ExecCGI
- PerlSendHeader On
- allow from all
-</Location>
-<Location /opac/extras/opensearch>
- SetHandler perl-script
- PerlHandler OpenILS::WWW::SuperCat::opensearch_feed
- Options +ExecCGI
- PerlSendHeader On
- allow from all
-</Location>
-<Location /opac/extras/sru>
- SetHandler perl-script
- PerlHandler OpenILS::WWW::SuperCat::sru_search
- Options +ExecCGI
- 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
- Options +ExecCGI
- PerlSendHeader On
- allow from all
-</Location>
-<Location /opac/extras/browse>
- SetHandler perl-script
- PerlHandler OpenILS::WWW::SuperCat::string_browse
- Options +ExecCGI
- 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
-# ----------------------------------------------------------------------------------
-<Location /opac/extras/docgen.xsl>
- AddOutputFilter INCLUDES .xsl
-</Location>
-
-# ----------------------------------------------------------------------------------
-# Module for processing staff-client offline scripts lives here
-# ----------------------------------------------------------------------------------
-<Directory "/openils/var/cgi-bin/offline">
- AddHandler cgi-script .pl
- AllowOverride None
- Options +ExecCGI
- allow from all
-</Directory>
-
-
-# ----------------------------------------------------------------------------------
-# XXX Note, it's important to explicitly set the JSON encoding style
-# (OSRFGatewayLegacyJSON), since the default encoding style will likely change
-# with OpenSRF 1.0
-# ----------------------------------------------------------------------------------
-# OpenSRF JSON legacy gateway
-# ----------------------------------------------------------------------------------
-<Location /gateway>
- SetHandler osrf_json_gateway_module
- OSRFGatewayLegacyJSON "true"
- allow from all
-</Location>
-# ----------------------------------------------------------------------------------
-# New-style OpenSRF JSON gateway
-# ----------------------------------------------------------------------------------
-<Location /osrf-gateway-v1>
- SetHandler osrf_json_gateway_module
- OSRFGatewayLegacyJSON "false"
- allow from all
-</Location>
-
-# ----------------------------------------------------------------------------------
-# OpenSRF-over-HTTP translator
-# (http://open-ils.org/dokuwiki/doku.php?id=opensrf_over_http)
-# ----------------------------------------------------------------------------------
-<Location /osrf-http-translator>
- SetHandler osrf_http_translator_module
- allow from all
-</Location>
-
-# ----------------------------------------------------------------------------------
-# The exporter lives here
-# ----------------------------------------------------------------------------------
-<Location /exporter>
- SetHandler perl-script
- AuthType Basic
- AuthName "Exporter Login"
- PerlOptions +GlobalRequest
- PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
- PerlAuthenHandler OpenILS::WWW::Proxy::Authen
- require valid-user
- PerlHandler OpenILS::WWW::Exporter
- Options +ExecCGI
- PerlSendHeader On
- allow from all
-</Location>
-
-<Location /opac/extras/merge_template>
- SetHandler perl-script
- AuthType Basic
- AuthName "Batch Update Login"
- PerlOptions +GlobalRequest
- PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
- PerlAuthenHandler OpenILS::WWW::Proxy::Authen
- require valid-user
- PerlHandler OpenILS::WWW::TemplateBatchBibUpdate
- PerlSendHeader On
- Options +ExecCGI
- allow from all
-</Location>
-
-<Location /opac/extras/circ>
- AuthType Basic
- AuthName "Circ Extras Login"
- PerlOptions +GlobalRequest
- PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
- PerlAuthenHandler OpenILS::WWW::Proxy::Authen
- require valid-user
- Options +ExecCGI
- PerlSendHeader On
- allow from all
-</Location>
-
-<Location /collections>
- SetHandler perl-script
- AuthType Basic
- AuthName "Collections Login"
- PerlOptions +GlobalRequest
- PerlSetVar OILSProxyPermissions "money.collections_tracker.create"
- PerlAuthenHandler OpenILS::WWW::Proxy::Authen
- require valid-user
- Options +ExecCGI
- PerlSendHeader On
- allow from all
-</Location>
-
-
-# ----------------------------------------------------------------------------------
-# Reporting output lives here
-# ----------------------------------------------------------------------------------
-<Location /reporter/>
- AuthType Basic
- AuthName "Report Login"
- PerlOptions +GlobalRequest
- PerlSetVar OILSProxyPermissions "VIEW_REPORT_OUTPUT"
- PerlAuthenHandler OpenILS::WWW::Proxy::Authen
- require valid-user
- Options +ExecCGI
- PerlSendHeader On
- allow from all
-</Location>
-
-# ----------------------------------------------------------------------------------
-# Selfcheck interface
-# ----------------------------------------------------------------------------------
-<LocationMatch .*/selfcheck.xml>
- AuthType Basic
- AuthName "Self-check Login"
- PerlOptions +GlobalRequest
- PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
- PerlAuthenHandler OpenILS::WWW::Proxy::Authen
- require valid-user
- Options +ExecCGI
- PerlSendHeader On
- allow from all
-</LocationMatch>
-
-
-# ----------------------------------------------------------------------------------
-# Reports GUI
-# ----------------------------------------------------------------------------------
-<LocationMatch /reports>
- Options +Includes
- AddOutputFilter INCLUDES;XMLENT .xhtml
-</LocationMatch>
-
-<LocationMatch /reports/fm_IDL.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>
- SetHandler perl-script
- PerlHandler OpenILS::WWW::XMLRPCGateway
- Options +ExecCGI
- PerlSendHeader On
- allow from all
-</Location>
-
-# ----------------------------------------------------------------------------------
-# Conify - next-generation Evergreen administration interface
-# ----------------------------------------------------------------------------------
-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"
- XMLEntContentType "text/html; charset=utf-8"
- AddOutputFilter INCLUDES;XMLENT .html
-
- AuthType Basic
- AuthName "Dojo Admin Login"
- PerlOptions +GlobalRequest
- PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
- PerlAuthenHandler OpenILS::WWW::Proxy::Authen
- require valid-user
- Options +ExecCGI
- PerlSendHeader On
- allow from all
-</Location>
-
-<Location /vandelay-upload>
- SetHandler perl-script
- PerlHandler OpenILS::WWW::Vandelay::spool_marc
- Options +ExecCGI
- allow from all
-</Location>
-
-# OpenURL 0.1 searching based on OpenSearch
-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
- PerlHandler OpenILS::WWW::EGWeb
- Options +ExecCGI
- PerlSendHeader On
- allow from all
-
- PerlSetVar OILSWebBasePath "/eg"
- PerlSetVar OILSWebWebDir "/openils/var/web"
- PerlSetVar OILSWebDefaultTemplateExtension "tt2"
-
- # Enable Template-Toolkit error debugging messages (apache error log)
- PerlSetVar OILSWebDebugTemplate "true"
-
- # -------------------------------------------------------
- # Media Prefix. In the 3rd example, the protocol (http) is enforced
- #PerlSetVar OILSWebMediaPrefix "/media"
- #PerlSetVar OILSWebMediaPrefix "static.example.com/media"
- #PerlSetVar OILSWebMediaPrefix "http://static.example.com/media"
-
- # Locale messages files:
- #
- # These appear in pairs; the first represents the user agent
- # Accept-Language header locale, and the second represents
- # the fully-qualified path for the corresponding PO file that
- # contains the messages.
- #
- # If you enable two or more locales, then users will be able to
- # select their preferred locale from a locale picker in the TPAC.
- #
- #PerlAddVar OILSWebLocale "en"
- #PerlAddVar OILSWebLocale "/openils/var/data/locale/messages.en.po"
- #PerlAddVar OILSWebLocale "en_ca"
- #PerlAddVar OILSWebLocale "/openils/var/data/locale/en-CA.po"
- #PerlAddVar OILSWebLocale "fr_ca"
- #PerlAddVar OILSWebLocale "/openils/var/data/locale/fr-CA.po"
-
- # Set the default locale: defaults to en-US
- #PerlAddVar OILSWebDefaultLocale "fr_ca"
-
- # Templates will be loaded from the following paths in reverse order.
- PerlAddVar OILSWebTemplatePath "/openils/var/templates"
- #PerlAddVar OILSWebTemplatePath "/openils/var/templates_localskin"
-
- #-------------------------------------------------
- # Added Content Configuration
- #-------------------------------------------------
- # Content Cafe
- #SetEnv OILS_CONTENT_CAFE_USER MYUSER
- #SetEnv OILS_CONTENT_CAFE_PASS MYPASS
-
- # LibraryThing
- #SetEnv OILS_LIBRARYTHING_URL http://ltfl.librarything.com/forlibraries/widget.js?id=MYID
- #SetEnv OILS_LIBRARYTHING_HTTPS_URL https://ltfl.librarything.com/forlibraries/widget.js?id=MYID
-
- # ChiliFresh
- #SetEnv OILS_CHILIFRESH_ACCOUNT
- #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
- #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.chilifresh.com/on-site/js/evergreen.js
- #-------------------------------------------------
-
- <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 Cache-Control "public"
- Header append Vary User-Agent env=!dont-vary
- </IfModule>
- </IfModule>
-</Location>
-<LocationMatch ^/(images|css|js)/>
- # should pick up the default expire time from eg.conf...
- <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 Cache-Control "public"
- Header append Vary User-Agent env=!dont-vary
- </IfModule>
- </IfModule>
-</LocationMatch>
-<Location /eg/opac>
- PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGCatLoader"
- # Expire the HTML quickly since we're loading dynamic data for each page
- ExpiresActive On
- ExpiresByType text/html "access plus 5 seconds"
-</Location>
-<Location /eg/kpac>
- PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGKPacLoader"
- PerlSetVar KPacConfigFile "/openils/conf/kpac.xml.example"
- ExpiresActive On
- ExpiresByType text/html "access plus 5 seconds"
-</Location>
-
-# Note: the template processor will decline handling anything it does not
-# have an explicit configuration for, which means it will fall back to
-# Apache to serve the file. However, in the interest of speed, go ahead
-# and tell Apache to avoid asking OpenILS::WWW::EGWeb for static content.
-# Add more exemptions as needed.
-<LocationMatch ^/eg/.*(\.js|\.html|\.xhtml|\.xml|\.jpg|\.png|\.gif)$>
- 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
-
- # There are problems with XMLENT and mod_deflate - so lets disable it
- # This is where we don't have a pre-existing LocationMatch directive earlier
- <LocationMatch /opac/.*\.xml$>
- SetEnv no-gzip
- </LocationMatch>
- <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/.*\.html$>
- SetEnv no-gzip
- </LocationMatch>
- <LocationMatch /reports/.*\.xhtml$>
- SetEnv no-gzip
- </LocationMatch>
- <LocationMatch /conify/.*\.html$>
- SetEnv no-gzip
- </LocationMatch>
-</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>
-
-# Uncomment the following to force SSL for everything. Note that this defeats caching
-# and you will suffer a performance hit.
-#RewriteCond %{HTTPS} off
-#RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,R,L]
--- /dev/null
+# ----------------------------------------------------------------------------------
+# This is the global Evergreen virtual host config. Anything you want published
+# through all virtual hosts (port 80, port 443, etc.) should live in here.
+# ----------------------------------------------------------------------------------
+
+# ----------------------------------------------------------------------------------
+# Point / to the opac - if you have a custom skin or locale, point at it here
+# ----------------------------------------------------------------------------------
+RedirectMatch 301 ^/$ /opac/en-US/skin/default/xml/index.xml
+
+# ----------------------------------------------------------------------------------
+# Point / to the IP address redirector
+# ----------------------------------------------------------------------------------
+#<LocationMatch ^/$>
+# SetHandler perl-script
+# PerlHandler OpenILS::WWW::Redirect
+# Options +ExecCGI
+# PerlSendHeader On
+# #PerlSetVar OILSRedirectSkin "default"
+# # OILSRedirectDepth defaults to the depth of the branch that the OPAC was directed to
+# #PerlSetVar OILSRedirectDepth "0"
+# #PerlSetVar OILSRedirectLocale "en-US"
+# # Use the template-toolkit opac
+# #PerlSetVar OILSRedirectTpac "true"
+# allow from all
+#</LocationMatch>
+
+
+# ----------------------------------------------------------------------------------
+# Assign a default locale to the accessible OPAC
+# ----------------------------------------------------------------------------------
+RedirectMatch 301 ^/opac/extras/slimpac/start.html$ /opac/en-US/extras/slimpac/start.html
+RedirectMatch 301 ^/opac/extras/slimpac/advanced.html$ /opac/en-US/extras/slimpac/advanced.html
+
+# ----------------------------------------------------------------------------------
+# Configure the gateway
+# ----------------------------------------------------------------------------------
+OSRFGatewayConfig @sysconfdir@/opensrf_core.xml
+# Translator memcache server. Default is localhost
+# OSRFTranslatorCacheServer 127.0.0.1:11211
+
+
+# ----------------------------------------------------------------------------------
+# Added content plugin
+# ----------------------------------------------------------------------------------
+<Location /opac/extras/ac/>
+ SetHandler perl-script
+ PerlHandler OpenILS::WWW::AddedContent
+ Options +ExecCGI
+ PerlSendHeader On
+ allow from all
+</Location>
+
+# Autosuggest for searches
+<Location /opac/extras/autosuggest>
+ SetHandler perl-script
+ PerlHandler OpenILS::WWW::AutoSuggest
+ PerlSendHeader On
+ Allow from All
+</Location>
+
+# Flattener service
+<Location /opac/extras/flattener>
+ SetHandler perl-script
+ PerlHandler OpenILS::WWW::FlatFielder
+ PerlSendHeader On
+ Allow from All
+</Location>
+
+# ----------------------------------------------------------------------------------
+# Replace broken cover images with a transparent GIF by default
+# ----------------------------------------------------------------------------------
+RewriteEngine ON
+RewriteRule ^/opac/extras/ac/jacket/(small|medium|large)/$ \
+ /opac/images/blank.png [P,L]
+
+# ----------------------------------------------------------------------------------
+# Add the row ID (RID) and date so we can make unAPI happy
+# ----------------------------------------------------------------------------------
+RewriteCond %{QUERY_STRING} (^r|&r)=(\d+)
+RewriteRule . - [E=OILS_OPAC_RID:%2,E=OILS_TIME_YEAR:%{TIME_YEAR}]
+
+# ----------------------------------------------------------------------------------
+# Pull the locale from the URL
+# ----------------------------------------------------------------------------------
+RewriteCond %{REQUEST_URI} ^/opac/(.*?)/
+RewriteRule . - [E=locale:%1]
+
+# ----------------------------------------------------------------------------------
+# For sanity reasons, default indexes to Off
+# ----------------------------------------------------------------------------------
+Options -Indexes
+
+# ----------------------------------------------------------------------------------
+# Configure the OPAC
+# ----------------------------------------------------------------------------------
+<LocationMatch /opac/>
+ AddType application/xhtml+xml .xml
+
+ # - configure mod_xmlent
+ XMLEntStripPI "yes"
+ XMLEntEscapeScript "no"
+ XMLEntStripComments "yes"
+ XMLEntContentType "text/html; charset=utf-8"
+ # forces quirks mode which we want for now
+ XMLEntStripDoctype "yes"
+
+ # - set up the include handlers
+ Options +Includes
+ AddOutputFilter INCLUDES .xsl
+ AddOutputFilter INCLUDES;XMLENT .xml
+
+ SetEnvIf Request_URI ".*" OILS_OPAC_BASE=/opac/
+
+ # This gives you the option to configure a different host to serve OPAC images from
+ # Specify the hostname (without protocol) and path to the images. Protocol will
+ # be determined at runtime
+ #SetEnvIf Request_URI ".*" OILS_OPAC_IMAGES_HOST=static.example.org/opac/
+
+ # 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=static.example.org/opac/
+ #SetEnvIf Request_URI ".*" OILS_OPAC_JS_HOST=static.example.org/opac/
+
+ # If you are not able to serve static content via https and
+ # wish to force http:// (and are comfortable with mixed-content
+ # warnings in client browsers), set this:
+ #SetEnvIf Request_URI ".*" OILS_OPAC_STATIC_PROTOCOL=http
+
+ # If you would prefer to fall back to your non-static servers for
+ # https pages, avoiding mixed-content warnings in client browsers
+ # 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
+ #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.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
+
+ # If set, the skin uses the combined JS file at $SKINDIR/js/combined.js
+ #SetEnv OILS_OPAC_COMBINED_JS 1
+
+</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 //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>
+
+# ----------------------------------------------------------------------------------
+# Force SSL on the OPAC's "My Account" page
+# ----------------------------------------------------------------------------------
+<LocationMatch .*/myopac.xml>
+ SSLRequireSSL
+</LocationMatch>
+
+<LocationMatch /opac/extras/>
+ # Force to en-US for now to satisfy bbags.xml
+ SetEnv locale en-US
+ Options +Includes
+ AddOutputFilter INCLUDES .xml
+ AddType application/xhtml+xml .xml
+</LocationMatch>
+
+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/>
+ AddOutputFilter INCLUDES;XMLENT .html
+</LocationMatch>
+
+# ----------------------------------------------------------------------------------
+# Run server-side XUL and XHTML through xmlent to load the correct XML entities
+# ----------------------------------------------------------------------------------
+RewriteCond %{HTTP:Accept-Language} ^([a-z]{2}-[A-Z]{2})$
+# Default to en-US if we haven't matched a locale of the form xx-YY
+RewriteRule .? - [S=4]
+RewriteRule ^/xul/ - [E=locale:en-US]
+RewriteRule ^/reports/ - [E=locale:en-US]
+RewriteRule .? - [E=locale:en-US]
+RewriteRule .? - [S=3]
+# Otherwise, set our real locale
+RewriteRule ^/xul/ - [E=locale:%{HTTP:Accept-Language}]
+RewriteRule ^/reports/ - [E=locale:%{HTTP:Accept-Language}]
+RewriteRule .? - [E=locale:%{HTTP:Accept-Language}]
+
+<LocationMatch /xul/.*\.x?html$>
+ Options +Includes
+ XMLEntEscapeScript "no"
+ XMLEntStripComments "yes"
+ XMLEntStripPI "yes"
+ XMLEntStripDoctype "yes"
+ XMLEntContentType "text/html; charset=utf-8"
+ AddOutputFilter INCLUDES;XMLENT .xhtml
+ AddOutputFilter INCLUDES;XMLENT .html
+ SetEnv no-gzip
+ allow from all
+</LocationMatch>
+
+
+<LocationMatch /xul/.*\.xul$>
+ Options +Includes
+ XMLEntContentType "application/vnd.mozilla.xul+xml"
+ AddOutputFilter INCLUDES;XMLENT .xul
+ SetEnv no-gzip
+ allow from all
+</LocationMatch>
+
+# ----------------------------------------------------------------------------------
+# Self-serve password interface
+# ----------------------------------------------------------------------------------
+<Location /opac/password>
+ SetHandler perl-script
+ PerlHandler OpenILS::WWW::PasswordReset::password_reset
+ Options +ExecCGI
+ PerlSendHeader On
+ allow from all
+
+ # Force clients to use HTTPS
+ RewriteCond %{HTTPS} !=on [NC]
+ RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
+</Location>
+
+# ----------------------------------------------------------------------------------
+# Supercat feeds
+# ----------------------------------------------------------------------------------
+<Location /opac/extras/oisbn>
+ SetHandler perl-script
+ PerlHandler OpenILS::WWW::SuperCat::oisbn
+ Options +ExecCGI
+ PerlSendHeader On
+ allow from all
+</Location>
+<Location /opac/extras/supercat>
+ SetHandler perl-script
+ PerlHandler OpenILS::WWW::SuperCat::supercat
+ Options +ExecCGI
+ PerlSendHeader On
+ allow from all
+</Location>
+<Location /opac/extras/unapi>
+ SetHandler perl-script
+ PerlHandler OpenILS::WWW::SuperCat::unapi
+ Options +ExecCGI
+ PerlSendHeader On
+ allow from all
+</Location>
+<Location /opac/extras/feed/bookbag>
+ SetHandler perl-script
+ PerlHandler OpenILS::WWW::SuperCat::bookbag_feed
+ Options +ExecCGI
+ PerlSendHeader On
+ allow from all
+</Location>
+<Location /opac/extras/opensearch>
+ SetHandler perl-script
+ PerlHandler OpenILS::WWW::SuperCat::opensearch_feed
+ Options +ExecCGI
+ PerlSendHeader On
+ allow from all
+</Location>
+<Location /opac/extras/sru>
+ SetHandler perl-script
+ PerlHandler OpenILS::WWW::SuperCat::sru_search
+ Options +ExecCGI
+ 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
+ Options +ExecCGI
+ PerlSendHeader On
+ allow from all
+</Location>
+<Location /opac/extras/browse>
+ SetHandler perl-script
+ PerlHandler OpenILS::WWW::SuperCat::string_browse
+ Options +ExecCGI
+ 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
+# ----------------------------------------------------------------------------------
+<Location /opac/extras/docgen.xsl>
+ AddOutputFilter INCLUDES .xsl
+</Location>
+
+# ----------------------------------------------------------------------------------
+# Module for processing staff-client offline scripts lives here
+# ----------------------------------------------------------------------------------
+<Directory "@localstatedir@/cgi-bin/offline">
+ AddHandler cgi-script .pl
+ AllowOverride None
+ Options +ExecCGI
+ allow from all
+</Directory>
+
+
+# ----------------------------------------------------------------------------------
+# XXX Note, it's important to explicitly set the JSON encoding style
+# (OSRFGatewayLegacyJSON), since the default encoding style will likely change
+# with OpenSRF 1.0
+# ----------------------------------------------------------------------------------
+# OpenSRF JSON legacy gateway
+# ----------------------------------------------------------------------------------
+<Location /gateway>
+ SetHandler osrf_json_gateway_module
+ OSRFGatewayLegacyJSON "true"
+ allow from all
+</Location>
+# ----------------------------------------------------------------------------------
+# New-style OpenSRF JSON gateway
+# ----------------------------------------------------------------------------------
+<Location /osrf-gateway-v1>
+ SetHandler osrf_json_gateway_module
+ OSRFGatewayLegacyJSON "false"
+ allow from all
+</Location>
+
+# ----------------------------------------------------------------------------------
+# OpenSRF-over-HTTP translator
+# (http://open-ils.org/dokuwiki/doku.php?id=opensrf_over_http)
+# ----------------------------------------------------------------------------------
+<Location /osrf-http-translator>
+ SetHandler osrf_http_translator_module
+ allow from all
+</Location>
+
+# ----------------------------------------------------------------------------------
+# The exporter lives here
+# ----------------------------------------------------------------------------------
+<Location /exporter>
+ SetHandler perl-script
+ AuthType Basic
+ AuthName "Exporter Login"
+ PerlOptions +GlobalRequest
+ PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
+ PerlAuthenHandler OpenILS::WWW::Proxy::Authen
+ require valid-user
+ PerlHandler OpenILS::WWW::Exporter
+ Options +ExecCGI
+ PerlSendHeader On
+ allow from all
+</Location>
+
+<Location /opac/extras/merge_template>
+ SetHandler perl-script
+ AuthType Basic
+ AuthName "Batch Update Login"
+ PerlOptions +GlobalRequest
+ PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
+ PerlAuthenHandler OpenILS::WWW::Proxy::Authen
+ require valid-user
+ PerlHandler OpenILS::WWW::TemplateBatchBibUpdate
+ PerlSendHeader On
+ Options +ExecCGI
+ allow from all
+</Location>
+
+<Location /opac/extras/circ>
+ AuthType Basic
+ AuthName "Circ Extras Login"
+ PerlOptions +GlobalRequest
+ PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
+ PerlAuthenHandler OpenILS::WWW::Proxy::Authen
+ require valid-user
+ Options +ExecCGI
+ PerlSendHeader On
+ allow from all
+</Location>
+
+<Location /collections>
+ SetHandler perl-script
+ AuthType Basic
+ AuthName "Collections Login"
+ PerlOptions +GlobalRequest
+ PerlSetVar OILSProxyPermissions "money.collections_tracker.create"
+ PerlAuthenHandler OpenILS::WWW::Proxy::Authen
+ require valid-user
+ Options +ExecCGI
+ PerlSendHeader On
+ allow from all
+</Location>
+
+
+# ----------------------------------------------------------------------------------
+# Reporting output lives here
+# ----------------------------------------------------------------------------------
+<Location /reporter/>
+ AuthType Basic
+ AuthName "Report Login"
+ PerlOptions +GlobalRequest
+ PerlSetVar OILSProxyPermissions "VIEW_REPORT_OUTPUT"
+ PerlAuthenHandler OpenILS::WWW::Proxy::Authen
+ require valid-user
+ Options +ExecCGI
+ PerlSendHeader On
+ allow from all
+</Location>
+
+# ----------------------------------------------------------------------------------
+# Selfcheck interface
+# ----------------------------------------------------------------------------------
+<LocationMatch .*/selfcheck.xml>
+ AuthType Basic
+ AuthName "Self-check Login"
+ PerlOptions +GlobalRequest
+ PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
+ PerlAuthenHandler OpenILS::WWW::Proxy::Authen
+ require valid-user
+ Options +ExecCGI
+ PerlSendHeader On
+ allow from all
+</LocationMatch>
+
+
+# ----------------------------------------------------------------------------------
+# Reports GUI
+# ----------------------------------------------------------------------------------
+<LocationMatch /reports>
+ Options +Includes
+ AddOutputFilter INCLUDES;XMLENT .xhtml
+</LocationMatch>
+
+<LocationMatch /reports/fm_IDL.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>
+ SetHandler perl-script
+ PerlHandler OpenILS::WWW::XMLRPCGateway
+ Options +ExecCGI
+ PerlSendHeader On
+ allow from all
+</Location>
+
+# ----------------------------------------------------------------------------------
+# Conify - next-generation Evergreen administration interface
+# ----------------------------------------------------------------------------------
+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"
+ XMLEntContentType "text/html; charset=utf-8"
+ AddOutputFilter INCLUDES;XMLENT .html
+
+ AuthType Basic
+ AuthName "Dojo Admin Login"
+ PerlOptions +GlobalRequest
+ PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
+ PerlAuthenHandler OpenILS::WWW::Proxy::Authen
+ require valid-user
+ Options +ExecCGI
+ PerlSendHeader On
+ allow from all
+</Location>
+
+<Location /vandelay-upload>
+ SetHandler perl-script
+ PerlHandler OpenILS::WWW::Vandelay::spool_marc
+ Options +ExecCGI
+ allow from all
+</Location>
+
+# OpenURL 0.1 searching based on OpenSearch
+RewriteMap openurl prg:@bindir@/openurl_map.pl
+RewriteCond %{QUERY_STRING} (^.*$)
+RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
+
+
+
+# General Evergreen web template processor
+<Location /eg>
+ SetHandler perl-script
+ PerlHandler OpenILS::WWW::EGWeb
+ Options +ExecCGI
+ PerlSendHeader On
+ allow from all
+
+ PerlSetVar OILSWebBasePath "/eg"
+ PerlSetVar OILSWebWebDir "@localstatedir@/web"
+ PerlSetVar OILSWebDefaultTemplateExtension "tt2"
+
+ # Enable Template-Toolkit error debugging messages (apache error log)
+ PerlSetVar OILSWebDebugTemplate "true"
+
+ # -------------------------------------------------------
+ # Media Prefix. In the 3rd example, the protocol (http) is enforced
+ #PerlSetVar OILSWebMediaPrefix "/media"
+ #PerlSetVar OILSWebMediaPrefix "static.example.com/media"
+ #PerlSetVar OILSWebMediaPrefix "http://static.example.com/media"
+
+ # Locale messages files:
+ #
+ # These appear in pairs; the first represents the user agent
+ # Accept-Language header locale, and the second represents
+ # the fully-qualified path for the corresponding PO file that
+ # contains the messages.
+ #
+ # If you enable two or more locales, then users will be able to
+ # select their preferred locale from a locale picker in the TPAC.
+ #
+ #PerlAddVar OILSWebLocale "en"
+ #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/messages.en.po"
+ #PerlAddVar OILSWebLocale "en_ca"
+ #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/en-CA.po"
+ #PerlAddVar OILSWebLocale "fr_ca"
+ #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/fr-CA.po"
+
+ # Set the default locale: defaults to en-US
+ #PerlAddVar OILSWebDefaultLocale "fr_ca"
+
+ # Templates will be loaded from the following paths in reverse order.
+ PerlAddVar OILSWebTemplatePath "@localstatedir@/templates"
+ #PerlAddVar OILSWebTemplatePath "@localstatedir@/templates_localskin"
+
+ #-------------------------------------------------
+ # Added Content Configuration
+ #-------------------------------------------------
+ # Content Cafe
+ #SetEnv OILS_CONTENT_CAFE_USER MYUSER
+ #SetEnv OILS_CONTENT_CAFE_PASS MYPASS
+
+ # LibraryThing
+ #SetEnv OILS_LIBRARYTHING_URL http://ltfl.librarything.com/forlibraries/widget.js?id=MYID
+ #SetEnv OILS_LIBRARYTHING_HTTPS_URL https://ltfl.librarything.com/forlibraries/widget.js?id=MYID
+
+ # ChiliFresh
+ #SetEnv OILS_CHILIFRESH_ACCOUNT
+ #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
+ #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.chilifresh.com/on-site/js/evergreen.js
+ #-------------------------------------------------
+
+ <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 Cache-Control "public"
+ Header append Vary User-Agent env=!dont-vary
+ </IfModule>
+ </IfModule>
+</Location>
+<LocationMatch ^/(images|css|js)/>
+ # should pick up the default expire time from eg.conf...
+ <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 Cache-Control "public"
+ Header append Vary User-Agent env=!dont-vary
+ </IfModule>
+ </IfModule>
+</LocationMatch>
+<Location /eg/opac>
+ PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGCatLoader"
+ # Expire the HTML quickly since we're loading dynamic data for each page
+ ExpiresActive On
+ ExpiresByType text/html "access plus 5 seconds"
+</Location>
+<Location /eg/kpac>
+ PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGKPacLoader"
+ PerlSetVar KPacConfigFile "@sysconfdir@/kpac.xml.example"
+ ExpiresActive On
+ ExpiresByType text/html "access plus 5 seconds"
+</Location>
+
+# Note: the template processor will decline handling anything it does not
+# have an explicit configuration for, which means it will fall back to
+# Apache to serve the file. However, in the interest of speed, go ahead
+# and tell Apache to avoid asking OpenILS::WWW::EGWeb for static content.
+# Add more exemptions as needed.
+<LocationMatch ^/eg/.*(\.js|\.html|\.xhtml|\.xml|\.jpg|\.png|\.gif)$>
+ 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
+
+ # There are problems with XMLENT and mod_deflate - so lets disable it
+ # This is where we don't have a pre-existing LocationMatch directive earlier
+ <LocationMatch /opac/.*\.xml$>
+ SetEnv no-gzip
+ </LocationMatch>
+ <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/.*\.html$>
+ SetEnv no-gzip
+ </LocationMatch>
+ <LocationMatch /reports/.*\.xhtml$>
+ SetEnv no-gzip
+ </LocationMatch>
+ <LocationMatch /conify/.*\.html$>
+ SetEnv no-gzip
+ </LocationMatch>
+</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>
+
+# Uncomment the following to force SSL for everything. Note that this defeats caching
+# and you will suffer a performance hit.
+#RewriteCond %{HTTPS} off
+#RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,R,L]
+++ /dev/null
-#!/usr/bin/perl
-use OpenSRF::AppSession;
-
-# default ingress value for all Apache/mod_perl clients
-OpenSRF::AppSession->ingress('apache');
-
-use OpenILS::WWW::Exporter qw( /openils/conf/opensrf_core.xml );
-use OpenILS::WWW::SuperCat qw( /openils/conf/opensrf_core.xml );
-use OpenILS::WWW::AddedContent qw( /openils/conf/opensrf_core.xml );
-use OpenILS::WWW::Proxy ('/openils/conf/opensrf_core.xml');
-use OpenILS::WWW::Vandelay qw( /openils/conf/opensrf_core.xml );
-use OpenILS::WWW::TemplateBatchBibUpdate qw( /openils/conf/opensrf_core.xml );
-use OpenILS::WWW::EGWeb;
-use OpenILS::WWW::PasswordReset ('/openils/conf/opensrf_core.xml');
-use OpenILS::WWW::IDL2js ('/openils/conf/opensrf_core.xml');
-use OpenILS::WWW::FlatFielder;
-
-# - Uncoment the following 2 lines to make use of the IP redirection code
-# - The IP file should to contain a map with the following format:
-# - actor.org_unit.shortname <start_ip> <end_ip>
-# - e.g. LIB123 10.0.0.1 10.0.0.254
-
-#use OpenILS::WWW::Redirect qw(/openils/conf/opensrf_core.xml);
-#OpenILS::WWW::Redirect->parse_ips_file('/openils/conf/lib_ips.txt');
-
-
-
-1;
-
## Process this file with automake to generate Makefile.in
-export INCDIR = "$(INCLUDEDIR)/openils/"
export STAFF_CLIENT_BUILD_ID = `/bin/cat @top_srcdir@/Open-ILS/xul/staff_client/build/BUILD_ID`
export DEF_LDFLAGS = -L. -L$(TMP) -L$(OPENSRF_LIBS)
export DEF_CFLAGS = -D_LARGEFILE64_SOURCE -pipe -g -Wall -O2 -fPIC -I@top_srcdir@/include -I$(LIBXML2_HEADERS) -I$(APACHE2_HEADERS) -I$(APR_HEADERS) -I$(LIBXML2_HEADERS)/libxml -I$(TMP) -I$(OPENSRF_HEADERS)
@srcdir@/extras/import/marc2sre.pl \
@srcdir@/extras/import/parallel_pg_loader.pl \
$(supportscr)/authority_control_fields.pl \
+ $(supportscr)/eg_db_config \
$(supportscr)/marc_export
+gen_docs = \
+ $(examples)/apache/eg.conf \
+ $(examples)/apache/eg_vhost.conf \
+ $(examples)/apache/eg_startup
+
bin_SCRIPTS = $(core_scripts) $(gen_scripts) $(reporter_scripts) $(installautojs)
CLEANFILES = $(gen_scripts)
data_DATA = $(core_data) $(reporter_data)
+doc_DATA = $(gen_docs)
+
# Take care of which subdirectories to build, and which extra files to include in a distribution.
SUBDIRS = $(OILSCORE_DIRS) $(OILSWEB_DIR) $(OILSPYTHON_DIR) $(OILSJAVA_DIR)
@top_srcdir@/Open-ILS/xsl \
@srcdir@/cgi-bin \
$(gen_scripts) \
+ $(gen_docs) \
@srcdir@/extras/eg_config
do_subst = $(SED) \
-e 's,[@]exec_prefix[@],$(exec_prefix),g' \
-e 's,[@]includedir[@],$(includedir),g' \
-e 's,[@]libdir[@],$(libdir),g' \
+ -e 's,[@]localstatedir[@],$(localstatedir),g' \
-e 's,[@]prefix[@],$(prefix),g' \
-e 's,[@]sysconfdir[@],$(sysconfdir),g'
$(do_subst) $(supportscr)/authority_control_fields.pl.in > "$@"
chmod 755 "$@"
+$(supportscr)/eg_db_config: Makefile $(supportscr)/eg_db_config.in
+ $(do_subst) $(supportscr)/eg_db_config.in > "$@"
+ chmod 755 "$@"
+
$(supportscr)/marc_export: Makefile $(supportscr)/marc_export.in
$(do_subst) $(supportscr)/marc_export.in > "$@"
chmod 755 "$@"
+$(examples)/apache/eg.conf: Makefile $(examples)/apache/eg.conf.in
+ $(do_subst) $(examples)/apache/eg.conf.in > "$@"
+
+$(examples)/apache/eg_vhost.conf: Makefile $(examples)/apache/eg_vhost.conf.in
+ $(do_subst) $(examples)/apache/eg_vhost.conf.in > "$@"
+
+$(examples)/apache/eg_startup: Makefile $(examples)/apache/eg_startup.in
+ $(do_subst) $(examples)/apache/eg_startup.in > "$@"
+
#perl-install and string-templates-install
ilscore-install:
@echo $@
sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/clark-kent.pl'
sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/find_orphaned_reports.pl'
-
+docs-install: gen_docs
+ $(MKDIR_P) $(DESTDIR)$(docdir)
--- /dev/null
+#!/usr/bin/perl
+# eg_db_config.pl -- configure Evergreen database settings and create schema
+# vim:noet:ts=4:sw=4:
+#
+# Copyright (C) 2008 Equinox Software, Inc.
+# Copyright (C) 2008-2009 Laurentian University
+# Author: Kevin Beswick <kevinbeswick00@gmail.com>
+# Author: Dan Scott <dscott@laurentian.ca>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+use strict; use warnings;
+use XML::LibXML;
+use File::Copy;
+use Getopt::Long;
+use File::Spec;
+use File::Basename;
+use DBI;
+use Cwd qw/abs_path getcwd/;
+
+my ($dbhost, $dbport, $dbname, $dbuser, $dbpw, $help, $admin_user, $admin_pw, $load_all, $load_concerto);
+my $config_file = '';
+my $build_db_sh = '';
+my $offline_file = '';
+my $prefix = '';
+my $sysconfdir = '';
+my $pg_contribdir = '';
+my $create_db_sql_contribs = '';
+my $create_db_sql_extensions = '';
+my @services;
+
+my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
+
+my $cwd = getcwd();
+
+# Get the directory for this script
+my $script_dir = abs_path(dirname($0));
+
+# Set the location and base file for sample data
+my $_sample_dir = abs_path(File::Spec->catdir($script_dir, '../../tests/datasets/sql/'));
+my $_sample_all = 'load_all.sql';
+my $_sample_concerto = 'load_concerto.sql';
+
+=over
+
+=item update_config() - Puts command line specified settings into xml file
+=cut
+sub update_config {
+ my ($services, $settings) = @_;
+
+ my $parser = XML::LibXML->new();
+ my $opensrf_config = $parser->parse_file($config_file);
+
+ if (@$services) {
+ foreach my $service (@$services) {
+ foreach my $key (keys %$settings) {
+ next unless $settings->{$key};
+ my @node;
+
+ if ($service eq 'state_store') {
+ (@node) = $opensrf_config->findnodes("//state_store/$key/text()");
+ } else {
+ (@node) = $opensrf_config->findnodes("//$service//database/$key/text()");
+ }
+
+ foreach (@node) {
+ $_->setData($settings->{$key});
+ }
+ }
+
+ }
+ }
+
+ my $timestamp = sprintf("%d.%d.%d.%d.%d.%d",
+ $year + 1900, $mon +1, $mday, $hour, $min, $sec);
+ if (copy($config_file, "$config_file.$timestamp")) {
+ print "Backed up original configuration file to '$config_file.$timestamp'\n";
+ } else {
+ print STDERR "Unable to write to '$config_file.$timestamp'; bailed out.\n";
+ }
+
+ $opensrf_config->toFile($config_file) or
+ die "ERROR: Failed to update the configuration file '$config_file'\n";
+}
+
+=item create_offline_config() - Write out the offline config
+=cut
+sub create_offline_config {
+ my ($setup, $settings) = @_;
+
+ open(FH, '>', $setup) or die "Could not write offline database setup to $setup\n";
+
+ print "Writing offline database configuration to $setup\n";
+
+ printf FH "\$main::config{base_dir} = '%s/var/data/offline/';\n", $prefix;
+ printf FH "\$main::config{bootstrap} = '%s/opensrf_core.xml';\n", $sysconfdir;
+
+ printf FH "\$main::config{dsn} = 'dbi:Pg:host=%s;dbname=%s;port=%d';\n",
+ $settings->{host}, $settings->{db}, $settings->{port};
+
+ printf FH "\$main::config{usr} = '%s';\n", $settings->{user};
+ printf FH "\$main::config{pw} = '%s';\n", $settings->{pw};
+
+ close(FH);
+}
+
+=item get_settings() - Extracts database settings from opensrf.xml
+=cut
+sub get_settings {
+ my $settings = shift;
+
+ my $host = "/opensrf/default/apps/open-ils.storage/app_settings/databases/database/host/text()";
+ my $port = "/opensrf/default/apps/open-ils.storage/app_settings/databases/database/port/text()";
+ my $dbname = "/opensrf/default/apps/open-ils.storage/app_settings/databases/database/db/text()";
+ my $user = "/opensrf/default/apps/open-ils.storage/app_settings/databases/database/user/text()";
+ my $pw = "/opensrf/default/apps/open-ils.storage/app_settings/databases/database/pw/text()";
+
+ my $parser = XML::LibXML->new();
+ my $opensrf_config = $parser->parse_file($config_file);
+
+ # If the user passed in settings at the command line,
+ # we don't want to override them
+ $settings->{host} = $settings->{host} || $opensrf_config->findnodes($host);
+ $settings->{port} = $settings->{port} || $opensrf_config->findnodes($port);
+ $settings->{db} = $settings->{db} || $opensrf_config->findnodes($dbname);
+ $settings->{user} = $settings->{user} || $opensrf_config->findnodes($user);
+ $settings->{pw} = $settings->{pw} || $opensrf_config->findnodes($pw);
+}
+
+=item create_database() - Creates the database using create_database_contribs.sql
+=cut
+sub create_database {
+ my $settings = shift;
+
+ $ENV{'PGUSER'} = $settings->{user};
+ $ENV{'PGPASSWORD'} = $settings->{pw};
+ $ENV{'PGPORT'} = $settings->{port};
+ $ENV{'PGHOST'} = $settings->{host};
+ my @temp = `psql -d postgres -qtc 'show server_version;' | xargs | cut -c1,3`;
+ chomp $temp[0];
+ my $pgversion = $temp[0];
+ my $cmd;
+ # If it looks like it is 9.1 or greater, use create_database_extensions.sql
+ # Otherwise use create_database_contribs.sql
+ if($pgversion >= '91') {
+ $cmd = 'psql -vdb_name=' . $settings->{db} . ' -d postgres -f ' . $create_db_sql_extensions;
+ } else {
+ $cmd = 'psql -vdb_name=' . $settings->{db} . ' -vcontrib_dir=' . $pg_contribdir .
+ ' -d postgres -f ' . $create_db_sql_contribs;
+ }
+ my @output = `$cmd 2>&1`;
+ if(grep(/(ERROR|No such file or directory)/,@output)) {
+ push(@output, "\n------------------------------------------------------------------------------\n",
+ "There was a problem creating the database.\n",
+ "See above for more information.\n");
+ if(grep/unsupported language/, @output) {
+ push(@output, "\nYou may need to install the postgresql plperl package on the database server.\n");
+ }
+ if(grep/No such file or directory/, @output) {
+ if($pgversion >= '91') {
+ push(@output, "\nYou may need to install the postgresql contrib package on the database server.\n");
+ } else {
+ push(@output, "\nYou may need to install the postgresql contrib package on this server.\n");
+ }
+ }
+ push(@output, "------------------------------------------------------------------------------\n");
+ die(@output);
+ }
+}
+
+=item create_schema() - Creates the database schema by calling build-db.sh
+=cut
+sub create_schema {
+ my $settings = shift;
+
+ chdir(dirname($build_db_sh));
+ my $cmd = File::Spec->catfile('.', basename($build_db_sh)) . " " .
+ $settings->{host} ." ". $settings->{port} ." ".
+ $settings->{db} ." ". $settings->{user} ." ".
+ $settings->{pw};
+ system($cmd);
+ chdir($script_dir);
+}
+
+=item load_sample_data() - Loads sample bib records, copies, users, and transactions
+=cut
+sub load_sample_data {
+ my $settings = shift;
+
+ my $load_script = $_sample_all;
+ chdir($_sample_dir);
+ if ($load_concerto) {
+ $load_script = $_sample_concerto;
+ }
+ $ENV{'PGUSER'} = $settings->{user};
+ $ENV{'PGPASSWORD'} = $settings->{pw};
+ $ENV{'PGPORT'} = $settings->{port};
+ $ENV{'PGHOST'} = $settings->{host};
+ $ENV{'PGDATABASE'} = $settings->{db};
+ my @output = `psql -f $load_script 2>&1`;
+ print @output;
+ chdir($cwd);
+}
+
+=item set_admin_account() - Sets the administrative user's user name and password
+=cut
+sub set_admin_account {
+ my $admin_user = shift;
+ my $admin_pw = shift;
+ my $settings = shift;
+
+ my $dbh = DBI->connect('dbi:Pg:dbname=' . $settings->{db} .
+ ';host=' . $settings->{host} . ';port=' . $settings->{port} . ';',
+ $settings->{user} . "", $settings->{pw} . "", {AutoCommit => 1}
+ );
+ if ($dbh->err) {
+ print STDERR "Could not connect to database to set admin account. ";
+ print STDERR "Error was " . $dbh->errstr . "\n";
+ return;
+ }
+ my $stmt = $dbh->prepare("UPDATE actor.usr SET usrname = ?, passwd = ? WHERE id = 1");
+ $stmt->execute(($admin_user, $admin_pw));
+ if ($dbh->err) {
+ print STDERR "Failed to set admin account. ";
+ print STDERR "Error was " . $dbh->errstr . "\n";
+ return;
+ }
+}
+
+my $offline;
+my $cdatabase;
+my $cschema;
+my $uconfig;
+my $pgconfig;
+my %settings;
+
+GetOptions("create-schema" => \$cschema,
+ "create-database" => \$cdatabase,
+ "load-all-sample" => \$load_all,
+ "load-concerto-sample" => \$load_concerto,
+ "create-offline" => \$offline,
+ "update-config" => \$uconfig,
+ "config-file=s" => \$config_file,
+ "build-db-file=s" => \$build_db_sh,
+ "pg-contrib-dir=s" => \$pg_contribdir,
+ "create-db-sql-contribs=s" => \$create_db_sql_contribs,
+ "create-db-sql-extensions=s" => \$create_db_sql_extensions,
+ "pg-config=s" => \$pgconfig,
+ "admin-user=s" => \$admin_user,
+ "admin-password=s" => \$admin_pw,
+ "service=s" => \@services,
+ "user=s" => \$settings{'user'},
+ "password=s" => \$settings{'pw'},
+ "database=s" => \$settings{'db'},
+ "hostname=s" => \$settings{'host'},
+ "port=i" => \$settings{'port'},
+ "help" => \$help
+);
+
+if (grep(/^all$/, @services)) {
+ @services = qw/reporter open-ils.cstore open-ils.pcrud open-ils.storage open-ils.reporter-store state_store/;
+}
+
+my $eg_config = File::Spec->catfile($script_dir, '../extras/eg_config');
+
+if (!$config_file) {
+ my @temp = `$eg_config --sysconfdir`;
+ chomp $temp[0];
+ $sysconfdir = $temp[0];
+ $config_file = File::Spec->catfile($sysconfdir, "opensrf.xml");
+}
+
+if (!$prefix) {
+ my @temp = `$eg_config --prefix`;
+ chomp $temp[0];
+ $prefix = $temp[0];
+}
+
+if (!$build_db_sh) {
+ $build_db_sh = File::Spec->catfile($script_dir, '../sql/Pg/build-db.sh');
+}
+
+if (!$pg_contribdir) {
+ $pgconfig = 'pg_config' if(!$pgconfig);
+ my @temp = `$pgconfig --sharedir`;
+ chomp $temp[0];
+ $pg_contribdir = File::Spec->catdir($temp[0], 'contrib');
+}
+
+if (!$create_db_sql_contribs) {
+ $create_db_sql_contribs = File::Spec->catfile($script_dir, '../sql/Pg/create_database_contribs.sql');
+}
+
+if (!$create_db_sql_extensions) {
+ $create_db_sql_extensions = File::Spec->catfile($script_dir, '../sql/Pg/create_database_extensions.sql');
+}
+
+if (!$offline_file) {
+ $offline_file = File::Spec->catfile($sysconfdir, 'offline-config.pl');
+}
+
+unless (-e $build_db_sh) { die "Error: $build_db_sh does not exist. \n"; }
+unless (-e $config_file) { die "Error: $config_file does not exist. \n"; }
+
+if ($uconfig) { update_config(\@services, \%settings); }
+
+# Get our settings from the config file
+get_settings(\%settings);
+
+if ($cdatabase) { create_database(\%settings); }
+if ($cschema) { create_schema(\%settings); }
+if ($admin_user && $admin_pw) {
+ set_admin_account($admin_user, $admin_pw, \%settings);
+}
+if ($load_all || $load_concerto) {
+ load_sample_data(\%settings);
+}
+if ($offline) { create_offline_config($offline_file, \%settings); }
+
+if ((!$cdatabase && !$cschema && !$load_all && !$load_concerto && !$uconfig && !$offline && !$admin_pw) || $help) {
+ print <<HERE;
+
+SYNOPSIS
+ eg_db_config.pl [OPTION] ... [COMMAND] ... [CONFIG OPTIONS]
+
+DESCRIPTION
+ Creates or recreates the Evergreen database schema based on the settings
+ in the opensrf.xml configuration file.
+
+ Manipulates the configuration file
+
+OPTIONS
+ --config-file
+ specifies the opensrf.xml file. Defaults to @sysconfdir@/opensrf.xml
+
+ --build-db-file
+ specifies the script that creates the database schema. Defaults to
+ Open-ILS/src/sql/pg/build-db.sh
+
+ --offline-file
+ specifies the offline database settings file required by the offline
+ data uploader. Defaults to @sysconfdir@/offline-config.pl
+
+COMMANDS
+ --update-config
+ Configures Evergreen database settings in the file specified by
+ --build-db-file.
+
+ --create-offline
+ Creates the database setting file required by the offline data uploader
+
+ --create-schema
+ Creates the Evergreen database schema according to the settings in
+ the file specified by --config-file.
+
+ --create-database
+ Creates the database itself, provided the user and password options
+ represent a superuser.
+
+ --load-all-sample
+ Loads all sample data, including bibliographic records, call numbers,
+ copies, users, and transactions.
+
+ --load-concerto-sample
+ Loads a subset of sample data that includes just 100 bibliographic
+ records, and associated call numbers and copies.
+
+SERVICE OPTIONS
+ --service
+ Specify "all" or one or more of the following services to update:
+ * reporter
+ * open-ils.cstore
+ * open-ils.pcrud
+ * open-ils.storage
+ * open-ils.reporter-store
+ * state_store
+
+DATABASE CONFIGURATION OPTIONS
+ --user username for the database
+
+ --password password for the user
+
+ --database name of the database
+
+ --hostname name or address of the database host
+
+ --port port number for database access
+
+ --admin-user administration user's user name
+
+ --admin-pass administration user's password
+
+EXAMPLES
+ This script is normally used during the initial installation and
+ configuration process. This creates the database schema, sets
+ the administration user's user name and password, and modifies your
+ configuration files to include the correct database connection
+ information.
+
+ For a single server install, or an install with one web/application
+ server and one database server, you will typically want to invoke this
+ script with a complete set of commands:
+
+ perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config \
+ --service all --create-schema --create-offline \
+ --user <db-user> --password <db-pass> --hostname localhost --port 5432 \
+ --database evergreen --admin-user <admin-user> --admin-pass <admin-pass>
+
+ To update the configuration for a single service - for example, if you
+ replicated a database for reporting purposes - just issue the
+ --update-config command with the service identified and the changed
+ database parameters specified:
+
+ perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config \
+ --service reporter --hostname foobar --password newpass
+
+HERE
+}
+++ /dev/null
-#!/usr/bin/perl
-# eg_db_config.pl -- configure Evergreen database settings and create schema
-# vim:noet:ts=4:sw=4:
-#
-# Copyright (C) 2008 Equinox Software, Inc.
-# Copyright (C) 2008-2009 Laurentian University
-# Author: Kevin Beswick <kevinbeswick00@gmail.com>
-# Author: Dan Scott <dscott@laurentian.ca>
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-use strict; use warnings;
-use XML::LibXML;
-use File::Copy;
-use Getopt::Long;
-use File::Spec;
-use File::Basename;
-use DBI;
-use Cwd qw/abs_path getcwd/;
-
-my ($dbhost, $dbport, $dbname, $dbuser, $dbpw, $help, $admin_user, $admin_pw, $load_all, $load_concerto);
-my $config_file = '';
-my $build_db_sh = '';
-my $offline_file = '';
-my $prefix = '';
-my $sysconfdir = '';
-my $pg_contribdir = '';
-my $create_db_sql_contribs = '';
-my $create_db_sql_extensions = '';
-my @services;
-
-my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
-
-my $cwd = getcwd();
-
-# Get the directory for this script
-my $script_dir = abs_path(dirname($0));
-
-# Set the location and base file for sample data
-my $_sample_dir = abs_path(File::Spec->catdir($script_dir, '../../tests/datasets/sql/'));
-my $_sample_all = 'load_all.sql';
-my $_sample_concerto = 'load_concerto.sql';
-
-=over
-
-=item update_config() - Puts command line specified settings into xml file
-=cut
-sub update_config {
- my ($services, $settings) = @_;
-
- my $parser = XML::LibXML->new();
- my $opensrf_config = $parser->parse_file($config_file);
-
- if (@$services) {
- foreach my $service (@$services) {
- foreach my $key (keys %$settings) {
- next unless $settings->{$key};
- my @node;
-
- if ($service eq 'state_store') {
- (@node) = $opensrf_config->findnodes("//state_store/$key/text()");
- } else {
- (@node) = $opensrf_config->findnodes("//$service//database/$key/text()");
- }
-
- foreach (@node) {
- $_->setData($settings->{$key});
- }
- }
-
- }
- }
-
- my $timestamp = sprintf("%d.%d.%d.%d.%d.%d",
- $year + 1900, $mon +1, $mday, $hour, $min, $sec);
- if (copy($config_file, "$config_file.$timestamp")) {
- print "Backed up original configuration file to '$config_file.$timestamp'\n";
- } else {
- print STDERR "Unable to write to '$config_file.$timestamp'; bailed out.\n";
- }
-
- $opensrf_config->toFile($config_file) or
- die "ERROR: Failed to update the configuration file '$config_file'\n";
-}
-
-=item create_offline_config() - Write out the offline config
-=cut
-sub create_offline_config {
- my ($setup, $settings) = @_;
-
- open(FH, '>', $setup) or die "Could not write offline database setup to $setup\n";
-
- print "Writing offline database configuration to $setup\n";
-
- printf FH "\$main::config{base_dir} = '%s/var/data/offline/';\n", $prefix;
- printf FH "\$main::config{bootstrap} = '%s/opensrf_core.xml';\n", $sysconfdir;
-
- printf FH "\$main::config{dsn} = 'dbi:Pg:host=%s;dbname=%s;port=%d';\n",
- $settings->{host}, $settings->{db}, $settings->{port};
-
- printf FH "\$main::config{usr} = '%s';\n", $settings->{user};
- printf FH "\$main::config{pw} = '%s';\n", $settings->{pw};
-
- close(FH);
-}
-
-=item get_settings() - Extracts database settings from opensrf.xml
-=cut
-sub get_settings {
- my $settings = shift;
-
- my $host = "/opensrf/default/apps/open-ils.storage/app_settings/databases/database/host/text()";
- my $port = "/opensrf/default/apps/open-ils.storage/app_settings/databases/database/port/text()";
- my $dbname = "/opensrf/default/apps/open-ils.storage/app_settings/databases/database/db/text()";
- my $user = "/opensrf/default/apps/open-ils.storage/app_settings/databases/database/user/text()";
- my $pw = "/opensrf/default/apps/open-ils.storage/app_settings/databases/database/pw/text()";
-
- my $parser = XML::LibXML->new();
- my $opensrf_config = $parser->parse_file($config_file);
-
- # If the user passed in settings at the command line,
- # we don't want to override them
- $settings->{host} = $settings->{host} || $opensrf_config->findnodes($host);
- $settings->{port} = $settings->{port} || $opensrf_config->findnodes($port);
- $settings->{db} = $settings->{db} || $opensrf_config->findnodes($dbname);
- $settings->{user} = $settings->{user} || $opensrf_config->findnodes($user);
- $settings->{pw} = $settings->{pw} || $opensrf_config->findnodes($pw);
-}
-
-=item create_database() - Creates the database using create_database_contribs.sql
-=cut
-sub create_database {
- my $settings = shift;
-
- $ENV{'PGUSER'} = $settings->{user};
- $ENV{'PGPASSWORD'} = $settings->{pw};
- $ENV{'PGPORT'} = $settings->{port};
- $ENV{'PGHOST'} = $settings->{host};
- my @temp = `psql -d postgres -qtc 'show server_version;' | xargs | cut -c1,3`;
- chomp $temp[0];
- my $pgversion = $temp[0];
- my $cmd;
- # If it looks like it is 9.1 or greater, use create_database_extensions.sql
- # Otherwise use create_database_contribs.sql
- if($pgversion >= '91') {
- $cmd = 'psql -vdb_name=' . $settings->{db} . ' -d postgres -f ' . $create_db_sql_extensions;
- } else {
- $cmd = 'psql -vdb_name=' . $settings->{db} . ' -vcontrib_dir=' . $pg_contribdir .
- ' -d postgres -f ' . $create_db_sql_contribs;
- }
- my @output = `$cmd 2>&1`;
- if(grep(/(ERROR|No such file or directory)/,@output)) {
- push(@output, "\n------------------------------------------------------------------------------\n",
- "There was a problem creating the database.\n",
- "See above for more information.\n");
- if(grep/unsupported language/, @output) {
- push(@output, "\nYou may need to install the postgresql plperl package on the database server.\n");
- }
- if(grep/No such file or directory/, @output) {
- if($pgversion >= '91') {
- push(@output, "\nYou may need to install the postgresql contrib package on the database server.\n");
- } else {
- push(@output, "\nYou may need to install the postgresql contrib package on this server.\n");
- }
- }
- push(@output, "------------------------------------------------------------------------------\n");
- die(@output);
- }
-}
-
-=item create_schema() - Creates the database schema by calling build-db.sh
-=cut
-sub create_schema {
- my $settings = shift;
-
- chdir(dirname($build_db_sh));
- my $cmd = File::Spec->catfile('.', basename($build_db_sh)) . " " .
- $settings->{host} ." ". $settings->{port} ." ".
- $settings->{db} ." ". $settings->{user} ." ".
- $settings->{pw};
- system($cmd);
- chdir($script_dir);
-}
-
-=item load_sample_data() - Loads sample bib records, copies, users, and transactions
-=cut
-sub load_sample_data {
- my $settings = shift;
-
- my $load_script = $_sample_all;
- chdir($_sample_dir);
- if ($load_concerto) {
- $load_script = $_sample_concerto;
- }
- $ENV{'PGUSER'} = $settings->{user};
- $ENV{'PGPASSWORD'} = $settings->{pw};
- $ENV{'PGPORT'} = $settings->{port};
- $ENV{'PGHOST'} = $settings->{host};
- $ENV{'PGDATABASE'} = $settings->{db};
- my @output = `psql -f $load_script 2>&1`;
- print @output;
- chdir($cwd);
-}
-
-=item set_admin_account() - Sets the administrative user's user name and password
-=cut
-sub set_admin_account {
- my $admin_user = shift;
- my $admin_pw = shift;
- my $settings = shift;
-
- my $dbh = DBI->connect('dbi:Pg:dbname=' . $settings->{db} .
- ';host=' . $settings->{host} . ';port=' . $settings->{port} . ';',
- $settings->{user} . "", $settings->{pw} . "", {AutoCommit => 1}
- );
- if ($dbh->err) {
- print STDERR "Could not connect to database to set admin account. ";
- print STDERR "Error was " . $dbh->errstr . "\n";
- return;
- }
- my $stmt = $dbh->prepare("UPDATE actor.usr SET usrname = ?, passwd = ? WHERE id = 1");
- $stmt->execute(($admin_user, $admin_pw));
- if ($dbh->err) {
- print STDERR "Failed to set admin account. ";
- print STDERR "Error was " . $dbh->errstr . "\n";
- return;
- }
-}
-
-my $offline;
-my $cdatabase;
-my $cschema;
-my $uconfig;
-my $pgconfig;
-my %settings;
-
-GetOptions("create-schema" => \$cschema,
- "create-database" => \$cdatabase,
- "load-all-sample" => \$load_all,
- "load-concerto-sample" => \$load_concerto,
- "create-offline" => \$offline,
- "update-config" => \$uconfig,
- "config-file=s" => \$config_file,
- "build-db-file=s" => \$build_db_sh,
- "pg-contrib-dir=s" => \$pg_contribdir,
- "create-db-sql-contribs=s" => \$create_db_sql_contribs,
- "create-db-sql-extensions=s" => \$create_db_sql_extensions,
- "pg-config=s" => \$pgconfig,
- "admin-user=s" => \$admin_user,
- "admin-password=s" => \$admin_pw,
- "service=s" => \@services,
- "user=s" => \$settings{'user'},
- "password=s" => \$settings{'pw'},
- "database=s" => \$settings{'db'},
- "hostname=s" => \$settings{'host'},
- "port=i" => \$settings{'port'},
- "help" => \$help
-);
-
-if (grep(/^all$/, @services)) {
- @services = qw/reporter open-ils.cstore open-ils.pcrud open-ils.storage open-ils.reporter-store state_store/;
-}
-
-my $eg_config = File::Spec->catfile($script_dir, '../extras/eg_config');
-
-if (!$config_file) {
- my @temp = `$eg_config --sysconfdir`;
- chomp $temp[0];
- $sysconfdir = $temp[0];
- $config_file = File::Spec->catfile($sysconfdir, "opensrf.xml");
-}
-
-if (!$prefix) {
- my @temp = `$eg_config --prefix`;
- chomp $temp[0];
- $prefix = $temp[0];
-}
-
-if (!$build_db_sh) {
- $build_db_sh = File::Spec->catfile($script_dir, '../sql/Pg/build-db.sh');
-}
-
-if (!$pg_contribdir) {
- $pgconfig = 'pg_config' if(!$pgconfig);
- my @temp = `$pgconfig --sharedir`;
- chomp $temp[0];
- $pg_contribdir = File::Spec->catdir($temp[0], 'contrib');
-}
-
-if (!$create_db_sql_contribs) {
- $create_db_sql_contribs = File::Spec->catfile($script_dir, '../sql/Pg/create_database_contribs.sql');
-}
-
-if (!$create_db_sql_extensions) {
- $create_db_sql_extensions = File::Spec->catfile($script_dir, '../sql/Pg/create_database_extensions.sql');
-}
-
-if (!$offline_file) {
- $offline_file = File::Spec->catfile($sysconfdir, 'offline-config.pl');
-}
-
-unless (-e $build_db_sh) { die "Error: $build_db_sh does not exist. \n"; }
-unless (-e $config_file) { die "Error: $config_file does not exist. \n"; }
-
-if ($uconfig) { update_config(\@services, \%settings); }
-
-# Get our settings from the config file
-get_settings(\%settings);
-
-if ($cdatabase) { create_database(\%settings); }
-if ($cschema) { create_schema(\%settings); }
-if ($admin_user && $admin_pw) {
- set_admin_account($admin_user, $admin_pw, \%settings);
-}
-if ($load_all || $load_concerto) {
- load_sample_data(\%settings);
-}
-if ($offline) { create_offline_config($offline_file, \%settings); }
-
-if ((!$cdatabase && !$cschema && !$load_all && !$load_concerto && !$uconfig && !$offline && !$admin_pw) || $help) {
- print <<HERE;
-
-SYNOPSIS
- eg_db_config.pl [OPTION] ... [COMMAND] ... [CONFIG OPTIONS]
-
-DESCRIPTION
- Creates or recreates the Evergreen database schema based on the settings
- in the opensrf.xml configuration file.
-
- Manipulates the configuration file
-
-OPTIONS
- --config-file
- specifies the opensrf.xml file. Defaults to /openils/conf/opensrf.xml
-
- --build-db-file
- specifies the script that creates the database schema. Defaults to
- Open-ILS/src/sql/pg/build-db.sh
-
- --offline-file
- specifies the offline database settings file required by the offline
- data uploader. Defaults to /openils/conf/offline-config.pl
-
-COMMANDS
- --update-config
- Configures Evergreen database settings in the file specified by
- --build-db-file.
-
- --create-offline
- Creates the database setting file required by the offline data uploader
-
- --create-schema
- Creates the Evergreen database schema according to the settings in
- the file specified by --config-file.
-
- --create-database
- Creates the database itself, provided the user and password options
- represent a superuser.
-
- --load-all-sample
- Loads all sample data, including bibliographic records, call numbers,
- copies, users, and transactions.
-
- --load-concerto-sample
- Loads a subset of sample data that includes just 100 bibliographic
- records, and associated call numbers and copies.
-
-SERVICE OPTIONS
- --service
- Specify "all" or one or more of the following services to update:
- * reporter
- * open-ils.cstore
- * open-ils.pcrud
- * open-ils.storage
- * open-ils.reporter-store
- * state_store
-
-DATABASE CONFIGURATION OPTIONS
- --user username for the database
-
- --password password for the user
-
- --database name of the database
-
- --hostname name or address of the database host
-
- --port port number for database access
-
- --admin-user administration user's user name
-
- --admin-pass administration user's password
-
-EXAMPLES
- This script is normally used during the initial installation and
- configuration process. This creates the database schema, sets
- the administration user's user name and password, and modifies your
- configuration files to include the correct database connection
- information.
-
- For a single server install, or an install with one web/application
- server and one database server, you will typically want to invoke this
- script with a complete set of commands:
-
- perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config \
- --service all --create-schema --create-offline \
- --user <db-user> --password <db-pass> --hostname localhost --port 5432 \
- --database evergreen --admin-user <admin-user> --admin-pass <admin-pass>
-
- To update the configuration for a single service - for example, if you
- replicated a database for reporting purposes - just issue the
- --update-config command with the service identified and the changed
- database parameters specified:
-
- perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config \
- --service reporter --hostname foobar --password newpass
-
-HERE
-}
------------------------------------------------------------------------------
cp Open-ILS/examples/apache/eg.conf /etc/apache2/sites-available/
cp Open-ILS/examples/apache/eg_vhost.conf /etc/apache2/
-cp Open-ILS/examples/apache/startup.pl /etc/apache2/
+cp Open-ILS/examples/apache/eg_startup /etc/apache2/
# Now set up SSL
mkdir /etc/apache2/ssl
cd /etc/apache2/ssl
------------------------------------------------------------------------------
cp Open-ILS/examples/apache/eg.conf /etc/httpd/conf.d/
cp Open-ILS/examples/apache/eg_vhost.conf /etc/httpd/
-cp Open-ILS/examples/apache/startup.pl /etc/httpd/
+cp Open-ILS/examples/apache/eg_startup /etc/httpd/
# Now set up SSL
mkdir /etc/httpd/ssl
cd /etc/httpd/ssl
appended to the file name, so if you have forgotten the Jabber users and
domains, you can retrieve the settings from the backup version of the files.
-`eg_db_config.pl`, described in the following section, sets the database
+`eg_db_config`, described in the following section, sets the database
connection information in `opensrf.xml` for you.
Creating the Evergreen database
[source, bash]
------------------------------------------------------------------------------
-perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config \
+perl Open-ILS/src/support-scripts/eg_db_config --update-config \
--service all --create-database --create-schema --create-offline \
--user <user> --password <password> --hostname <hostname> --port <port> \
--database <dbname> --admin-user <admin-user> --admin-pass <admin-pass>
PostgreSQL 9.1 and later
^^^^^^^^^^^^^^^^^^^^^^^^
To create the database instance on a remote database server running PostgreSQL
-9.1 or later, simply use the `--create-database` flag on `eg_db_config.pl`.
+9.1 or later, simply use the `--create-database` flag on `eg_db_config`.
For PostgreSQL 9.0
^^^^^^^^^^^^^^^^^^
psql -vdb_name=<dbname> -vcontrib_dir=`pg_config --sharedir`/contrib -f create_database.sql
------------------------------------------------------------------------------
-Then you can issue the `eg_db_config.pl` command as above _without_ the
+Then you can issue the `eg_db_config` command as above _without_ the
`--create-database` argument to create your schema and configure your
configuration files.
Evergreen via `srfsh`. As the *opensrf* Linux account, issue the following
commands to start `srfsh` and try to log onto the Evergreen server using the
*egadmin* Evergreen administrator user name and password that you set using the
-`eg_db_config.pl` command:
+`eg_db_config` command:
[source, bash]
------------------------------------------------------------------------------
[source, bash]
-------------------------------------------------------------------------
cd /home/opensrf/Evergreen-ILS-2.3.3
-perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config --service all \
+perl Open-ILS/src/support-scripts/eg_db_config --update-config --service all \
--create-offline --database evergreen --host localhost --user evergreen --password evergreen
-------------------------------------------------------------------------
+
Copying these Apache configuration files will remove any customizations you have made to them. Remember to redo your customizations after copying them.
For example, if you purchased an SSL certificate, you will need to edit eg.conf to point to the appropriate SSL certificate files.
+
-.. Update _/etc/apache2/startup.pl_ by copying the example from _Open-ILS/examples/apache/startup.pl_.
+.. Update _/etc/apache2/eg_startup_ by copying the example from _Open-ILS/examples/apache/eg_startup_.
+
[source, bash]
----------------------------------------------------------
-cp /home/opensrf/Evergreen-ILS-2.3.3/Open-ILS/examples/apache/startup.pl /etc/apache2/startup.pl
+cp /home/opensrf/Evergreen-ILS-2.3.3/Open-ILS/examples/apache/eg_startup /etc/apache2/eg_startup
----------------------------------------------------------
+
.. Update /etc/apache2/eg_vhost.conf by copying the example from Open-ILS/examples/apache/eg_vhost.conf.
cp /home/opensrf/Evergreen-ILS-2.3.3/Open-ILS/examples/apache/eg_vhost.conf /etc/apache2/eg_vhost.conf
----------------------------------------------------------
+
-.. Update /etc/apache2/sites-available/eg.conf by copying the example from Open-ILS/ examples/apache/eg.conf.
+.. Update /etc/apache2/sites-available/eg.conf by copying the example from Open-ILS/examples/apache/eg.conf.
+
[source, bash]
----------------------------------------------------------