#!/bin/sh # Change apache config #sed -i "s/#ServerName www.example.com:80/ServerName $APACHE_SERVER_NAME/" /etc/apache2/httpd.conf sed -i "s/ServerAdmin\ you@example.com/ServerAdmin\ $ADMIN_MAIL/" /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 sed -i "s/#APACHE_SERVER_NAME/$APACHE_SERVER_NAME/" /etc/apache2/conf.d/davical.conf echo -e "$APACHE_USERS" > /etc/apache2/davical.htpasswd # Modify php.ini settings sed -i 's/memory_limit = .*/memory_limit = 256M/' /etc/php7/php.ini sed -i "s/^;date.timezone =$/date.timezone = \"Europe\/Oslo\"/" /etc/php7/php.ini # Modify davicals config.php sed -i "s/#APACHE_SERVER_NAME/$APACHE_SERVER_NAME/" /var/www/app/config/config.php sed -i "s/#ADMIN_MAIL/$ADMIN_MAIL/" /var/www/app/config/config.php sed -i "s/#SYSTEM_NAME/$SYSTEM_NAME/" /var/www/app/config/config.php sed -i "s/#DATABASE_NAME/$DATABASE_NAME/" /var/www/app/config/config.php sed -i "s/#DATABASE_USER/$DATABASE_USER/" /var/www/app/config/config.php sed -i "s/#DATABASE_PORT/$DATABASE_PORT/" /var/www/app/config/config.php sed -i "s/#DATABASE_HOST/$DATABASE_HOST/" /var/www/app/config/config.php sed -i "s/#DATABASE_PASSWORD/$DATABASE_PASSWORD/" /var/www/app/config/config.php # 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