Virtualmin servers not working after adding LetsEncrypt certificate


Server Information:

OS: Ubuntu 14.04
Web Server: Apache 2.4.7
Webmin: 1.900
Virtualmin: 6.04

What I have tried/done so far:

Initial attempt: Used certbot instead of the Virtualmin feature to add LetsEncrypt certificate. More info here:

Second Attempt: Manually remove /etc/letsencrypt folder and deleting all -le-ssl.conf files then retrying certbot. More info here:

Third Attempt: Following the guide here: How to Use Let’s Encrypt SSL Certificate Automatically in Virtualmin / Webmin, I have managed to overwrite the certbot certificate that I initally tried adding with the Virtualmin generated certificate and also successfully redirected my site from http to https automatically. But now the error has changed from 403 to Internal Server Error 500 for this particular site. The other non-sll sites all redirects to the above site instead. Please help me.


What is the site name/URL?
Can you show the vhost config for that site?


I end up deleting the SSL site just to see if it works but it didn’t. Now I only have two virtual servers with a WordPress site on each and one virtual server which has a static site loaded from an index.html file. One of the wordpress sites return an Internal Server error and the other just load the files of the static site from the other virtual server instead.

Internal server error site
Site that loads html file from the static files server instead
Site with static html


I also see what you see…
Can you show the configuration file for the wyrta site?


The conf file for has the following:

SuexecUserGroup "#1007" "#1006"
DocumentRoot /home/wyrta/public_html
ErrorLog /var/log/virtualmin/wyrta.com_error_log
CustomLog /var/log/virtualmin/wyrta.com_access_log combined
ScriptAlias /cgi-bin/ /home/wyrta/cgi-bin/
ScriptAlias /awstats/ /home/wyrta/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/wyrta/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
AddType application/x-httpd-php .php
AddHandler fcgid-script .php
AddHandler fcgid-script .php5
FCGIWrapper /home/wyrta/fcgi-bin/php5.fcgi .php
FCGIWrapper /home/wyrta/fcgi-bin/php5.fcgi .php5
<Directory /home/wyrta/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
RewriteEngine off
RewriteCond %{HTTP_HOST}
RewriteRule ^(.*) [R]
RewriteCond %{HTTP_HOST}
RewriteRule ^(.*) [R]
RemoveHandler .php
RemoveHandler .php5
php_admin_value engine Off
IPCCommTimeout 31
FcgidMaxRequestLen 1073741824
AuthName " statistics"
AuthType Basic
AuthUserFile /home/wyrta/.awstats-htpasswd
require valid-user


Perhaps adding something like this may fix it:


@rg305 I have added that to the vhost conf but the problem persists. What could be the problem?


I don’t completely understand your config file, so I can’t say with any certainty.
But it seems to mishandle the challenge requests.

You could try temporarily disabling the handlers…


@rg305 How do I do that? And if possible, can you guide me on completely removing the certificate(s) so I could re-initiate the installation using the virtualmin LetsEncrypt feature. I think the certbot approach is conflicting with virtualmin or something.


That makes sense.

Please show:
ls -l /etc/apahce2/sites-enabled/

lrwxrwxrwx 1 root root 35 Aug 23  2015 000-default.conf -> ../sites-available/000-default.conf
lrwxrwxrwx 1 root root 42 Aug 23  2015 -> /etc/apache2/sites-available/
lrwxrwxrwx 1 root root 43 Dec  2  2015 -> /etc/apache2/sites-available/
lrwxrwxrwx 1 root root 47 Feb  3 17:30 -> /etc/apache2/sites-available/
lrwxrwxrwx 1 root root 52 Aug 29  2015 -> /etc/apache2/sites-available/
lrwxrwxrwx 1 root root 43 Sep  1  2015 -> /etc/apache2/sites-available/

I have manually deleted all -le-ssl files as well as the /etc/letsencrypt folder earlier hoping it’ll fix this but it didn’t.


At this point there doesn’t seem to be any certs in use (all files are gone).
After restarting the web server, try the virtualmin approach.


I did that. Now one of the virtual server returns an Internal Server Error and the other returns

(sitename) redirected you too many times


OK. You need to comment out the redirects.
[they have nowhere to go to (yet)]

closed #15

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.