Bugzilla – Attachment 23013 Details for
Bug 10646
mod_rewrite should be enabled by the postinst script
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10646 - warn if mod_rewrite is not enabled
Bug-10646---warn-if-modrewrite-is-not-enabled.patch (text/plain), 1.55 KB, created by
Robin Sheat
on 2013-11-19 03:22:52 UTC
(
hide
)
Description:
Bug 10646 - warn if mod_rewrite is not enabled
Filename:
MIME Type:
Creator:
Robin Sheat
Created:
2013-11-19 03:22:52 UTC
Size:
1.55 KB
patch
obsolete
>From 77354576a65bb6c81ce025becb0ebdcaf29e60aa Mon Sep 17 00:00:00 2001 >From: Robin Sheat <robin@catalyst.net.nz> >Date: Tue, 19 Nov 2013 16:19:12 +1300 >Subject: [PATCH] Bug 10646 - warn if mod_rewrite is not enabled > >Koha requires mod_rewrite. If it's not enabled in Apache, then >koha-create will now abort with a helpful error message. Also adds a >warning when not run as root to avoid confusing errors. > >Test plan: > * apply the patch > * a2dismod rewrite > * run koha-create without sudo, note the error about being root > * run koha-create with sudo, note the error about rewrite > * a2enmod rewrute > * repeat test above, note that it works >--- > debian/scripts/koha-create | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > >diff --git a/debian/scripts/koha-create b/debian/scripts/koha-create >index 7f05eb0..2c9752c 100755 >--- a/debian/scripts/koha-create >+++ b/debian/scripts/koha-create >@@ -349,6 +349,26 @@ else > MEMCACHED_PREFIX="" > fi > >+# Are we root? If not, the mod_rewrite check will fail and be confusing, so >+# we look into this first. >+if [[ $UID -ne 0 ]] >+then >+ die "This script must be run with root privileges." >+fi >+ >+# Check that mod_rewrite is installed so we can bail out if it's not. >+if ! /usr/sbin/apachectl -M 2> /dev/null | grep -q 'rewrite_module' >+then >+ cat 1>&2 <<EOM >+ >+Koha requires mod_rewrite to be enabled within Apache in order to run. >+Typically this can be enabled with: >+ >+ sudo a2enmod rewrite >+EOM >+ die >+fi >+ > opacdomain="$OPACPREFIX$name$OPACSUFFIX$DOMAIN" > intradomain="$INTRAPREFIX$name$INTRASUFFIX$DOMAIN" > >-- >1.8.1.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10646
:
19952
|
19969
|
23013
|
24072