Added configuration for ssl with apache2 based on the nginx container

This commit is contained in:
Marcelo Garbin
2021-03-16 10:05:46 -03:00
parent d6b7d95f34
commit fb110a9d91
7 changed files with 68 additions and 18 deletions

21
apache2/startup.sh Normal file
View File

@ -0,0 +1,21 @@
#!/bin/bash
mkdir /etc/apache2/ssl 2> /dev/null
# Change laradock.test to the URL to be used
if [ ${APACHE_HTTP2} = true ]; then
if [ ! -f /etc/apache2/ssl/ssl_site.crt ]; then
openssl genrsa -out "/etc/apache2/ssl/ssl_site.key" 2048
openssl rand -out /root/.rnd -hex 256
openssl req -new -key "/etc/apache2/ssl/ssl_site.key" -out "/etc/apache2/ssl/ssl_site.csr" -subj "/CN=laradock.test/O=Laradock/C=BR"
openssl x509 -req -days 365 -extfile <(printf "subjectAltName=DNS:laradock.test,DNS:*.laradock.test") -in "/etc/apache2/ssl/ssl_site.csr" -signkey "/etc/apache2/ssl/ssl_site.key" -out "/etc/apache2/ssl/ssl_site.crt"
fi
a2enmod rewrite
a2enmod headers
a2enmod proxy proxy_html proxy_http xml2enc ssl http2
service apache2 restart
fi
# Start supervisord in foreground
supervisord