Last active
June 5, 2020 08:29
-
-
Save ruman/fd59100eb9fc546eb140f8779cf3526c to your computer and use it in GitHub Desktop.
SSL configuration for APACHE2 Docker:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get update && apt-get install openssl | |
openssl genrsa -out "/etc/ssl/certs/yourdevsite.local.key" 2048 && openssl req -new -key "/etc/ssl/certs/yourdevsite.local.key" -out "/etc/ssl/certs/yourdevsite.local.csr" -subj "/CN=yourdevsite.local/O=yourdevsite.local/C=UK" && openssl x509 -req -days 365 -in "/etc/ssl/certs/yourdevsite.local.csr" -signkey "/etc/ssl/certs/yourdevsite.local.key" -out "/etc/ssl/certs/yourdevsite.local.crt" | |
in defualt.apache.conf: | |
<VirtualHost *:80> | |
ServerName yourdevsite.local | |
DocumentRoot /var/www/yourdevsite/public/ | |
<Directory "/var/www/yourdevsite/public/"> | |
AllowOverride All | |
<IfVersion < 2.4> | |
Allow from all | |
</IfVersion> | |
<IfVersion >= 2.4> | |
Require all granted | |
</IfVersion> | |
</Directory> | |
</VirtualHost> | |
<VirtualHost *:443> | |
ServerName yourdevsite.local | |
DocumentRoot /var/www/yourdevsite/public/ | |
SSLEngine on | |
SSLCertificateFile /etc/ssl/certs/yourdevsite.local.crt | |
SSLCertificateKeyFile /etc/ssl/certs/yourdevsite.local.key | |
SSLCertificateChainFile /etc/ssl/certs/yourdevsite.local.csr | |
Options Indexes FollowSymLinks | |
<Directory "/var/www/yourdevsite/public/"> | |
AllowOverride All | |
<IfVersion < 2.4> | |
Allow from all | |
</IfVersion> | |
<IfVersion >= 2.4> | |
Require all granted | |
</IfVersion> | |
</Directory> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment