Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| obtain_let_s_encrypt_trusted_tls_certificate [28 May 2025 / 07:05:21] – created 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 11: | Line 11: | ||
| certbot --version | certbot --version | ||
| - | | + | ==== Standalone Plugin ==== |
| + | |||
| + | | ||
| + | |||
| + | sudo certbot certonly --standalone --preferred-challenges http --agree-tos --key-type rsa --email you@yourdomain.com -d vpn.yourdomain.com | ||
| + | |||
| + | ==== Using webroot Plugin ==== | ||
| + | |||
| + | * If Ubuntu 22.04/ | ||
| + | * First, create a virtual host for vpn.example.com, | ||
| + | |||
| + | sudo nano / | ||
| + | sudo ln -s / | ||
| + | |||
| + | * And paste the following lines into the file: | ||
| + | |||
| + | < | ||
| + | ServerName vpn.example.com | ||
| + | DocumentRoot / | ||
| + | < | ||
| + | | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | * 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 / | ||
| + | |||
| + | |||
| + | ==== Install The Certificate on SoftEther VPN Server ==== | ||
| + | |||
| + | * Log into the VPN admin console as root: | ||
| + | |||
| + | sudo / | ||
| + | |||
| + | * Choose 1 to enter VPN Server Management, and run the following command to set TLS Certificate and private key: | ||
| + | |||
| + | ServerCertSet | ||
| + | |||
| + | * Enter the following path for the certificate. | ||
| + | |||
| + | / | ||
| + | |||
| + | * Enter the following path for the private key. | ||
| + | |||
| + | / | ||
| + | |||
| + | * Log out from the admin console. | ||
| + | |||
| + | exit | ||
| + | |||
| + | * Restart VPN server: | ||
| + | |||
| + | sudo systemctl restart softether-vpnserver | ||
| - | sudo certbot certonly --standalone --preferred-challenges http --agree-tos --key-type rsa --email you@example.com -d vpn.example.com | ||
