apache2_ssl_debian
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
apache2_ssl_debian [2012/08/01 04:22] – created memeruiz | apache2_ssl_debian [2021/02/01 05:55] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== apache2 + ssl + debian ====== | + | ====== apache2 + ssl + debian |
* Install apache2 | * Install apache2 | ||
Line 27: | Line 27: | ||
* Edit this files and only leave the certificate key in the .pem file and the private key in the .key file | * Edit this files and only leave the certificate key in the .pem file and the private key in the .key file | ||
+ | * Then edit / | ||
+ | |||
+ | SSLCertificateFile / | ||
+ | SSLCertificateKeyFile / | ||
+ | |||
+ | * Change permissions of the private key | ||
+ | |||
+ | sudo chmod 600 / | ||
+ | |||
+ | * Restart again | ||
+ | |||
+ | sudo / | ||
+ | |||
+ | * Disable http port. Edit / | ||
+ | |||
+ | # | ||
+ | #Listen 80 | ||
+ | |||
+ | * To have virtual hosts in ssl create a map file / | ||
+ | |||
+ | www.example.com | ||
+ | wiki.example.com | ||
+ | |||
+ | * To the file / | ||
+ | |||
+ | ### Mass SSL Vhosts ### | ||
+ | RewriteEngine on | ||
+ | | ||
+ | # | ||
+ | # the available virtual hosts with their corresponding | ||
+ | # | ||
+ | RewriteMap | ||
+ | RewriteMap | ||
+ | | ||
+ | # 1. make sure we don't map for common locations | ||
+ | RewriteCond | ||
+ | RewriteCond | ||
+ | | ||
+ | # 2. make sure we have a Host header | ||
+ | RewriteCond | ||
+ | | ||
+ | # 3. lowercase the hostname | ||
+ | RewriteCond | ||
+ | # | ||
+ | # 4. lookup this hostname in vhost.map and | ||
+ | # remember it only when it is a path | ||
+ | # (and not " | ||
+ | RewriteCond | ||
+ | | ||
+ | # 5. finally we can map the URL to its docroot location | ||
+ | # and remember the virtual host for logging puposes | ||
+ | RewriteRule | ||
+ | |||
+ | * We need the rewrite module: | ||
+ | |||
+ | sudo a2enmod rewrite | ||
+ | |||
+ | * Restart apache2 and voila! | ||
apache2_ssl_debian.1343794945.txt.gz · Last modified: 2021/02/01 05:55 (external edit)