Koha Test Wiki MW Canasta on Koha Portainer
Test major Koha Wiki changes or bug fixes here without fear of breaking the production wiki.
For the current Koha Wiki, visit https://wiki.koha-community.org .Override sysprefs in Apache config
Jump to navigation
Jump to search
It is possible to override specific system preferences in the Apache config. This enables things like:
- Multiple OPACs with different CSS
- Multiple OPACs with different default search limits
- Self check out with different users for different libraries
Examples
On an installation using the Debian packages, your site specific Apache config file will be located at:
/etc/apache2/sites-enabled/<instance>.conf
Add something like the following to set up SCO with a given user and password:
RequestHeader add X-Koha-SetEnv "OVERRIDE_SYSPREF_AutoSelfCheckAllowed 1" RequestHeader add X-Koha-SetEnv "OVERRIDE_SYSPREF_AutoSelfCheckID xyz" RequestHeader add X-Koha-SetEnv "OVERRIDE_SYSPREF_AutoSelfCheckPass abc"
To limit search to the "MYLIB" library:
RequestHeader add X-Koha-SetEnv "OPAC_SEARCH_LIMIT branch:MYLIB" RequestHeader add X-Koha-SetEnv "OPAC_LIMIT_OVERRIDE 1"
An example for using different self-check users depending on the client IP (with Apache 2.4):
<If "-R 'CLIENT_OR_NET_IP_HERE'"> # Koha without Plack SetEnv OVERRIDE_SYSPREF_AutoSelfCheckID "xyz" SetEnv OVERRIDE_SYSPREF_AutoSelfCheckPass "abc" # Koha with Plack # (commas must be escaped with '\') RequestHeader add X-Koha-SetEnv "OVERRIDE_SYSPREF_AutoSelfCheckID xyz" RequestHeader add X-Koha-SetEnv "OVERRIDE_SYSPREF_AutoSelfCheckPass abc" </If>
See also
- Koha::Middleware::SetEnv
- Bug 16520 - Per-virtualhost SetEnvs don't work with Plack (FIXED)
- Bug 28955 - Add option to set default branch from Apache