Can't get letsencrypt working on server hostname

anay

Verified User
Joined
Dec 7, 2005
Messages
120
Hello,
I got a fresh install of DA, have been trying to set server to use Letsencrypt SSL for DA login ie. at myserver.hostname.com:2222
I went to this guide:
which took me to :
I made sure that Letsencrypt is enabled then I ran :
Code:
./letsencrypt.sh request_single myserver.hostname.com 4096

I received following error :
Code:
Domain does not exist on the system. Unable to find myserver.hostname.com in /etc/virtual/domainowners. Exiting...
no valid domain found - exiting

As per guide , it says that myserver.hostname.com must match the "servername" value set in the directadmin.conf, or it will not be in hostname mode, but User domain mode instead.

I can see that in directadmin.conf it is exactly as : myserver.hostname.com

Should I create a an accoutn with myserver.hostname.com as domain ?

What I am missing ?
 
Normally when installing directadmin, a dns record for your hostname is created automatically.
You can either do that yourself if not existing or just setup the hostname domain and include the hostname in the dns record.

You don't need to create a seperate account for that, you can add that domain to userlevel as admin too.

Or as stated, you can just create a dns entry as admin for the hostname.
Your hostname should exist in /etc/virtual/ like /etc/virtual/myserver.hostname.com then things will work.
 
Thanks for the advice, I checked my /etc/virtual/ and I don't see anything for myserver.hostname.com there.
I then added DNS zone for myserver.hostname.com manually under DNS Administration--> Create Zone but still I can't install LE cert and also I still don't see anything still under /etc/virtual although DNS zone exists for it .

EDIT:
Further, as you advised, added myserver.hostname.com as domain at USER level in Admin, now I can see entry for this subdomain ie. myserver.hostname.com in /etc/virtual but still receiving same error.
 
Last edited:
Further, as you advised, added myserver.hostname.com as domain at USER level
I meant the domain at userlevel and then make an entry for your hostname so like:
domain.com A 192.168.0.1
server A 192.168.0.1

This way you can also easily maintain nameservers in there too.
However I guess it should also work like you did.

now I can see entry for this subdomain ie. myserver.hostname.com in /etc/virtual but still receiving same error.
It's really in /etc/virtual and not in /etc/virtual/domainowners correct? Because it should not be in the domainowners directory.
It should look like:
Code:
drwxr-xr-x    2 mail      mail   4.0K 2020-03-18 02:46 server.yourdomain.com
If you have it this way, and still receiving the same error, you might have to ask @smtalk or @DirectAdmin Support what can be wrong or send in a ticket.
 
I've improved the error message in 1.1.41 and made it more fail-proof. You were missing your hostname in /etc/virtual/domains. Please try 1.1.41, it should auto-add it there.
 
Thanks for assistance so far.
Its indeed in /etc/virtual .

However, after DA install, I had to change hostname of the server. I had changed it Server-Manager--> Admin Tools --> Server settings --> Server's Hostname .

Also changed nameservers there, but when I created a new account, it was still showing old nameserver if I check DNS zone for that domain. I also looked every possible place as per my knowledge and guides available for DA to see reference of old Hostname and old nameservers. But still on creating new account, I see previous nameserver being used.

Since it was fresh install, I went for clean reinstall, this time I used custom arguments for setup.sh and specified hostname, namesevers as per this guide : https://help.directadmin.com/item.php?id=578

After that I tried to install LE cert for server's Hostname and it worked.

My guess is that after changing hostname, things didn't workout .

I suppose adding Hostname under "Server's Hostname" setting should also update /etc/virtual/domains file. I had not checked what was it last time though.
 
Back
Top