[open-ils-commits] [GIT] Evergreen ILS branch master updated. e77201356efe32ffaec4db1b1be8d87fe3f90248

Evergreen Git git at git.evergreen-ils.org
Thu Mar 12 09:32:40 EDT 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  e77201356efe32ffaec4db1b1be8d87fe3f90248 (commit)
       via  c0e94d408510bb494675e801fd4fa539fdbce7c9 (commit)
       via  8d57549d7e0611d1e0052aab56dfec8252101e93 (commit)
       via  3643e4410012086365b8b7765a67c6e19552c07e (commit)
      from  63b598209973cec8fa7a23ca7f63f8b42606429d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit e77201356efe32ffaec4db1b1be8d87fe3f90248
Author: Remington Steed <rjs7 at calvin.edu>
Date:   Thu Mar 12 09:15:37 2015 -0400

    Docs: Link optional docs from Apache config
    
    This commit links to the new optional Apache config docs from the Apache
    config step in the installation instructions.
    
    Signed-off-by: Remington Steed <rjs7 at calvin.edu>

diff --git a/docs/installation/server_installation.txt b/docs/installation/server_installation.txt
index e99aa4f..4c32b15 100644
--- a/docs/installation/server_installation.txt
+++ b/docs/installation/server_installation.txt
@@ -344,6 +344,10 @@ a2ensite eg.conf
 ------------------------------------------------------------------------------
 chown opensrf /var/lock/apache2
 ------------------------------------------------------------------------------
++
+9. Learn more about additional Apache options in the following sections:
+  * <<_apache_rewrite_tricks,Apache Rewrite Tricks>>
+  * <<_apache_access_handler_perl_module,Apache Access Handler Perl Module>>
 
 Configure OpenSRF for the Evergreen application
 -----------------------------------------------

commit c0e94d408510bb494675e801fd4fa539fdbce7c9
Author: Remington Steed <rjs7 at calvin.edu>
Date:   Wed Mar 11 17:23:57 2015 -0400

    LP#1413624 Docs: Move Access Handler docs to official docs
    
    This commit moves the new Access Handler doc file to the official docs
    folder, adds the file reference to the root.txt, changes the main header
    text for easier linking, adds the missing block delimiter lines around a
    code block, and adds a blank line at the end of another doc file to
    prevent the docs from running together.
    
    Signed-off-by: Remington Steed <rjs7 at calvin.edu>

diff --git a/docs/TechRef/Apache/apache_access_handler.txt b/docs/admin/apache_access_handler.txt
similarity index 91%
rename from docs/TechRef/Apache/apache_access_handler.txt
rename to docs/admin/apache_access_handler.txt
index 324f3bd..594393c 100644
--- a/docs/TechRef/Apache/apache_access_handler.txt
+++ b/docs/admin/apache_access_handler.txt
@@ -1,10 +1,10 @@
-Apache Access Handler: OpenILS::WWW::AccessHandler
---------------------------------------------------
-This Perl module is intended for limiting patron access to configured locations
-in Apache. These locations could be folder trees, static files, non-Evergreen
-dynamic content, or other Apache features/modules. It is intended as a more
-patron-oriented and transparent version of the OpenILS::WWW::Proxy and
-OpenILS::WWW:Proxy::Authen modules.
+Apache Access Handler Perl Module
+---------------------------------
+The OpenILS::WWW::AccessHandler Perl module is intended for limiting patron
+access to configured locations in Apache. These locations could be folder
+trees, static files, non-Evergreen dynamic content, or other Apache
+features/modules. It is intended as a more patron-oriented and transparent
+version of the OpenILS::WWW::Proxy and OpenILS::WWW:Proxy::Authen modules.
 
 Instead of using Basic Authentication the AccessHandler module instead redirects
 to the OPAC for login. Once logged in additional checks can be performed, based
@@ -17,11 +17,13 @@ on configured variables:
 Use of the module is a simple addition to a Location block in Apache:
 
 [source,conf]
+----
 <Location /path/to/be/protected>
     PerlAccessHandler OpenILS::WWW::AccessHandler
     # For each option you wish to set:
     PerlSetVar OPTION "VALUE"
 </Location>
+----
 
 The available options are:
 
diff --git a/docs/admin/apache_rewrite_tricks.txt b/docs/admin/apache_rewrite_tricks.txt
index 2b96797..5a0eea5 100644
--- a/docs/admin/apache_rewrite_tricks.txt
+++ b/docs/admin/apache_rewrite_tricks.txt
@@ -145,3 +145,4 @@ RewriteRule (.*) /%{ENG:eglibid}$1
 ----
 
 Note that template files themselves cannot be replaced in that manner.
+
diff --git a/docs/root.txt b/docs/root.txt
index 1becdc5..b2698a3 100644
--- a/docs/root.txt
+++ b/docs/root.txt
@@ -159,6 +159,9 @@ include::admin/sip_server.txt[]
 
 include::admin/apache_rewrite_tricks.txt[]
 
+include::admin/apache_access_handler.txt[]
+
+
 Using the Staff Client
 ======================
 

commit 8d57549d7e0611d1e0052aab56dfec8252101e93
Author: Remington Steed <rjs7 at calvin.edu>
Date:   Wed Jan 21 14:14:00 2015 -0500

    LP#1413621 Docs: Minor changes to Apache Rewrite Tricks
    
    This commit moves this doc file from TechRef into the official docs
    area, adds it to the root.txt file, and adds line breaks for easier
    viewing and editing of the file.
    
    Signed-off-by: Remington Steed <rjs7 at calvin.edu>

diff --git a/docs/TechRef/Apache/rewrite_tricks.txt b/docs/admin/apache_rewrite_tricks.txt
similarity index 71%
rename from docs/TechRef/Apache/rewrite_tricks.txt
rename to docs/admin/apache_rewrite_tricks.txt
index 28ed236..2b96797 100644
--- a/docs/TechRef/Apache/rewrite_tricks.txt
+++ b/docs/admin/apache_rewrite_tricks.txt
@@ -1,10 +1,14 @@
 Apache Rewrite Tricks
 ---------------------
-It is possible to use Apache's Rewrite Module features to perform a number of useful tricks that can make people's lives much easier.
+It is possible to use Apache's Rewrite Module features to perform a number of
+useful tricks that can make people's lives much easier.
 
 Short URLs
 ~~~~~~~~~~
-Making short URLs for common destinations can simplify making printed media as well as shortening or simplifying what people need to type. These are also easy to add and require minimal maintenance, and generally can be implemented with a single line addition to your eg_vhost.conf file.
+Making short URLs for common destinations can simplify making printed media as
+well as shortening or simplifying what people need to type. These are also easy
+to add and require minimal maintenance, and generally can be implemented with a
+single line addition to your eg_vhost.conf file.
 
 [source,conf]
 ----
@@ -17,18 +21,27 @@ RewriteRule ^/search/isbn/(.*) /eg/opac/results?_special=1&qtype=identifier|isbn
 
 Domain Based Content with RewriteMaps
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-One creative use of Rewrite features is domain-based configuration in a single eg_vhost.conf file. Regardless of how many VirtualHost blocks use the configuration you don't need to duplicate things for minor changes, and can in fact use wildcard VirtualHost blocks to serve multiple subdomains.
+One creative use of Rewrite features is domain-based configuration in a single
+eg_vhost.conf file. Regardless of how many VirtualHost blocks use the
+configuration you don't need to duplicate things for minor changes, and can in
+fact use wildcard VirtualHost blocks to serve multiple subdomains.
 
-For the wildcard blocks you will want to use a ServerAlias directive, and for SSL VirtualHost blocks ensure you have a wildcard SSL certificate.
+For the wildcard blocks you will want to use a ServerAlias directive, and for
+SSL VirtualHost blocks ensure you have a wildcard SSL certificate.
 
 [source,conf]
 ----
 ServerAlias *.example.com
 ----
 
-For actually changing things based on the domain, or subdomain, you can use RewriteMaps. Each RewriteMap is generally a lookup table of some kind. In the following examples we will generally use text files, though database lookups and external programs are also possible.
+For actually changing things based on the domain, or subdomain, you can use
+RewriteMaps. Each RewriteMap is generally a lookup table of some kind. In the
+following examples we will generally use text files, though database lookups
+and external programs are also possible.
 
-Note that in the examples below we generally store things in Environment Variables. From within Template Toolkit templates you can access environment variables with the ENV object.
+Note that in the examples below we generally store things in Environment
+Variables. From within Template Toolkit templates you can access environment
+variables with the ENV object.
 
 .Template Toolkit ENV example, link library name/url if set
 [source,html]
@@ -36,13 +49,15 @@ Note that in the examples below we generally store things in Environment Variabl
 [% IF ENV.eglibname && ENV.egliburl %]<a href="[% ENV.egliburl %]">[% ENV.eglibname %]</a>[% END %]
 ----
 
-The first lookup to do is a domain to identifier, allowing us to re-use identifiers for multiple domains. In addition we can also supply a default identifier, for when the domain isn't present in the lookup table.
+The first lookup to do is a domain to identifier, allowing us to re-use
+identifiers for multiple domains. In addition we can also supply a default
+identifier, for when the domain isn't present in the lookup table.
 
 .Apache Config
 [source,conf]
 ----
 # This internal map allows us to lowercase our hostname, removing case issues in our lookup table
-# If you preferr uppercase you can use "uppercase int:toupper" instead.
+# If you prefer uppercase you can use "uppercase int:toupper" instead.
 RewriteMap lowercase int:tolower
 # This provides a hostname lookup
 RewriteMap eglibid txt:/openils/conf/libid.txt
@@ -63,7 +78,8 @@ branch2.example.com BRANCH2
 branch3.example.com BRANCH3
 ----
 
-Once we have identifiers we can look other information up, when appropriate. For example, say we want to look up library names and URLs:
+Once we have identifiers we can look up other information, when appropriate.
+For example, say we want to look up library names and URLs:
 
 .Apache Config
 [source,conf]
@@ -115,12 +131,13 @@ BRANCH3 6
 CONS 1
 ----
 
-Going further, you could also replace files to be downloaded, such as images or stylesheets, on the fly:
+Going further, you could also replace files to be downloaded, such as images or
+stylesheets, on the fly:
 
 .Apache Config
 [source,conf]
 ----
-# A file exists based on eglibid and the requested file
+# Check if a file exists based on eglibid and the requested file name
 # Say, BRANCH1/opac/images/main_logo.png
 RewriteCond %{DOCUMENT_ROOT}/%{ENV:eglibid}%{REQUEST_URI} -f
 # Serve up the eglibid version of the file instead
diff --git a/docs/root.txt b/docs/root.txt
index b65180b..1becdc5 100644
--- a/docs/root.txt
+++ b/docs/root.txt
@@ -157,6 +157,8 @@ include::admin/phonelist.txt[]
 
 include::admin/sip_server.txt[]
 
+include::admin/apache_rewrite_tricks.txt[]
+
 Using the Staff Client
 ======================
 

commit 3643e4410012086365b8b7765a67c6e19552c07e
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Wed Jan 21 14:14:00 2015 -0500

    LP#1413621 Docs: Apache Rewrite Tricks
    
    Because multiple sites have found this kind of thing useful in the past.
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Remington Steed <rjs7 at calvin.edu>

diff --git a/docs/TechRef/Apache/rewrite_tricks.txt b/docs/TechRef/Apache/rewrite_tricks.txt
new file mode 100644
index 0000000..28ed236
--- /dev/null
+++ b/docs/TechRef/Apache/rewrite_tricks.txt
@@ -0,0 +1,130 @@
+Apache Rewrite Tricks
+---------------------
+It is possible to use Apache's Rewrite Module features to perform a number of useful tricks that can make people's lives much easier.
+
+Short URLs
+~~~~~~~~~~
+Making short URLs for common destinations can simplify making printed media as well as shortening or simplifying what people need to type. These are also easy to add and require minimal maintenance, and generally can be implemented with a single line addition to your eg_vhost.conf file.
+
+[source,conf]
+----
+# My Account - http://host.ext/myaccount -> My Account Page
+RewriteRule ^/myaccount https://%{HTTP_HOST}/eg/opac/myopac/main [R]
+
+# ISBN Search - http://host.ext/search/isbn/<ISBN NUMBER> -> Search Page
+RewriteRule ^/search/isbn/(.*) /eg/opac/results?_special=1&qtype=identifier|isbn&query=$1 [R]
+----
+
+Domain Based Content with RewriteMaps
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+One creative use of Rewrite features is domain-based configuration in a single eg_vhost.conf file. Regardless of how many VirtualHost blocks use the configuration you don't need to duplicate things for minor changes, and can in fact use wildcard VirtualHost blocks to serve multiple subdomains.
+
+For the wildcard blocks you will want to use a ServerAlias directive, and for SSL VirtualHost blocks ensure you have a wildcard SSL certificate.
+
+[source,conf]
+----
+ServerAlias *.example.com
+----
+
+For actually changing things based on the domain, or subdomain, you can use RewriteMaps. Each RewriteMap is generally a lookup table of some kind. In the following examples we will generally use text files, though database lookups and external programs are also possible.
+
+Note that in the examples below we generally store things in Environment Variables. From within Template Toolkit templates you can access environment variables with the ENV object.
+
+.Template Toolkit ENV example, link library name/url if set
+[source,html]
+----
+[% IF ENV.eglibname && ENV.egliburl %]<a href="[% ENV.egliburl %]">[% ENV.eglibname %]</a>[% END %]
+----
+
+The first lookup to do is a domain to identifier, allowing us to re-use identifiers for multiple domains. In addition we can also supply a default identifier, for when the domain isn't present in the lookup table.
+
+.Apache Config
+[source,conf]
+----
+# This internal map allows us to lowercase our hostname, removing case issues in our lookup table
+# If you preferr uppercase you can use "uppercase int:toupper" instead.
+RewriteMap lowercase int:tolower
+# This provides a hostname lookup
+RewriteMap eglibid txt:/openils/conf/libid.txt
+# This stores the identifier in a variable (eglibid) for later use
+# In this case CONS is the default value for when the lookup table has no entry
+RewriteRule . - [E=eglibid:${eglibid:${lowercase:%{HTTP_HOST}}|CONS}]
+----
+
+.Contents of libid.txt File
+[source,txt]
+----
+# Comments can be included
+# Multiple TLDs for Branch 1
+branch1.example.com BRANCH1
+branch1.example.net BRANCH1
+# Branches 2 and 3 don't have alternate TLDs
+branch2.example.com BRANCH2
+branch3.example.com BRANCH3
+----
+
+Once we have identifiers we can look other information up, when appropriate. For example, say we want to look up library names and URLs:
+
+.Apache Config
+[source,conf]
+----
+# Library Name Lookup - Note we provide no default in this case.
+RewriteMap eglibname txt:/openils/conf/libname.txt
+RewriteRule . - [E=eglibname:${eglibname:%{ENV:eglibid}}]
+# Library URL Lookup - Also with no default.
+RewriteMap egliburl txt:/openils/conf/liburl.txt
+RewriteRule . - [E=egliburl:${egliburl:%{ENV:eglibid}}]
+----
+
+.Contents of libname.txt File
+[source,txt]
+----
+# Note that we cannot have spaces in the "value", so instead   is used.   is also an option.
+BRANCH1 Branch One
+BRANCH2 Branch Two
+BRANCH3 Branch Three
+CONS Example Consortium Name
+----
+
+.Contents of liburl.txt File
+[source,txt]
+----
+BRANCH1 http://branch1.example.org
+BRANCH2 http://branch2.example.org
+BRANCH3 http://branch3.example.org
+CONS http://example.org
+----
+
+Or, perhaps set the "physical location" variable for default search/display library:
+
+.Apache Config
+[source,conf]
+----
+# Lookup "physical location" IDs
+RewriteMap eglibphysloc txt:/openils/conf/libphysloc.txt
+# Note: physical_loc is a variable used in the TTOPAC and should not be re-named
+RewriteRule . - [E=physical_loc:${eglibphysloc:%{ENV:eglibid}}]
+----
+
+.Contents of libphysloc.txt File
+[source,txt]
+----
+BRANCH1 4
+BRANCH2 5
+BRANCH3 6
+CONS 1
+----
+
+Going further, you could also replace files to be downloaded, such as images or stylesheets, on the fly:
+
+.Apache Config
+[source,conf]
+----
+# A file exists based on eglibid and the requested file
+# Say, BRANCH1/opac/images/main_logo.png
+RewriteCond %{DOCUMENT_ROOT}/%{ENV:eglibid}%{REQUEST_URI} -f
+# Serve up the eglibid version of the file instead
+RewriteRule (.*) /%{ENG:eglibid}$1
+----
+
+Note that template files themselves cannot be replaced in that manner.

-----------------------------------------------------------------------

Summary of changes:
 .../Apache => admin}/apache_access_handler.txt     |   16 ++-
 docs/admin/apache_rewrite_tricks.txt               |  148 ++++++++++++++++++++
 docs/installation/server_installation.txt          |    4 +
 docs/root.txt                                      |    5 +
 4 files changed, 166 insertions(+), 7 deletions(-)
 rename docs/{TechRef/Apache => admin}/apache_access_handler.txt (91%)
 create mode 100644 docs/admin/apache_rewrite_tricks.txt


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list