Add APACHE_PORT

This commit is contained in:
mahdi.abbasi 2022-09-07 15:12:34 +04:30
parent 457aa21336
commit 3bc3566efe
1 changed files with 9 additions and 0 deletions

View File

@ -132,4 +132,13 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
echo >&2 "========================================================================"
fi
if [[ "$1" == apache2* ]]; then
if [ -n "${APACHE_PORT+x}" ]; then
echo "Setting apache port to ${APACHE_PORT}."
sed -i "s/VirtualHost \*:80/VirtualHost \*:${APACHE_PORT}/g" /etc/apache2/sites-enabled/000-default.conf
sed -i "s/Listen 80/Listen ${APACHE_PORT}/g" /etc/apache2/ports.conf
apachectl configtest
fi
fi
exec "$@"