diff --git a/create_vhost.sh b/create_vhost.sh index 577425f..e2a05fd 100755 --- a/create_vhost.sh +++ b/create_vhost.sh @@ -207,14 +207,25 @@ shopt -u extglob # - Determin httpd binary # - -_httpd_binary="`which httpd`" +## - Determin httpd binary +## - +_httpd_binary="$(ps -axu | grep httpd \ + | grep -e "^root" \ + | grep -v grep \ + | grep -v vim \ + | grep -v bash \ + | awk '{print$11}' | head -1)" + if [ -z "$_httpd_binary" ]; then - _httpd_binary="$(ps -axu | grep httpd | grep -e "^root" | grep -v grep | awk '{print$11}')" + + _httpd_binary="$(which httpd)" + if [ -z "$_httpd_binary" ]; then if [ -x "/usr/local/apache2/bin/httpd" ]; then _httpd_binary="/usr/local/apache2/bin/httpd" fi fi + fi # - Determin websever user/group