Certbot with Apache: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
The environment for the following examples is: CentOS 7 and Apache | The environment for the following examples is: CentOS 7 and Apache | ||
Simple Example (Interactive): certbot --apache | Simple Command Example (Interactive): certbot --apache | ||
Simple Command Example (Automated): certbot certonly --webroot --webroot-path /var/www/html/WhatEverPath -d WhatEverWebSite | |||
Both of the above examples will do the following; | Both of the above examples will do the following; | ||
Line 17: | Line 17: | ||
<blockquote>Include /etc/httpd/conf/httpd-le-ssl.conf</blockquote><source lang="text"> | <blockquote>Include /etc/httpd/conf/httpd-le-ssl.conf</blockquote><source lang="text"> | ||
<IfModule mod_ssl.c> | <IfModule mod_ssl.c> | ||
<VirtualHost *:443> | <VirtualHost *:443> | ||
DocumentRoot /var/www/html/ | |||
ServerName | DocumentRoot /var/www/html/WhatEverWebSite | ||
CustomLog "logs/ | ServerName WhatEverWebSite | ||
<Directory "/var/www/html/ | CustomLog "logs/WhatEverWebSite/www.Access.LOG" combinedio | ||
AllowOverride ALL | |||
Require all granted | <Directory "/var/www/html/WhatEverWebSite"> | ||
AllowOverride ALL | |||
Require all granted | |||
</Directory> | </Directory> | ||
ServerAlias | |||
SSLCertificateFile /etc/letsencrypt/live/ | ServerAlias WhatEverWebSite | ||
SSLCertificateKeyFile /etc/letsencrypt/live/ | SSLCertificateFile /etc/letsencrypt/live/WhatEverWebSite/cert.pem | ||
SSLCertificateKeyFile /etc/letsencrypt/live/WhatEverWebSite/privkey.pem | |||
Include /etc/letsencrypt/options-ssl-apache.conf | Include /etc/letsencrypt/options-ssl-apache.conf | ||
SSLCertificateChainFile /etc/letsencrypt/live/ | SSLCertificateChainFile /etc/letsencrypt/live/WhatEverWebSite/chain.pem | ||
</VirtualHost> | </VirtualHost> | ||
</IfModule> | </IfModule> | ||
</source> | </source> |
Revision as of 21:19, 29 December 2019
The environment for the following examples is: CentOS 7 and Apache
Simple Command Example (Interactive): certbot --apache
Simple Command Example (Automated): certbot certonly --webroot --webroot-path /var/www/html/WhatEverPath -d WhatEverWebSite
Both of the above examples will do the following;
- Modifies the /etc/http/conf/httpd.conf file by adding several items with several "Rewrites" to the VirtualHost section for the web site;
RewriteEngine on</blockquote><blockquote>RewriteCond %{SERVER_NAME} =WhateEverWebSiteName [OR]</blockquote><blockquote>RewriteCond %{SERVER_NAME} =WhateEverWebSiteName
RewriteRule ^ <nowiki>https://%{SERVER_NAME}%{REQUEST_URI}</nowiki> [END,NE,R=permanent]
- an Include: Include /etc/httpd/conf/httpd-le-ssl.conf
Include /etc/httpd/conf/httpd-le-ssl.conf
<IfModule mod_ssl.c>
<VirtualHost *:443>
DocumentRoot /var/www/html/WhatEverWebSite
ServerName WhatEverWebSite
CustomLog "logs/WhatEverWebSite/www.Access.LOG" combinedio
<Directory "/var/www/html/WhatEverWebSite">
AllowOverride ALL
Require all granted
</Directory>
ServerAlias WhatEverWebSite
SSLCertificateFile /etc/letsencrypt/live/WhatEverWebSite/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/WhatEverWebSite/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateChainFile /etc/letsencrypt/live/WhatEverWebSite/chain.pem
</VirtualHost>
</IfModule>