Skip to content

Commit 1effd43

Browse files
committed
Merge #381 - Fix issue port 80- range when using APACHE_PORT
Pull-request: #381
2 parents 908e79d + 031d27a commit 1effd43

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

apache/docker-entrypoint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ fi
3131
# start: Apache specific settings
3232
if [ -n "${APACHE_PORT+x}" ]; then
3333
echo "Setting apache port to ${APACHE_PORT}."
34-
sed -i "s/VirtualHost \*:80/VirtualHost \*:${APACHE_PORT}/" /etc/apache2/sites-enabled/000-default.conf
35-
sed -i "s/Listen 80/Listen ${APACHE_PORT}/" /etc/apache2/ports.conf
34+
sed -i "/VirtualHost \*:80/c\\<VirtualHost \*:${APACHE_PORT}\>" /etc/apache2/sites-enabled/000-default.conf
35+
sed -i "/Listen 80/c\Listen ${APACHE_PORT}" /etc/apache2/ports.conf
3636
apachectl configtest
3737
fi
3838
# end: Apache specific settings

docker-entrypoint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ fi
3131
# start: Apache specific settings
3232
if [ -n "${APACHE_PORT+x}" ]; then
3333
echo "Setting apache port to ${APACHE_PORT}."
34-
sed -i "s/VirtualHost \*:80/VirtualHost \*:${APACHE_PORT}/" /etc/apache2/sites-enabled/000-default.conf
35-
sed -i "s/Listen 80/Listen ${APACHE_PORT}/" /etc/apache2/ports.conf
34+
sed -i "/VirtualHost \*:80/c\\<VirtualHost \*:${APACHE_PORT}\>" /etc/apache2/sites-enabled/000-default.conf
35+
sed -i "/Listen 80/c\Listen ${APACHE_PORT}" /etc/apache2/ports.conf
3636
apachectl configtest
3737
fi
3838
# end: Apache specific settings

0 commit comments

Comments
 (0)