From b5e5005eba0ec267edae3fe45ddff5fcdaaf67bd Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Thu, 13 Aug 2015 14:02:42 -0300 Subject: [PATCH] Bug 13791: Apache configuration files This patch adds an include to each VirtualHost definition (OPAC and Intranet) and a variable definition, taking advantage of Apache 2.4.x features. The instance name is reused inside the includes providing a simple way of dealing with the apache <-> plack configuration. --- debian/templates/apache-shared-intranet-plack.conf | 12 ++++++++++++ debian/templates/apache-shared-opac-plack.conf | 11 +++++++++++ debian/templates/apache-site.conf.in | 4 ++++ 3 files changed, 27 insertions(+) create mode 100644 debian/templates/apache-shared-intranet-plack.conf create mode 100644 debian/templates/apache-shared-opac-plack.conf diff --git a/debian/templates/apache-shared-intranet-plack.conf b/debian/templates/apache-shared-intranet-plack.conf new file mode 100644 index 0000000..2144aba --- /dev/null +++ b/debian/templates/apache-shared-intranet-plack.conf @@ -0,0 +1,12 @@ +# Apache configuration settings that are shared for every Koha instance. +# This file contains settings for the Plack configuration of the +# intranet site. +# +# This file should be included from an instance's +# /etc/apache2/site-available file, from within the VirtualHost section +# for the intranet. + +ProxyPreserveHost On +RequestHeader set X-FORWARDED-PROTO "http" +ProxyPass /cgi-bin/koha "unix:/var/run/koha/${instance}/plack.sock|http://localhost/intranet" +#ProxyPass /api "unix:/var/run/koha/${instance}/plack.sock|http://localhost/api" diff --git a/debian/templates/apache-shared-opac-plack.conf b/debian/templates/apache-shared-opac-plack.conf new file mode 100644 index 0000000..57b83b3 --- /dev/null +++ b/debian/templates/apache-shared-opac-plack.conf @@ -0,0 +1,11 @@ +# Apache configuration settings that are shared for every Koha instance. +# This file contains settings for the Plack configuration of the OPAC. +# +# This file should be included from an instance's +# /etc/apache2/site-available file, from within the VirtualHost section +# for the OPAC. + +ProxyPreserveHost On +RequestHeader set X-FORWARDED-PROTO "http" +ProxyPass /cgi-bin/koha "unix:/var/run/koha/${instance}/plack.sock|http://localhost/opac" +#ProxyPass /api "unix:/var/run/koha/${instance}/plack.sock|http://localhost/api" diff --git a/debian/templates/apache-site.conf.in b/debian/templates/apache-site.conf.in index dd30bc6..bb8cda7 100644 --- a/debian/templates/apache-site.conf.in +++ b/debian/templates/apache-site.conf.in @@ -2,8 +2,10 @@ # OPAC + Define instance "__KOHASITE__" Include /etc/koha/apache-shared.conf # Include /etc/koha/apache-shared-disable.conf +# Include /etc/koha/apache-shared-opac-plack.conf Include /etc/koha/apache-shared-opac.conf ServerName __OPACSERVER__ @@ -19,8 +21,10 @@ # Intranet + Define instance "__KOHASITE__" Include /etc/koha/apache-shared.conf # Include /etc/koha/apache-shared-disable.conf +# Include /etc/koha/apache-shared-intranet-plack.conf Include /etc/koha/apache-shared-intranet.conf ServerName __INTRASERVER__ -- 2.5.0