Update DirectAdmin License Update Error & Fix error

DirectAdmin users experience issues with updating the License renewal and are unable to connect to port 443 on directadmin.com.

Are you facing DirectAdmin License Update Error? We can help you.

Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform related DirectAdmin queries.

In this context, we shall look into the steps to update the license on the Directadmin and how to fix this error.

Causes of Update DirectAdmin License Update Error:

  • Invalid time on your server.
  • Mismatch in IP address.
  • Port 2222 is blocked.
  • License has expired or suspended due to non-payment.

Tips to resolve DirectAdmin License Update Error

Sometimes, in the process of updating the DirectAdmin license, we may come across the error:

Error determining IP via myip.directadmin.com

Here, you will learn about the errors and how to resolve them.

1. Update DirectAdmin license manually

In order to update the DirectAdmin license manually, we type:

/usr/local/directadmin/scripts/getLicense.sh auto
service directadmin restart

In addition, to specify the UID/LID values, we manually enter them.

Then we run the following commands:

$ cd /usr/local/directadmin/scripts
./getLicense.sh 1234 567890
service directadmin restart

Here, 1234 and 567890 are the Client ID and License ID, respectively.

Suppose there is no error while extracting the update.tar.gz file. Then we run head -n 1 /usr/local/directadmin/conf/license.key to search for an error.

In case there is a readable error in the file, we double-check the IP we use matches the IP in the license on the system. We also check it's active in our client's section.

Consider, we have multiple IPs on the device and wget is binding to the incorrect one. In such a case, we can specify the IP to bind to by adding it as the last argument:

$ cd /usr/local/directadmin/scripts
./getLicense.sh 1234 567890
service directadmin restart

To Fix this Error determining IP error,

Sometimes, we may be unable to connect to port 443 on directadmin.com (https), or won’t get any results (no returned data), it may be a block somewhere on 443.

In that case, we use port 80 to get the license.

To do so, we type:

$ echo 1 > /root/.insecure_download

Eventually, the scripts will automatically download over port 80, without encryption.

If we face an error during the restart, e.g.,

Stopping DirectAdmin: [ FAILED ]
Starting DirectAdmin: [ OK ]

This means the PID file may be out of sync. In this case, we restart DirectAdmin forcefully:

$ killall -9 directadmin
$ service irectadmin start

We retry the restart command, and ensure that both the "Stopping" and "Starting" sections are "[ OK ]".

2. Automate license updates

It is also possible that the DA itself cannot connect out to update your license, regular calls to getLicense.sh will be required.

We automate this by editing /etc/cron.d/directadmin_cron and add this line at the bottom of the file:

0 6 15 * * root /usr/local/directadmin/scripts/getLicense.sh 1234 567890; echo "action=directadmin&value=restart" >> /usr/local/directadmin/data/task.queue

Here, The day of the month that the license will update is the 15th.

We can pick a value of choice. However, it should usually be about 5 days before the update.

We restart the cron to ensure it loads in the new value:

$ service crond restart

On FreeBSD, the path to directadmin_cron will be /etc/crontab.

Finally, to restart crond, we run:

$ /etc/rc.d/cron restart

[Need help with fixing DirectAdmin issues ? We can help you. ]


This article covers methods to tackle License Update Error in DirectAdmin. 

Some DirectAdmin update errors that can occur:

1. DirectAdmin fails to start/stop during restart command. Run the following command to correct:

killall -9 directadmin; /etc/init.d/directadmin start Retry the restart command, to ensure that both the “Stopping” and “Starting” sections are “[ OK ]”.

2. It may be necessary to specify the primary IP with the execution of the following command to ensure that the correct IP is associated by the wget to the license key:

uid=$(grep uid /usr/local/directadmin/scripts/setup.txt | awk -F'=' {'print $2'}); lid=$(grep lid /usr/local/directadmin/scripts/setup.txt | awk -F'=' {'print $2'}); ip=`hostname -i`;  sh /usr/local/directadmin/scripts/getLicense.sh $uid $lid $ip

3. If you are unable to connect to https://directadmin.com (port 443), you can try using port 80:

echo 1 > /root/.insecure_download

If this error is reoccurring, you can create a separate cron to automatically update the license for you:

uid=$(grep uid /usr/local/directadmin/scripts/setup.txt | awk -F'=' {'print $2'}); lid=$(grep lid /usr/local/directadmin/scripts/setup.txt | awk -F'=' {'print $2'}); echo '0 0 4 * * root /usr/local/directadmin/scripts/getLicense.sh $uid $lid ; echo "action=directadmin&value=restart" >> /usr/local/directadmin/data/task.queue' >> /etc/cron.d/directadmin_cron ; /etc/init.d/crond restart