Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| obtain_let_s_encrypt_trusted_tls_certificate [23 June 2025 / 18:23:02] – [Let's Encrypt TLS Certificate] kadek | obtain_let_s_encrypt_trusted_tls_certificate [23 June 2025 / 19:29:39] (current) – [Using webroot Plugin] kadek | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ===== Let's Encrypt TLS Certificate ===== | ===== Let's Encrypt TLS Certificate ===== | ||
| - | SoftEtherVPN | + | softEtherVPN |
| * Run the following commands to install Let’s Encrypt client (certbot) from the default Ubuntu repository: | * Run the following commands to install Let’s Encrypt client (certbot) from the default Ubuntu repository: | ||
| Line 13: | Line 13: | ||
| ==== Standalone Plugin ==== | ==== Standalone Plugin ==== | ||
| - | * If there’s no Web Server running on your Ubuntu 24.04 server and SoftEther VPN server intended to use port 443, then we can use the standalone plugin to obtain TLS certificate from Let’s Encrypt: | + | * If there’s no Web Server running on your Ubuntu 24.04 server and |
| - | sudo certbot certonly --standalone --preferred-challenges http --agree-tos --key-type rsa --email you@yourdomain.com -d vpn.yourdomain.com | + | |
| + | sudo certbot certonly --standalone --preferred-challenges http --agree-tos --key-type rsa --email you@yourdomain.com -d vpn.yourdomain.com | ||
| ==== Using webroot Plugin ==== | ==== Using webroot Plugin ==== | ||
| * If Ubuntu 22.04/20.04 server has a Web Server listening on port 80 and 443, then use the webroot plugin to obtain a certificate because the webroot plugin works with pretty much every web server and we don’t need to install the certificate in the web server. | * If Ubuntu 22.04/20.04 server has a Web Server listening on port 80 and 443, then use the webroot plugin to obtain a certificate because the webroot plugin works with pretty much every web server and we don’t need to install the certificate in the web server. | ||
| - | * First, create a virtual host for vpn.example.com, | + | * First, create a virtual host for vpn.example.com, |
| sudo nano / | sudo nano / | ||
| + | sudo ln -s / | ||
| * And paste the following lines into the file: | * And paste the following lines into the file: | ||
| < | < | ||
| - | | + | |
| - | + | DocumentRoot /var/www/vpn.example.com | |
| - | | + | < |
| + | | ||
| + | | ||
| + | | ||
| + | </Directory> | ||
| </ | </ | ||
| + | * Save and close the file. Then create the web root directory: | ||
| + | |||
| + | sudo mkdir / | ||
| + | |||
| + | * Set www-data (Apache user) as the owner of the web root: | ||
| + | |||
| + | sudo chown -R www-data: | ||
| + | |||
| + | * Enable this virtual host: | ||
| + | |||
| + | sudo a2ensite vpn.example.com | ||
| + | |||
| + | * Reload Apache for the changes to take effect: | ||
| + | |||
| + | sudo systemctl reload apache2 | ||
| + | |||
| + | * Once virtual host is created and enabled, run the following command to obtain Let’s Encrypt certificate using webroot plugin: | ||
| + | sudo certbot certonly --webroot --agree-tos --key-type rsa --email you@exmaple.com -d vpn.example.com -w / | ||
