diff --git a/install_httpd-2.4.sh b/install_httpd-2.4.sh index 192ff27..127ed9a 100755 --- a/install_httpd-2.4.sh +++ b/install_httpd-2.4.sh @@ -1632,35 +1632,37 @@ if $START_AT_BOOTTIME && $APACHE_WEBSERVICE_RUNNING ; then error "Stopping Apache Webservice failed!" fi + PIDS="$(ps aux | grep -E "(bin/apache2 |bin/httpd )" | grep -v grep | awk '{print$2}')" + declare -i i=0 -# # - Does NOT wor - don't know why -# # - -# declare -i i=0 -# if [[ -n "$_httpd_binary" ]] ; then -# -# sleep 5 -# -# PIDS="$(ps aux | grep "$(realpath "$_httpd_binary")" | grep -v grep | awk '{print$2}')" -# -# while [[ "X$PIDS" != "X" ]]; do -# -# if [[ $i -eq 0 ]]; then -# warn "Stopping Apache Webservice failed. Going to kill remaining httpd-processes.." -# fi -# -# if [[ $i -gt 10 ]]; then -# error "Killing remaining httpd-processes failed !" -# break -# fi -# -# for _PID in $PIDS ; do -# kill -9 $_PID > /dev/null 2>&1 -# done -# sleep 2 -# PIDS="$(ps aux | grep "$(realpath "$_httpd_binary")" | grep -v grep | awk '{print$2}')" -# i=i+1 -# done -# fi + while [[ -n "${PIDS}" ]]; do + + if [[ $i -eq 0 ]]; then + warn "Stopping Apache Webservice failed." + echononl "\tGoing to kill remaining httpd-processes .." + echo "" >> ${_logdir}/main.log + echo "## - Going to kill remaining httpd-processes" >> ${_logdir}/main.log + echo "## -" >> ${_logdir}/main.log + fi + + if [[ $i -gt 10 ]]; then + echo_failed + erro "Killing remaining httpd-processes failed !" + break + fi + + sleep 2 + + for _PID in $PIDS ; do + echo "kill -9 $_PID" >> ${_logdir}/main.log + kill -9 $_PID >> ${_logdir}/main.log 2>&1 + done + + PIDS="$(ps aux | grep -E "(bin/apache2 |bin/httpd )" | grep -v grep | awk '{print$2}')" + (( i++ )) + + [[ $i -le 10 ]] && echo_ok + done else echo_skipped @@ -3494,22 +3496,10 @@ cat <> ${PREFIX}/conf/vhosts/00default.conf - # -- dummy.${_DOMAIN}.$_TLD -- # -EOF -if $SEPARATE_LISTEN_DIRECTIVES ; then - cat <> ${PREFIX}/conf/vhosts/00default.conf - - -EOF -else - cat <> ${PREFIX}/conf/vhosts/00default.conf -EOF -fi -cat <> ${PREFIX}/conf/vhosts/00default.conf ServerName dummy.${_DOMAIN}.$_TLD RewriteEngine On @@ -3524,19 +3514,8 @@ cat <> ${PREFIX}/conf/vhosts/00default.conf ErrorLog /var/log/apache2/dummy.${_DOMAIN}.${_TLD}.error -EOF -if $SEPARATE_LISTEN_DIRECTIVES ; then - cat <> ${PREFIX}/conf/vhosts/00default.conf - - -EOF -else - cat <> ${PREFIX}/conf/vhosts/00default.conf -EOF -fi -cat <> ${PREFIX}/conf/vhosts/00default.conf ServerName dummy.${_DOMAIN}.$_TLD DocumentRoot "$GLOBAL_DOC_ROOT" @@ -3557,17 +3536,35 @@ cat <> ${PREFIX}/conf/vhosts/00default.conf EOF -if [[ -n "$IPv6_FIRST" ]] && $SEPARATE_LISTEN_DIRECTIVES ; then + +_default_ipv4=false +_default_ipv6=false + + +if [[ -n "${IPv4_FIRST}" ]]; then + _default_ipv4=true +fi +if [[ -n "${IPv6_FIRST}" ]]; then + _default_ipv6=true +fi + +_vhost_default_80="" +_vhost_default_443="" +if $_default_ipv4 && $_default_ipv6 ; then + _vhost_default_80="" + _vhost_default_443="" +elif $_default_ipv4 ; then + _vhost_default_80="" + _vhost_default_443="" +elif $_default_ipv6 ; then + _vhost_default_80="" + _vhost_default_443="" +fi + +if $_default_ipv4 || $_default_ipv6 ; then + cat <> ${PREFIX}/conf/vhosts/00default.conf - -## - -## - IPv6 -## - - - -# -- dummy.oopen.de -- # - - +$_vhost_default_80 ServerName dummy.${_DOMAIN}.$_TLD @@ -3583,7 +3580,7 @@ if [[ -n "$IPv6_FIRST" ]] && $SEPARATE_LISTEN_DIRECTIVES ; then ErrorLog /var/log/apache2/dummy.${_DOMAIN}.${_TLD}.error - +$_vhost_default_443 ServerName dummy.${_DOMAIN}.$_TLD @@ -3606,6 +3603,7 @@ if [[ -n "$IPv6_FIRST" ]] && $SEPARATE_LISTEN_DIRECTIVES ; then EOF fi + if [ -d "${PREFIX}/conf/vhosts/0" ] ; then echo "" >> ${PREFIX}/conf/vhosts/00default.conf echo "Include conf/vhosts/0/*.conf" >> ${PREFIX}/conf/vhosts/00default.conf