From f1a4a16fc4e2c368ced79bc382a0b40d0070ba1c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Adam=20Go=C5=82=C4=99biowski?= Date: Sun, 26 Feb 2012 15:17:37 +0000 Subject: [PATCH] - triggers to ease upgrade to 2.4 (handles simple configuration properly) Changed files: apache.spec -> 1.663 --- apache.spec | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/apache.spec b/apache.spec index 5e9ad3b..104fdd0 100644 --- a/apache.spec +++ b/apache.spec @@ -2411,6 +2411,16 @@ if [ ! -L /etc/httpd/httpd.conf ]; then install -d /etc/httpd ln -s conf.d /etc/httpd/httpd.conf fi +if [ -f /etc/sysconfig/httpd ]; then + MPM=$(grep HTTPD_MPM /etc/sysconfig/httpd |sed 's,HTTPD_MPM=,,;s,",,g') + if [ -n $MPM ]; then + echo "LoadModule mpm_${MPM}_module modules/mod_mpm_${MPM}.so" > /etc/httpd/conf.d/10_mpm.conf.rpmnew + cat /etc/httpd/conf.d/10_mpm.conf >> /etc/httpd/conf.d/10_mpm.conf.rpmnew + mv /etc/httpd/conf.d/10_mpm.conf.rpmnew /etc/httpd/conf.d/10_mpm.conf + sed -i -e 's,HTTPD_MPM.*,,g' /etc/sysconfig/httpd + fi +fi + exit 0 %post base @@ -2526,6 +2536,18 @@ if [ -z "$HTTPD_CONF" ]; then fi %systemd_trigger httpd.service +%triggerpostun base -- %{name} < 2.4.0 +cp -f /etc/httpd/apache.conf{,.rpmsave} +sed -i -e ' + /^DefaultType.*/s,.*,, + /^Include /s,^Include ,IncludeOptional , + /^NameVirtualHost.*/s,.*,, + /^User/s,^,LoadModule unixd_module modules/mod_unixd.so\n, +' /etc/httpd/apache.conf +sed -i -e ' + s,^LockFile /var/run/httpd/accept.lock,Mutex file:/var/run/httpd/,g +' /etc/httpd/conf.d/10_mpm.conf + %triggerpostun mod_ssl -- %{name}-mod_ssl < 1:2.2.0-3.1 cp -f /etc/httpd/conf.d/40_mod_ssl.conf{,.rpmsave} sed -i -e ' @@ -2533,6 +2555,13 @@ sed -i -e ' s,/var/cache/apache,/var/cache/httpd,g ' /etc/httpd/conf.d/40_mod_ssl.conf +%triggerpostun mod_ssl -- %{name}-mod_ssl < 1:2.4.0 +cp -f /etc/httpd/conf.d/40_mod_ssl.conf{,.rpmsave} +sed -i -e ' + /^SSLMutex/s,^,#, + /^NameVirtualHost.*/s,.*,, +' /etc/httpd/conf.d/40_mod_ssl.conf + %posttrans base # restore lock which we disabled in pretrans mv -f /var/lock/subsys/httpd{.disabled,} 2>/dev/null -- 2.44.0