Let's Encrypt for DirectAdmin
Let's Encrypt is a free, automated, and open certificate authority (CA) provided by the Internet Security Research Group (ISRG), offering SSL/TLS certificates to secure websites. This tutorial guides you through securing your DirectAdmin websites using Let's Encrypt, based on the "DirectAdmin 1.5 with CentOS 6" template for self-managed virtual private servers.
Preliminary Requirements:
- A server with the "DirectAdmin 1.5 with CentOS 6" template installed.
1. Update DirectAdmin Control Panel:
First, update your DirectAdmin control panel:
cd /usr/local/directadmin
wget --no-check-certificate -O update.tar.gz 'https://www.directadmin.com/cgi-bin/daupdate?redirect=ok&uid=XXXX&lid=YYYYY'
Replace XXXX
with your Client ID and YYYYY
with your License ID, found under "Admin Level" > "Licensing / Updates" in DirectAdmin.
tar xvzf update.tar.gz
./directadmin p
cd scripts
./update.sh
service directadmin restart
2. Enable Let's Encrypt:
Enable Let's Encrypt in DirectAdmin by editing the configuration file:
echo 'letsencrypt=1' >> /usr/local/directadmin/conf/directadmin.conf
echo 'enable_ssl_sni=1' >> /usr/local/directadmin/conf/directadmin.conf
Then, update the configuration:
cd /usr/local/directadmin/custombuild/
./build rewrite_confs
3. Install Let's Encrypt Certificate:
Log in to your DirectAdmin control panel at the user level, select a domain, and follow these steps:
Navigate to "SSL Certificates."
Select "Free & automatic certificate from Let's Encrypt" and fill in the required fields.
Click "Save."
To enable SSL on your website:
- Go back to the menu and select "Domain Setup."
- Select the domain for which you installed the certificate.
- Check the "Secure SSL" box and click "Save."
- If you want the HTTPS protocol to show content from the "public_html" folder, check "Use a symbolic link from private_html to public_html - allows for same data in http and https" and click "Save."
Your website should now be secured with an SSL certificate from Let's Encrypt.