Skip to content

Commit 031d27a

Browse files
authored
Fix issue port 80- range when using APACHE_PORT
Setting port to 8000-8099 caused issues after a restart. Ex: Port got set from 8090 to 809090 resulting in error AH00526. Using full line replace as ports.conf next character is new line.
1 parent 905cae8 commit 031d27a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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)