# nuke very-old config location (this mostly for Ra)
if [ -f /etc/httpd/httpd.conf ]; then
sed -i -e "/^Include.*%{name}.conf/d" /etc/httpd/httpd.conf
+ /usr/sbin/webapp register httpd %{_webapp}
httpd_reload=1
fi
if [ -f /etc/httpd/%{name}.conf.rpmsave ]; then
cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
mv -f /etc/httpd/%{name}.conf.rpmsave %{_sysconfdir}/httpd.conf
+ /usr/sbin/webapp register httpd %{_webapp}
httpd_reload=1
fi
rm -f /etc/apache-%{name}.conf.rpmsave
fi
-# place new config location, as trigger puts config only on first install, do it here.
-# apache1
-if [ -d /etc/apache/webapps.d ]; then
- /usr/sbin/webapp register apache %{_webapp}
- apache_reload=1
-fi
-# apache2
-if [ -d /etc/httpd/webapps.d ]; then
- /usr/sbin/webapp register httpd %{_webapp}
- httpd_reload=1
-fi
-# or if we're migrating from %apache_install macros we can depend on symlinks in conf.d/http.conf dirs
-# place new config location, as trigger puts config only on first install, do it here.
-# apache1
-if [ -L /etc/apache/conf.d/99_%{name}.conf ]; then
- rm -f /etc/apache/conf.d/99_%{name}.conf
- /usr/sbin/webapp register apache %{_webapp}
- apache_reload=1
-fi
-# apache2
-if [ -L /etc/httpd/httpd.conf/99_%{name}.conf ]; then
- rm -f /etc/httpd/httpd.conf/99_%{name}.conf
- /usr/sbin/webapp register httpd %{_webapp}
- httpd_reload=1
+# migrating from earlier apache-config?
+if [ -L /etc/apache/conf.d/99_%{name}.conf ] || [ -L /etc/httpd/httpd.conf/99_%{name}.conf ]; then
+ if [ -L /etc/apache/conf.d/99_%{name}.conf ]; then
+ rm -f /etc/apache/conf.d/99_%{name}.conf
+ /usr/sbin/webapp register apache %{_webapp}
+ apache_reload=1
+ fi
+ if [ -L /etc/httpd/httpd.conf/99_%{name}.conf ]; then
+ rm -f /etc/httpd/httpd.conf/99_%{name}.conf
+ /usr/sbin/webapp register httpd %{_webapp}
+ httpd_reload=1
+ fi
+else
+ # no earlier registration. assume migration from Ra
+ if [ -d /etc/apache/webapps.d ]; then
+ /usr/sbin/webapp register apache %{_webapp}
+ apache_reload=1
+ fi
+ if [ -d /etc/httpd/webapps.d ]; then
+ /usr/sbin/webapp register httpd %{_webapp}
+ httpd_reload=1
+ fi
fi
if [ "$httpd_reload" ]; then