- At apache service file 'apache2.service' set private temp directory to false (PrivateTmp=false).
- Support all running PFP FPM engines in vhost configuration '00default.conf'.
This commit is contained in:
parent
600a1828af
commit
79404a83ad
@ -61,7 +61,13 @@ shopt -u extglob
|
|||||||
|
|
||||||
## - Is PHP-FPM socket in use
|
## - Is PHP-FPM socket in use
|
||||||
## -
|
## -
|
||||||
_PHP_FPM_SOCKET="$(ls /tmp/php*.sock 2> /dev/null | head -1)"
|
|
||||||
|
declare -a _php_socket_arr=()
|
||||||
|
while IFS='' read -r -d '' _socket ; do
|
||||||
|
echo "socket: $_socket"
|
||||||
|
_php_major_version="$(echo "$_socket" | cut -d '-' -f2)"
|
||||||
|
_php_socket_arr+=("${_php_major_version}:$_socket")
|
||||||
|
done < <(find "/tmp" -type s -name "php*" -print0 | sort -z)
|
||||||
|
|
||||||
## - substitude path "/usr/local/httpd-$APACHE_VERSION" to "/usr/local/apache2"
|
## - substitude path "/usr/local/httpd-$APACHE_VERSION" to "/usr/local/apache2"
|
||||||
## - in apache configuration files ?
|
## - in apache configuration files ?
|
||||||
@ -107,7 +113,7 @@ fi
|
|||||||
|
|
||||||
## - Determin httpd binary
|
## - Determin httpd binary
|
||||||
## -
|
## -
|
||||||
_httpd_binary="`which httpd`"
|
_httpd_binary="$(which httpd)"
|
||||||
if [ -z "$_httpd_binary" ]; then
|
if [ -z "$_httpd_binary" ]; then
|
||||||
_httpd_binary="$(ps -axu | grep httpd | grep -e "^root" | grep -v grep | awk '{print$11}')"
|
_httpd_binary="$(ps -axu | grep httpd | grep -e "^root" | grep -v grep | awk '{print$11}')"
|
||||||
if [ -z "$_httpd_binary" ]; then
|
if [ -z "$_httpd_binary" ]; then
|
||||||
@ -279,13 +285,6 @@ done
|
|||||||
GLOBAL_DOC_ROOT="${BASE_WEBSPACE_DIR}/default"
|
GLOBAL_DOC_ROOT="${BASE_WEBSPACE_DIR}/default"
|
||||||
SUEXEC_DOC_ROOT=$BASE_WEBSPACE_DIR
|
SUEXEC_DOC_ROOT=$BASE_WEBSPACE_DIR
|
||||||
|
|
||||||
if [[ -n "$_PHP_FPM_SOCKET" ]]; then
|
|
||||||
PHP_FPM_SOCKET_PRESENT=true
|
|
||||||
PHP_MAJOR_VERSION=`echo $_PHP_FPM_SOCKET | cut -d '-' -f2`
|
|
||||||
else
|
|
||||||
PHP_FPM_SOCKET_PRESENT=false
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo ""
|
echo ""
|
||||||
@ -740,6 +739,11 @@ clear
|
|||||||
echo ""
|
echo ""
|
||||||
echo -e "\033[21G\033[32mStart Apache Webserver Installation with the following Parameters \033[m"
|
echo -e "\033[21G\033[32mStart Apache Webserver Installation with the following Parameters \033[m"
|
||||||
echo ""
|
echo ""
|
||||||
|
if [[ -n "$_httpd_current_version" ]]; then
|
||||||
|
echo ""
|
||||||
|
echo -e "--- Update form apache version \033[33m$_httpd_current_version\033[m ---"
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
echo "httpd version.................: $APACHE_VERSION"
|
echo "httpd version.................: $APACHE_VERSION"
|
||||||
echo " apr version................: $APR_VERSION"
|
echo " apr version................: $APR_VERSION"
|
||||||
echo " apr-uril version...........: $APR_UTIL_VERSION"
|
echo " apr-uril version...........: $APR_UTIL_VERSION"
|
||||||
@ -789,6 +793,15 @@ if $WITH_MOD_PERL ; then
|
|||||||
echo " mod_perl version...........: $MOD_PERL_VERSION"
|
echo " mod_perl version...........: $MOD_PERL_VERSION"
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
|
if [[ ${#_php_socket_arr[@]} -gt 0 ]] ; then
|
||||||
|
echo -n "PHP FPM versions found........:"
|
||||||
|
for _val in ${_php_socket_arr[@]} ; do
|
||||||
|
IFS=':' read -a _val_arr <<< "${_val}"
|
||||||
|
echo -n " ${_val_arr[0]}"
|
||||||
|
done
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
echo ""
|
||||||
|
|
||||||
echononl "start with that configuration? [yes/no]: "
|
echononl "start with that configuration? [yes/no]: "
|
||||||
read OK
|
read OK
|
||||||
@ -826,6 +839,11 @@ touch ${_logdir}/main.log
|
|||||||
echo "## -----------" >> ${_logdir}/main.log
|
echo "## -----------" >> ${_logdir}/main.log
|
||||||
echo "## - Start Apache Webserver installation with the following Parameters" >> ${_logdir}/main.log
|
echo "## - Start Apache Webserver installation with the following Parameters" >> ${_logdir}/main.log
|
||||||
echo "## -----------" >> ${_logdir}/main.log
|
echo "## -----------" >> ${_logdir}/main.log
|
||||||
|
if [[ -n "$_httpd_current_version" ]]; then
|
||||||
|
echo "## -" >> ${_logdir}/main.log
|
||||||
|
echo "## --- Update form apache version $_httpd_current_version ---" >> ${_logdir}/main.log
|
||||||
|
echo "## -" >> ${_logdir}/main.log
|
||||||
|
fi
|
||||||
echo "## -" >> ${_logdir}/main.log
|
echo "## -" >> ${_logdir}/main.log
|
||||||
echo "## - httpd version.................: $APACHE_VERSION" >> ${_logdir}/main.log
|
echo "## - httpd version.................: $APACHE_VERSION" >> ${_logdir}/main.log
|
||||||
echo "## - apr version................: $APR_VERSION" >> ${_logdir}/main.log
|
echo "## - apr version................: $APR_VERSION" >> ${_logdir}/main.log
|
||||||
@ -874,6 +892,15 @@ if $WITH_MOD_PERL ; then
|
|||||||
echo "## - mod_perl version...........: $MOD_PERL_VERSION" >> ${_logdir}/main.log
|
echo "## - mod_perl version...........: $MOD_PERL_VERSION" >> ${_logdir}/main.log
|
||||||
fi
|
fi
|
||||||
echo "## -" >> ${_logdir}/main.log
|
echo "## -" >> ${_logdir}/main.log
|
||||||
|
if [[ ${#_php_socket_arr[@]} -gt 0 ]] ; then
|
||||||
|
echo -n "PHP FPM versions found........:" >> ${_logdir}/main.log
|
||||||
|
for _val in ${_php_socket_arr[@]} ; do
|
||||||
|
IFS=':' read -a _val_arr <<< "${_val}"
|
||||||
|
echo -n " ${_val_arr[0]}" >> ${_logdir}/main.log
|
||||||
|
done
|
||||||
|
echo "## -" >> ${_logdir}/main.log
|
||||||
|
fi
|
||||||
|
echo "## -" >> ${_logdir}/main.log
|
||||||
echo "## - log directory installation....: $_logdir" >> ${_logdir}/main.log
|
echo "## - log directory installation....: $_logdir" >> ${_logdir}/main.log
|
||||||
echo "## -" >> ${_logdir}/main.log
|
echo "## -" >> ${_logdir}/main.log
|
||||||
echo "" >> ${_logdir}/main.log
|
echo "" >> ${_logdir}/main.log
|
||||||
@ -1605,29 +1632,35 @@ if $START_AT_BOOTTIME && $APACHE_WEBSERVICE_RUNNING ; then
|
|||||||
error "Stopping Apache Webservice failed!"
|
error "Stopping Apache Webservice failed!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sleep 5
|
|
||||||
|
|
||||||
declare -i i=0
|
# # - Does NOT wor - don't know why
|
||||||
PIDS="$(ps aux | grep "$(realpath "$_httpd_binary")" | grep -v grep | awk '{print$2}')"
|
# # -
|
||||||
|
# declare -i i=0
|
||||||
while [[ "X$PIDS" != "X" ]]; do
|
# if [[ -n "$_httpd_binary" ]] ; then
|
||||||
|
#
|
||||||
if [[ $i -eq 0 ]]; then
|
# sleep 5
|
||||||
warn "Stopping Apache Webservice failed. Going to kill remaining httpd-processes.."
|
#
|
||||||
fi
|
# PIDS="$(ps aux | grep "$(realpath "$_httpd_binary")" | grep -v grep | awk '{print$2}')"
|
||||||
|
#
|
||||||
if [[ $i -gt 10 ]]; then
|
# while [[ "X$PIDS" != "X" ]]; do
|
||||||
error "Killing remaining httpd-processes failed !"
|
#
|
||||||
break
|
# if [[ $i -eq 0 ]]; then
|
||||||
fi
|
# warn "Stopping Apache Webservice failed. Going to kill remaining httpd-processes.."
|
||||||
|
# fi
|
||||||
for _PID in $PIDS ; do
|
#
|
||||||
kill -9 $_PID > /dev/null 2>&1
|
# if [[ $i -gt 10 ]]; then
|
||||||
done
|
# error "Killing remaining httpd-processes failed !"
|
||||||
sleep 2
|
# break
|
||||||
PIDS="$(ps aux | grep "$(realpath "$_httpd_binary")" | grep -v grep | awk '{print$2}')"
|
# fi
|
||||||
i=i+1
|
#
|
||||||
done
|
# 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
|
||||||
|
|
||||||
else
|
else
|
||||||
echo_skipped
|
echo_skipped
|
||||||
@ -3230,7 +3263,7 @@ Environment=APACHE_STARTED_BY_SYSTEMD=true
|
|||||||
ExecStart=${PREFIX}/bin/apachectl start
|
ExecStart=${PREFIX}/bin/apachectl start
|
||||||
ExecStop=${PREFIX}/bin/apachectl stop
|
ExecStop=${PREFIX}/bin/apachectl stop
|
||||||
ExecReload=${PREFIX}/bin/apachectl graceful
|
ExecReload=${PREFIX}/bin/apachectl graceful
|
||||||
PrivateTmp=true
|
PrivateTmp=false
|
||||||
Restart=on-abort
|
Restart=on-abort
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
@ -3249,7 +3282,7 @@ Environment=APACHE_STARTED_BY_SYSTEMD=true
|
|||||||
ExecStart=${PREFIX}/bin/apachectl start
|
ExecStart=${PREFIX}/bin/apachectl start
|
||||||
ExecStop=${PREFIX}/bin/apachectl stop
|
ExecStop=${PREFIX}/bin/apachectl stop
|
||||||
ExecReload=${PREFIX}/bin/apachectl graceful
|
ExecReload=${PREFIX}/bin/apachectl graceful
|
||||||
PrivateTmp=true
|
PrivateTmp=false
|
||||||
Restart=on-abort
|
Restart=on-abort
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
@ -3427,15 +3460,21 @@ DirectoryIndex index.html index.htm index.php index.php5
|
|||||||
DocumentRoot "$GLOBAL_DOC_ROOT"
|
DocumentRoot "$GLOBAL_DOC_ROOT"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
if $PHP_FPM_SOCKET_PRESENT ; then
|
if [[ ${#_php_socket_arr[@]} -gt 0 ]] ; then
|
||||||
cat <<EOF >> ${PREFIX}/conf/vhosts/00default.conf
|
cat <<EOF >> ${PREFIX}/conf/vhosts/00default.conf
|
||||||
|
|
||||||
## - Make PHP-FPM status page and PHP-FPM ping available
|
## - Make PHP-FPM status page and PHP-FPM ping available
|
||||||
## -
|
## -
|
||||||
<FilesMatch "^(status-${PHP_MAJOR_VERSION}|ping-${PHP_MAJOR_VERSION})$">
|
EOF
|
||||||
SetHandler "proxy:unix:${_PHP_FPM_SOCKET}|fcgi://127.0.0.1"
|
for _val in ${_php_socket_arr[@]} ; do
|
||||||
|
IFS=':' read -a _val_arr <<< "${_val}"
|
||||||
|
cat <<EOF >> ${PREFIX}/conf/vhosts/00default.conf
|
||||||
|
<FilesMatch "^(status-${_val_arr[0]}|ping-${_val_arr[0]})">
|
||||||
|
SetHandler "proxy:unix:${_val_arr[1]}|fcgi://127.0.0.1"
|
||||||
</FilesMatch>
|
</FilesMatch>
|
||||||
EOF
|
EOF
|
||||||
|
done
|
||||||
|
|
||||||
else
|
else
|
||||||
cat <<EOF >> ${PREFIX}/conf/vhosts/00default.conf
|
cat <<EOF >> ${PREFIX}/conf/vhosts/00default.conf
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user