2014-09-12 14:12:10 +03:00
|
|
|
|
#!/bin/sh
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
2018-01-20 21:05:38 +02:00
|
|
|
|
OUT=/dev/null
|
|
|
|
|
|
|
2014-09-12 14:12:10 +03:00
|
|
|
|
if [ "$1" = configure ]; then
|
2017-12-22 16:20:19 +02:00
|
|
|
|
if ! getent passwd kdcproxy > $OUT; then
|
|
|
|
|
|
adduser --quiet --system --home / \
|
|
|
|
|
|
--shell /usr/sbin/nologin --group \
|
|
|
|
|
|
--no-create-home --gecos "IPA KDC Proxy User" \
|
|
|
|
|
|
kdcproxy > $OUT
|
|
|
|
|
|
fi
|
|
|
|
|
|
if ! getent passwd ipaapi > $OUT; then
|
|
|
|
|
|
adduser --quiet --system --home / \
|
|
|
|
|
|
--shell /usr/sbin/nologin --group \
|
|
|
|
|
|
--no-create-home --gecos "IPA Framework User" \
|
|
|
|
|
|
ipaapi > $OUT
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
2018-04-20 20:21:55 +03:00
|
|
|
|
# fix upgrade
|
2018-05-20 17:20:18 +03:00
|
|
|
|
if dpkg --compare-versions "$2" lt "4.7.0~pre2-1"; then
|
2018-04-20 20:21:55 +03:00
|
|
|
|
# mod_nss needs to be disabled before mod_ssl is enabled
|
|
|
|
|
|
if [ -e /etc/apache2/mods-enabled/nss.load ]; then
|
|
|
|
|
|
. /usr/share/apache2/apache2-maintscript-helper
|
|
|
|
|
|
apache2_invoke dismod nss || exit $?
|
|
|
|
|
|
# and if that's not enough, just remove the links to be sure
|
2018-10-18 14:06:09 +03:00
|
|
|
|
rm /etc/apache2/mods-enabled/nss.load /etc/apache2/mods-enabled/nss.conf
|
2018-04-20 20:21:55 +03:00
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# this is new in tmpfiles.d/ipa.conf, need to create it here
|
|
|
|
|
|
# for the upgrader
|
|
|
|
|
|
if [ ! -e /var/run/ipa/ccaches ]; then
|
|
|
|
|
|
mkdir /var/run/ipa/ccaches
|
|
|
|
|
|
chown ipaapi:ipaapi /var/run/ipa/ccaches
|
|
|
|
|
|
chmod 770 /var/run/ipa/ccaches
|
|
|
|
|
|
fi
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
2018-04-06 17:20:11 +03:00
|
|
|
|
chmod 711 /var/lib/ipa/sysrestore > $OUT || true
|
|
|
|
|
|
chmod 700 /var/lib/ipa/passwds > $OUT || true
|
|
|
|
|
|
chmod 700 /var/lib/ipa/private > $OUT || true
|
|
|
|
|
|
|
2017-12-22 16:20:19 +02:00
|
|
|
|
# add www-data to ipaapi group
|
|
|
|
|
|
if ! id -Gn www-data | grep '\bipaapi\b' >/dev/null; then
|
|
|
|
|
|
usermod www-data -a -G ipaapi
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
2014-10-21 00:02:15 +03:00
|
|
|
|
if [ -e /usr/share/apache2/apache2-maintscript-helper ]; then
|
2014-10-15 15:26:24 +03:00
|
|
|
|
. /usr/share/apache2/apache2-maintscript-helper
|
2016-01-04 22:15:23 +02:00
|
|
|
|
if [ ! -e /etc/apache2/mods-enabled/auth_gssapi.load ]; then
|
|
|
|
|
|
apache2_invoke enmod auth_gssapi || exit $?
|
2014-10-21 00:02:15 +03:00
|
|
|
|
fi
|
2014-10-31 08:12:06 +02:00
|
|
|
|
if [ ! -e /etc/apache2/mods-enabled/authz_user.load ]; then
|
|
|
|
|
|
apache2_invoke enmod authz_user || exit $?
|
|
|
|
|
|
fi
|
|
|
|
|
|
if [ ! -e /etc/apache2/mods-enabled/deflate.load ]; then
|
|
|
|
|
|
apache2_invoke enmod deflate || exit $?
|
|
|
|
|
|
fi
|
2014-10-21 00:02:15 +03:00
|
|
|
|
if [ ! -e /etc/apache2/mods-enabled/expires.load ]; then
|
|
|
|
|
|
apache2_invoke enmod expires || exit $?
|
|
|
|
|
|
fi
|
|
|
|
|
|
if [ ! -e /etc/apache2/mods-enabled/headers.load ]; then
|
|
|
|
|
|
apache2_invoke enmod headers || exit $?
|
|
|
|
|
|
fi
|
2017-12-22 19:24:12 +02:00
|
|
|
|
if [ ! -e /etc/apache2/mods-enabled/lookup_identity.load ]; then
|
|
|
|
|
|
apache2_invoke enmod lookup_identity || exit $?
|
|
|
|
|
|
fi
|
2014-10-21 00:02:15 +03:00
|
|
|
|
if [ ! -e /etc/apache2/mods-enabled/proxy.load ]; then
|
|
|
|
|
|
apache2_invoke enmod proxy || exit $?
|
|
|
|
|
|
fi
|
2016-03-01 17:39:32 +02:00
|
|
|
|
if [ ! -e /etc/apache2/mods-enabled/proxy_ajp.load ]; then
|
|
|
|
|
|
apache2_invoke enmod proxy_ajp || exit $?
|
|
|
|
|
|
fi
|
2016-03-02 11:42:19 +02:00
|
|
|
|
if [ ! -e /etc/apache2/mods-enabled/proxy_http.load ]; then
|
|
|
|
|
|
apache2_invoke enmod proxy_http || exit $?
|
|
|
|
|
|
fi
|
2014-10-21 00:02:15 +03:00
|
|
|
|
if [ ! -e /etc/apache2/mods-enabled/rewrite.load ]; then
|
|
|
|
|
|
apache2_invoke enmod rewrite || exit $?
|
|
|
|
|
|
fi
|
2018-02-22 03:15:48 +02:00
|
|
|
|
if [ ! -e /etc/apache2/mods-enabled/session.load ]; then
|
|
|
|
|
|
apache2_invoke enmod session || exit $?
|
|
|
|
|
|
fi
|
|
|
|
|
|
if [ ! -e /etc/apache2/mods-enabled/session_cookie.load ]; then
|
|
|
|
|
|
apache2_invoke enmod session_cookie || exit $?
|
|
|
|
|
|
fi
|
2018-04-06 17:31:43 +03:00
|
|
|
|
if [ ! -e /etc/apache2/mods-enabled/ssl.load ]; then
|
|
|
|
|
|
apache2_invoke enmod ssl || exit $?
|
|
|
|
|
|
fi
|
2018-04-11 19:50:10 +03:00
|
|
|
|
|
|
|
|
|
|
# Enable default SSL site
|
|
|
|
|
|
if [ ! -e /etc/apache2/sites-enabled/default-ssl.conf ]; then
|
|
|
|
|
|
apache2_invoke ensite default-ssl || exit $?
|
|
|
|
|
|
fi
|
2014-10-15 15:26:24 +03:00
|
|
|
|
fi
|
2014-09-12 14:12:10 +03:00
|
|
|
|
fi
|
|
|
|
|
|
|
2016-01-07 19:36:31 +02:00
|
|
|
|
if [ ! -e /run/apache2/ipa ]; then
|
|
|
|
|
|
mkdir -m 0700 /run/apache2/ipa
|
|
|
|
|
|
chown www-data:www-data /run/apache2/ipa
|
|
|
|
|
|
|
|
|
|
|
|
if [ ! -e /run/apache2/ipa/clientcaches ]; then
|
|
|
|
|
|
mkdir -m 0700 /run/apache2/ipa/clientcaches
|
|
|
|
|
|
chown www-data:www-data /run/apache2/ipa/clientcaches
|
|
|
|
|
|
fi
|
|
|
|
|
|
if [ ! -e /run/apache2/ipa/krbcache ]; then
|
|
|
|
|
|
mkdir -m 0700 /run/apache2/ipa/krbcache
|
|
|
|
|
|
chown www-data:www-data /run/apache2/ipa/krbcache
|
|
|
|
|
|
fi
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
2014-09-12 14:12:10 +03:00
|
|
|
|
#DEBHELPER#
|