diff options
author | Dennis Eriksen <dennis@terje.dnns.no> | 2019-02-07 23:00:29 +0100 |
---|---|---|
committer | Dennis Eriksen <dennis@terje.dnns.no> | 2019-02-07 23:00:29 +0100 |
commit | bb62ee191472adfff77e110d77fe6eafbf0a9b65 (patch) | |
tree | 53a07cd036a57c0e5d8c15ae8f53e63d3e48eec2 /files/usr/local/bin/entrypoint.sh | |
download | davical-docker-bb62ee191472adfff77e110d77fe6eafbf0a9b65.tar.gz |
Initial commit
Diffstat (limited to 'files/usr/local/bin/entrypoint.sh')
-rwxr-xr-x | files/usr/local/bin/entrypoint.sh | 30 |
1 files changed, 30 insertions, 0 deletions
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 |