<r>sudo apt update<br/>
sudo apt install certbot python3-certbot-apache -y<br/>
<br/>
nano /etc/apache2/sites-available/default-ssl.conf<br/>
 # line 2 : change admin email<br/>
ServerAdmin <EMAIL email="webmaster@srv.world">webmaster@srv.world</EMAIL><br/>
先按住ctrl鍵再按英文o鍵存檔<br/>
sudo a2ensite default-ssl <br/>
sudo a2enmod ssl <br/>
systemctl restart apache2 <br/>
<br/>
<br/>
處理http://自動轉https://<br/>
nano /etc/apache2/sites-available/virtual.host.conf
<CODE><s>[code]</s>&lt;VirtualHost *:80&gt;
    DocumentRoot /var/www/html
    ServerName zine-tw.com
    ServerAdmin youremail@mail.com
    ErrorLog /var/log/apache2/virtual.host.error.log
    CustomLog /var/log/apache2/virtual.host.access.log combined
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
&lt;/VirtualHost&gt;<e>[/code]</e></CODE> <br/>
sudo  a2enmod rewrite <br/>
systemctl restart apache2<br/>
<br/>
sudo certbot --apache<br/>
驗證systemd timer 自動續期<br/>
sudo certbot renew --dry-run</r>