Last active
October 23, 2020 10:06
-
-
Save zalexki/5cdfe4bf67db65f891028aea7467931b to your computer and use it in GitHub Desktop.
Revisions
-
zalexki revised this gist
Dec 28, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -41,7 +41,7 @@ DNS.2 = fr.sodebo.mydocker DNS.3 = en.sodebo.mydocker ``` This will generate a key.pem and cert.prem. Copy them in proper folder during container build (to add in Dockerfile): ``` -
zalexki revised this gist
Dec 26, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -43,7 +43,7 @@ DNS.3 = en.sodebo.mydocker This will generate a key.pem and server.cert.prem. Copy them in proper folder during container build (to add in Dockerfile): ``` COPY ssl/cert.pem /etc/ssl/certs/cert.pem COPY ssl/cert.key /etc/ssl/certs/cert.key -
zalexki revised this gist
Dec 26, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -16,7 +16,7 @@ Listen 443 https </VirtualHost> ``` Create files with openssl and following config file named req.cnf : `openssl req -x509 -nodes -days 99999 -newkey rsa:2048 -keyout cert.key -out cert.pem -config req.cnf -sha256` ``` -
zalexki renamed this gist
Dec 18, 2017 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
zalexki revised this gist
Dec 18, 2017 . 1 changed file with 8 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,8 @@ Open port 443 on container, with a docker-compose file just add : ``` ports: - 443:443 ``` Add virtualhost config : ``` @@ -44,4 +48,6 @@ Copy them in proper folder during container build: COPY ssl/cert.pem /etc/ssl/certs/cert.pem COPY ssl/cert.key /etc/ssl/certs/cert.key RUN echo '' > /etc/apache2/ports.conf ``` We delete default ports apache2 configuration, be sure to add `Listen 80` in virtualhost config if you still use non https version. -
zalexki revised this gist
Dec 18, 2017 . No changes.There are no files selected for viewing
-
zalexki revised this gist
Dec 18, 2017 . No changes.There are no files selected for viewing
-
zalexki created this gist
Dec 18, 2017 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,47 @@ Open port 443 on container. Add virtualhost config : ``` Listen 443 https <VirtualHost *:443> # Enable/Disable SSL for this virtual host. SSLEngine on SSLCertificateFile /etc/ssl/certs/cert.pem SSLCertificateKeyFile /etc/ssl/certs/cert.key </VirtualHost> ``` Create files with openssl and following config file named red.cnf : `openssl req -x509 -nodes -days 99999 -newkey rsa:2048 -keyout cert.key -out cert.pem -config req.cnf -sha256` ``` [req] distinguished_name = req_distinguished_name x509_extensions = v3_req prompt = no [req_distinguished_name] C = FR ST = IDF L = Clichy O = SensioGrey OU = PoleTech CN = sodebo.mydocker [v3_req] keyUsage = critical, digitalSignature, keyAgreement extendedKeyUsage = serverAuth subjectAltName = @alt_names [alt_names] DNS.1 = www.sodebo.mydocker DNS.2 = fr.sodebo.mydocker DNS.3 = en.sodebo.mydocker ``` This will generate a key.pem and server.cert.prem. Copy them in proper folder during container build: ``` COPY ssl/cert.pem /etc/ssl/certs/cert.pem COPY ssl/cert.key /etc/ssl/certs/cert.key RUN echo '' > /etc/apache2/ports.conf ```