From bb62ee191472adfff77e110d77fe6eafbf0a9b65 Mon Sep 17 00:00:00 2001 From: Dennis Eriksen Date: Thu, 7 Feb 2019 23:00:29 +0100 Subject: Initial commit --- files/usr/local/bin/entrypoint.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 files/usr/local/bin/entrypoint.sh (limited to 'files/usr/local/bin/entrypoint.sh') diff --git a/files/usr/local/bin/entrypoint.sh b/files/usr/local/bin/entrypoint.sh new file mode 100755 index 0000000..d1a1cc2 --- /dev/null +++ b/files/usr/local/bin/entrypoint.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +# Apache server name change +if [ ! -z "$APACHE_SERVER_NAME" ] + then + sed -i "s/#ServerName www.example.com:80/ServerName $APACHE_SERVER_NAME/" /etc/apache2/httpd.conf + echo "Changed server name to '$APACHE_SERVER_NAME'..." + else + echo "NOTICE: Change 'ServerName' globally and hide server message by setting environment variable >> 'APACHE_SERVER_NAME=your.server.name' in docker command or docker-compose file" +fi + +# Change apache config +sed -i 's/ServerAdmin\ you@example.com/ServerAdmin\ you@example.com/' /etc/apache2/httpd.conf +sed -i 's/ServerSignature On/ServerSignature Off/' /etc/apache2/httpd.conf +sed -i 's#/var/www/localhost/htdocs#/var/www/app/htdocs#g' /etc/apache2/httpd.conf + +# Modify php.ini settings +sed -i 's/memory_limit = .*/memory_limit = 256M/' /etc/php7/php.ini +sed -i "s/^;date.timezone =$/date.timezone = \"Europe\/Stockholm\"/" /etc/php7/php.ini + + +# display logs +tail -F /var/log/apache2/*log & + +echo "Clearing any old processes..." +rm -f /run/apache2/apache2.pid +rm -f /run/apache2/httpd.pid + +echo "Starting apache..." +httpd -D FOREGROUND -- cgit v1.2.3