diff --git a/install/alternc.install b/install/alternc.install index 95060b7c..5d92cf0c 100644 --- a/install/alternc.install +++ b/install/alternc.install @@ -279,20 +279,12 @@ rm -f $SED_SCRIPT # Ad-hoc fixes # -php="`ls /usr/lib/apache*/*/*php*.so | sed -e 's/^.*libphp\(.*\)\.so$/\1/' | tail -1`" -if [ "$php" = "7.0" ] -then - ln -fs /etc/alternc/alternc.ini /etc/php/$php/apache2/conf.d/alternc.ini || true - ln -fs /etc/alternc/alternc.ini /etc/php/$php/cli/conf.d/alternc.ini || true -else - ln -fs /etc/alternc/alternc.ini /etc/php$php/apache2/conf.d/alternc.ini || true - ln -fs /etc/alternc/alternc.ini /etc/php$php/cli/conf.d/alternc.ini || true -fi - +php="`ls /usr/lib/apache*/*/*php*.so | sed -e 's/^.*libphp\(.\)\.so$/php\1/' | tail -1`" +ln -fs /etc/alternc/alternc.ini /etc/$php/apache2/conf.d/alternc.ini || true +ln -fs /etc/alternc/alternc.ini /etc/$php/cli/conf.d/alternc.ini || true if [ -x /usr/sbin/apache2 ]; then # hook run-parts --arg=apache2 /usr/lib/alternc/install.d - a2enmod mpm_itk s="" # unused from AlternC 1.0, FIXME: remove it later @@ -301,9 +293,9 @@ if [ -x /usr/sbin/apache2 ]; then a2dismod vhost_alias s="apache2" fi - if ! [ -L /etc/apache2/mods-enabled/php$php.load ] + if ! [ -L /etc/apache2/mods-enabled/$php.load ] then - a2enmod php$php + a2enmod $php fi if ! [ -L /etc/apache2/mods-enabled/rewrite.load ] then @@ -319,9 +311,8 @@ if [ -x /usr/sbin/apache2 ]; then a2enmod ssl s="apache2" fi - if [ ! -h /etc/apache2/conf-available/alternc-ssl.conf ] && [ -e /etc/apache2/conf-available/ ]; then - ln -sf /etc/alternc/apache2-ssl.conf /etc/apache2/conf-available/alternc-ssl.conf - a2enconf alternc-ssl + if [ ! -h /etc/apache2/conf.d/alternc-ssl.conf ] && [ -e /etc/apache2/conf.d/ ]; then + ln -sf /etc/alternc/apache2-ssl.conf /etc/apache2/conf.d/alternc-ssl.conf s="apache2" fi @@ -340,13 +331,12 @@ if [ -x /usr/sbin/apache2 ]; then echo "SSL not configured" echo "create a certificate in /etc/alternc/apache.pem and rerun alternc.install" fi - if [ ! -h /etc/apache2/conf-available/alternc.conf ] && [ -e /etc/apache2/conf-available/ ]; then - ln -sf /etc/alternc/apache2.conf /etc/apache2/conf-available/alternc.conf - a2enconf alternc.conf + if [ ! -h /etc/apache2/conf.d/alternc.conf ] && [ -e /etc/apache2/conf.d/ ]; then + ln -sf /etc/alternc/apache2.conf /etc/apache2/conf.d/alternc.conf s="apache2" fi - if [ -e /etc/apache2/sites-enabled/000-default.conf ]; then - a2dissite 000-default + if [ -e /etc/apache2/sites-enabled/000-default ]; then + a2dissite default s="apache2" fi SERVICES="$SERVICES $s" @@ -440,7 +430,7 @@ OLDDESTINATION=`postconf mydestination | awk -F '=' '{print $2}'` echo "$OLDDESTINATION" | grep -q -v "$FQDN" && postconf -e "mydestination = $FQDN, $OLDDESTINATION" # Remove phpmyadmin apache2 configuration -a2disconf phpmyadmin +rm -f /etc/apache2/conf.d/phpmyadmin.conf || true # Configure PHPMyAdmin include_str='include("/etc/alternc/phpmyadmin.inc.php")' @@ -598,9 +588,6 @@ chmod g+r /etc/dovecot/alternc-sql.conf # Override some dovecot 2.0 configuration that may have happened during dovecot postinst: sed -i -e 's/^ *!include/#!include/' /etc/dovecot/conf.d/10-auth.conf -# Changing owner of web panel's files -chown -R alterncpanel:alterncpanel "/usr/share/alternc/panel/" - # We force the re-computing of the DNS zones, since we may have changed the IP address (see #460) /usr/bin/mysql --defaults-file="/etc/alternc/my.cnf" -B -e "update domaines set dns_action='UPDATE' WHERE gesdns=1;" @@ -612,7 +599,7 @@ grep -q "^localhost\$" /etc/opendkim/TrustedHosts || echo "localhost" >>/etc/ope grep -q "^$PUBLIC_IP\$" /etc/opendkim/TrustedHosts || echo "$PUBLIC_IP" >>/etc/opendkim/TrustedHosts # Add opendkim to service to restart -SERVICES="$SERVICES opendkim bind9" +SERVICES="$SERVICES opendkim" # hook run-parts --arg=before-reload /usr/lib/alternc/install.d @@ -620,7 +607,7 @@ run-parts --arg=before-reload /usr/lib/alternc/install.d ####################################################################### # Reload services # -for service in postfix dovecot cron proftpd ; do +for service in postfix bind9 apache2 dovecot cron proftpd ; do invoke-rc.d $service force-reload || true done @@ -628,10 +615,6 @@ done for service in $SERVICES; do test -x /etc/init.d/$service && invoke-rc.d $service stop || true done - -# on Jessie, apache2 does not stop/start properly due to "service" and "apache2ctl" having different behavior pid-file-wise -killall apache2 - for service in $SERVICES; do test -x /etc/init.d/$service && invoke-rc.d $service start || true done