diff --git a/install_httpd-2.4.sh b/install_httpd-2.4.sh index fdbc809..27eaa7f 100755 --- a/install_httpd-2.4.sh +++ b/install_httpd-2.4.sh @@ -141,7 +141,11 @@ if [ -x "$_httpd_binary" ];then web_user="`$_httpd_binary -t -D DUMP_RUN_CFG | grep -i -e "^User" | awk '{print$2}' | cut -d\"=\" -f2 | tr -d '"'`" web_group="`$_httpd_binary -t -D DUMP_RUN_CFG | grep -i -e "^Group" | awk '{print$2}' | cut -d\"=\" -f2 | tr -d '"'`" if [ -z "$web_user" -o -z "$web_group" ]; then - _HTTPD_USER=www-data + if [[ -f "/usr/local/apache2/conf/httpd.conf" ]] ; then + _HTTPD_USER="$(grep -E "^\s*User\s" "/usr/local/apache2/conf/httpd.conf" | awk '{print$2}')" + _HTTPD_GROUP="$(grep -E "^\s*Group\s" "/usr/local/apache2/conf/httpd.conf" | awk '{print$2}')" + fi + [[ -z "$_HTTPD_USER" ]] && _HTTPD_USER=www-data else _HTTPD_USER=$web_user _HTTPD_GROUP=$web_group