44set -eu
55
66SERVER_ADMIN=" ${SERVER_ADMIN:- you@ example.com} "
7- HTTP_SERVER_NAME=" ${HTTP_SERVER_NAME:- www.example.com } "
8- HTTPS_SERVER_NAME=" ${HTTPS_SERVER_NAME:- www.example.com } "
7+ HTTP_SERVER_NAME=" ${HTTP_SERVER_NAME:- localhost } "
8+ HTTPS_SERVER_NAME=" ${HTTPS_SERVER_NAME:- localhost } "
99LOG_LEVEL=" ${LOG_LEVEL:- info} "
1010TZ=" ${TZ:- UTC} "
1111PHP_MEMORY_LIMIT=" ${PHP_MEMORY_LIMIT:- 256M} "
@@ -15,7 +15,7 @@ echo 'Updating configurations'
1515
1616# Change Server Admin, Name, Document Root
1717sed -i " s/ServerAdmin\ you@example.com/ServerAdmin\ ${SERVER_ADMIN} /" /etc/apache2/httpd.conf
18- sed -i " s/#ServerName\ www.example.com :80/ServerName\ ${HTTP_SERVER_NAME} /" /etc/apache2/httpd.conf
18+ sed -i " s/#ServerName\ localhost :80/ServerName\ ${HTTP_SERVER_NAME} /" /etc/apache2/httpd.conf
1919sed -i ' s#^DocumentRoot ".*#DocumentRoot "/htdocs"#g' /etc/apache2/httpd.conf
2020sed -i ' s#Directory "/var/www/localhost/htdocs"#Directory "/htdocs"#g' /etc/apache2/httpd.conf
2121sed -i ' s#AllowOverride None#AllowOverride All#' /etc/apache2/httpd.conf
@@ -29,7 +29,7 @@ sed -i 's#^ErrorLog .*#ErrorLog "/dev/stderr"#g' /etc/apache2/conf.d/ssl.conf
2929sed -i ' s#^TransferLog .*#TransferLog "/dev/stdout"#g' /etc/apache2/conf.d/ssl.conf
3030sed -i ' s#^DocumentRoot ".*#DocumentRoot "/htdocs"#g' /etc/apache2/conf.d/ssl.conf
3131sed -i " s/ServerAdmin\ you@example.com/ServerAdmin\ ${SERVER_ADMIN} /" /etc/apache2/conf.d/ssl.conf
32- sed -i " s/ServerName\ www.example.com :443/ServerName\ ${HTTPS_SERVER_NAME} /" /etc/apache2/conf.d/ssl.conf
32+ sed -i " s/ServerName\ localhost :443/ServerName\ ${HTTPS_SERVER_NAME} /" /etc/apache2/conf.d/ssl.conf
3333
3434# Re-define LogLevel
3535sed -i " s#^LogLevel .*#LogLevel ${LOG_LEVEL} #g" /etc/apache2/httpd.conf
0 commit comments