let's entropy

筆記種類
https
redmaple-server@redmapleserver:~$ sudo apt install certbot python3-certbot-apache -y

redmaple-server@redmapleserver:~$ sudo certbot --apache
/usr/lib/python3/dist-packages/certbot/_internal/constants.py:4: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  import pkg_resources
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Enter email address (used for urgent renewal and security notices)
 (Enter 'c' to cancel): az062596216@gmail.com

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.5-February-24-2025.pdf. You must
agree in order to register with the ACME server. Do you agree?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: y

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing, once your first certificate is successfully issued, to
share your email address with the Electronic Frontier Foundation, a founding
partner of the Let's Encrypt project and the non-profit organization that
develops Certbot? We'd like to send you email about our work encrypting the web,
EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: y
Account registered.

Which names would you like to activate HTTPS for?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: redmaple.life
2: www.redmaple.life
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): 1
Requesting a certificate for redmaple.life

Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/redmaple.life/fullchain.pem
Key is saved at:         /etc/letsencrypt/live/redmaple.life/privkey.pem
This certificate expires on 2025-09-23.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.

Deploying certificate
Successfully deployed certificate for redmaple.life to /etc/apache2/sites-enabled/web.conf
Congratulations! You have successfully enabled HTTPS on https://redmaple.life

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you like Certbot, please consider supporting our work by:
 * Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
 * Donating to EFF:                    https://eff.org/donate-le

 

<VirtualHost *:80>
    ServerName xxx.xxx.xxx.xxx
    ServerAlias redmaple.life redmaple.website <--(這兩個網址可以一起申請)
    WSGIDaemonProcess flaskapp user=www-data group=www-data threads=4
    WSGIScriptAlias / /var/www/web/app.wsgi

    <Directory /var/www/web>
        WSGIProcessGroup flaskapp
        WSGIApplicationGroup %{GLOBAL}
        Options FollowSymLinks
        AllowOverride All
        Order deny,allow
        Allow from all
    </Directory>

	ErrorLog /var/www/web/logs/error.log
	CustomLog /var/www/web/logs/access.log combined

</VirtualHost>

<VirtualHost *:443>
    ServerName redmaple.website
    ServerAlias redmaple.life
    WSGIDaemonProcess flaskapp2 user=www-data group=www-data threads=4
    WSGIScriptAlias / /var/www/web/app.wsgi

    <Directory /var/www/web>
        WSGIProcessGroup flaskapp2
        WSGIApplicationGroup %{GLOBAL}
        Options FollowSymLinks
        AllowOverride All
        Order deny,allow
        Allow from all
    </Directory>

	ErrorLog /var/www/web/logs/error.log
	CustomLog /var/www/web/logs/access.log combined

</VirtualHost>