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. A check for the right apache version is introduced, in the for of an IfVersion block: <IfVersion >= 2.4> --- Plack configuration here --- </IfVersion> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
This commit is contained in:
parent
4adc4ee5f8
commit
4182a08052
3 changed files with 58 additions and 0 deletions
25
debian/templates/apache-shared-intranet-plack.conf
vendored
Normal file
25
debian/templates/apache-shared-intranet-plack.conf
vendored
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
# Apache configuration settings that are shared for every Koha instance.
|
||||||
|
# This file contains settings for the Plack configuration of the intranet.
|
||||||
|
#
|
||||||
|
# This file should be included from an instance's
|
||||||
|
# /etc/apache2/site-available file, from within the VirtualHost section
|
||||||
|
# for the intranet.
|
||||||
|
|
||||||
|
# Plack is only available out-of-the-box for Apache 2.4.7+ setups
|
||||||
|
<IfVersion >= 2.4>
|
||||||
|
<IfModule mod_proxy_http.c>
|
||||||
|
|
||||||
|
ProxyPreserveHost On
|
||||||
|
|
||||||
|
# RequestHeader set X-FORWARDED-PROTO "https"
|
||||||
|
|
||||||
|
# Point the intranet site to Plack
|
||||||
|
ProxyPass /cgi-bin/koha "unix:/var/run/koha/${instance}/plack.sock|http://localhost/intranet"
|
||||||
|
ProxyPassReverse /cgi-bin/koha "unix:/var/run/koha/${instance}/plack.sock|http://localhost/intranet"
|
||||||
|
|
||||||
|
# Point the /api endpoint to Plack
|
||||||
|
# ProxyPass /api "unix:/var/run/koha/${instance}/plack.sock|http://localhost/api"
|
||||||
|
# ProxyPassReverse /api "unix:/var/run/koha/${instance}/plack.sock|http://localhost/api"
|
||||||
|
|
||||||
|
</IfModule>
|
||||||
|
</IfVersion>
|
25
debian/templates/apache-shared-opac-plack.conf
vendored
Normal file
25
debian/templates/apache-shared-opac-plack.conf
vendored
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
# Plack is only available out-of-the-box for Apache 2.4.7+ setups
|
||||||
|
<IfVersion >= 2.4>
|
||||||
|
<IfModule mod_proxy_http.c>
|
||||||
|
|
||||||
|
ProxyPreserveHost On
|
||||||
|
|
||||||
|
# RequestHeader set X-FORWARDED-PROTO "https"
|
||||||
|
|
||||||
|
# Point the intranet site to Plack
|
||||||
|
ProxyPass /cgi-bin/koha "unix:/var/run/koha/${instance}/plack.sock|http://localhost/opac"
|
||||||
|
ProxyPassReverse /cgi-bin/koha "unix:/var/run/koha/${instance}/plack.sock|http://localhost/opac"
|
||||||
|
|
||||||
|
# Point the /api endpoint to Plack
|
||||||
|
# ProxyPass /api "unix:/var/run/koha/${instance}/plack.sock|http://localhost/api"
|
||||||
|
# ProxyPassReverse /api "unix:/var/run/koha/${instance}/plack.sock|http://localhost/api"
|
||||||
|
|
||||||
|
</IfModule>
|
||||||
|
</IfVersion>
|
8
debian/templates/apache-site.conf.in
vendored
8
debian/templates/apache-site.conf.in
vendored
|
@ -2,8 +2,12 @@
|
||||||
|
|
||||||
# OPAC
|
# OPAC
|
||||||
<VirtualHost *:__OPACPORT__>
|
<VirtualHost *:__OPACPORT__>
|
||||||
|
<IfVersion >= 2.4>
|
||||||
|
Define instance "__KOHASITE__"
|
||||||
|
</IfVersion>
|
||||||
Include /etc/koha/apache-shared.conf
|
Include /etc/koha/apache-shared.conf
|
||||||
# Include /etc/koha/apache-shared-disable.conf
|
# Include /etc/koha/apache-shared-disable.conf
|
||||||
|
# Include /etc/koha/apache-shared-opac-plack.conf
|
||||||
Include /etc/koha/apache-shared-opac.conf
|
Include /etc/koha/apache-shared-opac.conf
|
||||||
|
|
||||||
ServerName __OPACSERVER__
|
ServerName __OPACSERVER__
|
||||||
|
@ -19,8 +23,12 @@
|
||||||
|
|
||||||
# Intranet
|
# Intranet
|
||||||
<VirtualHost *:__INTRAPORT__>
|
<VirtualHost *:__INTRAPORT__>
|
||||||
|
<IfVersion >= 2.4>
|
||||||
|
Define instance "__KOHASITE__"
|
||||||
|
</IfVersion>
|
||||||
Include /etc/koha/apache-shared.conf
|
Include /etc/koha/apache-shared.conf
|
||||||
# Include /etc/koha/apache-shared-disable.conf
|
# Include /etc/koha/apache-shared-disable.conf
|
||||||
|
# Include /etc/koha/apache-shared-intranet-plack.conf
|
||||||
Include /etc/koha/apache-shared-intranet.conf
|
Include /etc/koha/apache-shared-intranet.conf
|
||||||
|
|
||||||
ServerName __INTRASERVER__
|
ServerName __INTRASERVER__
|
||||||
|
|
Loading…
Reference in a new issue