Month: September 2019

Install SSL Certificate for DirectAdmin hostname

To install an SSL Certificate for your DirectAdmin hostname using Let’s Encrypt, you can execute the following commands:

cd /usr/local/directadmin/scripts
./letsencrypt.sh request_single your.hostname.nl 4096

Please do keep in mind to change your.hostname.nl to your own hostname. The above commands will also install the certificate for Dovecot, Exim, FTP etc.

We now need to tell DirectAdmin to force the hostname for SSL, as well as use the carootcert. You can do so by executing the following commands:

cd /usr/local/directadmin
./directadmin set SSL 1
./directadmin set carootcert /usr/local/directadmin/conf/carootcert.pem
./directadmin set force_hostname your.hostname.nl
./directadmin set ssl_redirect_host your.hostname.nl
service directadmin restart

How to solve DirectAdmin NGINX: 404 not found

If you encounter issues when upgrading DirectAdmin from Apache to NGINX (especially with WordPress), this might be because the rewrite rules are configured incorrectly.

To easily solve this, copy the nginx_server.conf and nginx_secure_server.conf to the /usr/local/directadmin/data/templates/custom/ folder and add the following code to the template:

try_files $uri $uri/ /index.php?q=$uri&$args;

This should be put under the |CUSTOM| tag. After you’ve added the above code in the files, run the following code to rewrite your current NGINX configuration:

cd /usr/local/directadmin/custombuild
./build rewrite_confs

Your WordPress site and all the pages should load correctly now.