diff --git a/install/alternc.install b/install/alternc.install index 95060b7c..10bcbacc 100644 --- a/install/alternc.install +++ b/install/alternc.install @@ -79,7 +79,7 @@ if [ -e /etc/default/saslauthd ]; then fi if [ -e /etc/dovecot/dovecot.conf ]; then - CONFIG_FILES="$CONFIG_FILES etc/dovecot/alternc-sql.conf etc/dovecot/alternc-dict-quota.conf etc/dovecot/conf.d/95_alternc.conf" + CONFIG_FILES="$CONFIG_FILES etc/dovecot/dovecot.conf etc/dovecot/dovecot-sql.conf etc/dovecot/dovecot-dict-quota.conf" fi INSTALLED_CONFIG_TAR="/var/lib/alternc/backups/etc-installed.tar.gz" @@ -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,14 +311,13 @@ 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 # We enable dovecot SSL certificate instructions: (on wheezy we should use a new file in /etc/dovecot/conf.d/ ) - ( echo "# Don't change this file, it will be overwriten by alternc.install. Change ssl parameters in a file named 99_ssl.conf instead" ; echo "ssl_cert = /etc/dovecot/conf.d/96_ssl.conf + sed -i -e 's#^ssl_cert_file.*$#ssl_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem#' -e 's#^ssl_key_file.*$#ssl_key_file = /etc/ssl/private/ssl-cert-snakeoil.key#' /etc/dovecot/dovecot.conf else # We disable proftpd tls module @@ -335,18 +326,17 @@ if [ -x /usr/sbin/apache2 ]; then cp /etc/proftpd/modules.conf /etc/alternc/templates/proftpd/ # We disable dovecot SSL certificate instructions: (on wheezy we should remove a file in /etc/dovecot/conf.d/ ) - ( echo "# Don't change this file, it will be overwriten by alternc.install. Change ssl parameters in a file named 99_ssl.conf instead" ; echo "ssl_cert = /etc/dovecot/conf.d/96_ssl.conf + sed -i -e 's#^ssl_cert_file.*$#ssl_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem#' -e 's#^ssl_key_file.*$#ssl_key_file = /etc/ssl/private/ssl-cert-snakeoil.key#' /etc/dovecot/dovecot.conf 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")' @@ -592,14 +582,9 @@ else mysql --defaults-file=/etc/alternc/my.cnf -e "UPDATE db_servers SET host='$MYSQL_HOST', login='$MYSQL_USER', password='$MYSQL_PASS', client='$MYSQL_HOST_CLIENT' WHERE name='Default';" fi -# giving vmail user read access on dovecot sql file -chgrp vmail /etc/dovecot/alternc-sql.conf -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/" +#giving vmail user read access on dovecot sql file +chgrp vmail /etc/dovecot/dovecot.conf +chmod g+r /etc/dovecot/dovecot.conf # 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 +597,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 +605,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 +613,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