#!/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