From 65c1902247c493de63c3fba4db3e6d4124fc2b75 Mon Sep 17 00:00:00 2001 From: Nimrod Zimerman Date: Tue, 8 Jun 2021 10:56:17 +0300 Subject: [PATCH] Fix Apache LISTEN_PORT "sed" command to look for whole "Listen" command (#64) Otherwise, if the replaced port number contains "80" (for example, "8080", as is now the default), it is replaced over and over on each activation --- 3.0/apache/entrypoint.sh | 2 +- 4.0/apache/entrypoint.sh | 2 +- 5.0/apache/entrypoint.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/3.0/apache/entrypoint.sh b/3.0/apache/entrypoint.sh index 9e32817..c4b88c0 100755 --- a/3.0/apache/entrypoint.sh +++ b/3.0/apache/entrypoint.sh @@ -37,7 +37,7 @@ fi if [ "$LISTEN_PORT" != "80" ]; then echo "Info: Customizing Apache Listen port to $LISTEN_PORT" - sed -i "s/80/$LISTEN_PORT/" /etc/apache2/ports.conf /etc/apache2/sites-available/000-default.conf + sed -i "s/Listen 80\$/Listen $LISTEN_PORT/" /etc/apache2/ports.conf /etc/apache2/sites-available/000-default.conf fi # Check if database is available diff --git a/4.0/apache/entrypoint.sh b/4.0/apache/entrypoint.sh index 1a90f29..1a65cff 100755 --- a/4.0/apache/entrypoint.sh +++ b/4.0/apache/entrypoint.sh @@ -41,7 +41,7 @@ fi if [ "$LISTEN_PORT" != "80" ]; then echo "Info: Customizing Apache Listen port to $LISTEN_PORT" - sed -i "s/80/$LISTEN_PORT/" /etc/apache2/ports.conf /etc/apache2/sites-available/000-default.conf + sed -i "s/Listen 80\$/Listen $LISTEN_PORT/" /etc/apache2/ports.conf /etc/apache2/sites-available/000-default.conf fi # Check if database is available diff --git a/5.0/apache/entrypoint.sh b/5.0/apache/entrypoint.sh index 5cecb90..c54b6bc 100755 --- a/5.0/apache/entrypoint.sh +++ b/5.0/apache/entrypoint.sh @@ -42,7 +42,7 @@ fi if [ "$LISTEN_PORT" != "80" ]; then echo "Info: Customizing Apache Listen port to $LISTEN_PORT" - sed -i "s/80/$LISTEN_PORT/" /etc/apache2/ports.conf /etc/apache2/sites-available/000-default.conf + sed -i "s/Listen 80\$/Listen $LISTEN_PORT/" /etc/apache2/ports.conf /etc/apache2/sites-available/000-default.conf fi # Check if database is available