wesupport

25% off on first invoice for all services*

SPRING SALE

Use coupon

*Offer valid for new customers only

25% off on first invoice for all services*

SPRING SALE

Use coupon

*Offer valid for new customers only

Need help?

Our experts have had an average response time of 11.43 minutes in March 2024 to fix urgent issues.

We will keep your servers stable, secure, and fast at all times for one fixed price.

DirectAdmin port 2222 not working – How we fix it!

by | Oct 16, 2019

 

 “Am unable to access my server via http://xxx.xxx.xxx.xx:2222, DirectAdmin port 2222 not working”. Please fix it.

That was a recent HelpDesk request we received in our Server Management Services.

This is a common issue when we try to connect the server via the DirectAdmin control panel.

Today, let’s analyze the error and see how our Support Engineers fix this for our customers.

 

 

7 Reasons why DirectAdmin port 2222 stops working

 

DirectAdmin is one of the popular control panels in the web hosting industry. It is simple to use and extremely efficient.

The control panel listens on port 2222 by default. But at times, there are cases when customers contact us saying they are unable to access the Directadmin control panel.

Let’s see the main causes for this error:

  1. Port 2222 is blocked in the firewall.
  2. Incorrect ethernet_dev settings in the DirectAdmin conf file.
  3. Invalid DirectAdmin license.
  4. DirectAdmin not running.
  5. IP Blacklist.
  6. SSL ciphers issue.
  7. Invalid time on the server.

 

How we fix the issue – DirectAdmin port 2222 not working

We just saw the different causes for DirectAdmin port 2222 not working error.

Let’s see how our Support engineers fix this error for our customers.

1.  Port 2222 blocked in the firewall

The Directadmin default port is 2222. It fails to contact the license server if this port is closed or blocked by a firewall.

So we first check if port 2222 blocked in the firewall.

If the customer is using the CSF firewall:

  1. We login to the server as root
  2. Then we open the CSF conf file :  /etc/csf/csf.conf
  3. Verify if port 2222 is opened in this CSF conf file
  4. If it is not set up, we whitelist the port 2222 as follows:

 

# Allow incoming TCP ports

TCP_IN = “2222”

# Allow outgoing TCP ports

TCP_OUT = “2222”

 

5. After this, we restart the CSF firewall using the command.

csf -r 

If the customer is using iptables, we use the below command to stop the firewall.

service iptables stop
chkconfig iptables off

For servers running Firewalld, the port is enabled in the firewall with this command:

firewall-cmd --permanent --zone=public --add-port=2222/tcp

To stop firewalld to test, we use these commands:

systemctl disable firewalld
systemctl stop firewalld

At last, we restart the DirectAdmin using the below command.

 service directadmin restart

 

2. Incorrect ethernet_dev settings

To start DirectAdmin, the ethernet_dev settings should be properly updated in the directadmin.conf file.

For this, we first find out the device name of the customer’s IP. We use the below command to find out the device name from the server.

#ifconfig

Common devices names/formats are: eth0, eth0:1, eth1, venet0:0, etc.

Once we know the device name, we edit the conf file /usr/local/directadmin/conf/directadmin.conf and change (or add) the setting:

       ethernet_dev=eth0

We replace ‘eth0’ with the name of the ethernet device in the server.

 

3. Invalid DirectAdmin license

Invalid license issues can happen either due to wrong uid/lid, IP, or date. So we update the customer’s DirectAdmin License manually.

To do this:

We use the below command.

cd /usr/local/directadmin/scripts
./getLicense.sh 123 1234 1.2.3.4

 

Client ID (uid): 123

License ID (lid): 1234

IP address: 1.2.3.4

Directadmin service has to be restarted after this. DirectAdmin license copy can only be installed in one server at a time.

To verify the license, DirectAdmin attempts to contact the licensing server. If the IP of the server and IP on file with the licensing server mismatches, the DirectAdmin will be suspended until this is corrected.

To regain access, we contact DirectAdmin support and notify them of the

1) New IP address

2) Old IP address

3) License ID

Once the request is processed, we regenerate the license file with the above command.

We also do this with the ipswap.sh script to replace the old server IP with the new server IP.

/usr/local/directadmin/scripts/ipswap.sh <old-IP> <new-IP>

 

4. DirectAdmin not running

DirectAdmin service may not be running in the server in certain scenarios. We try running DirectAdmin manually and debug the problem.

cd /usr/local/directadmin
./directadmin b200

 

If that doesn’t fix the issue, we check the error log at /var/log/directadmin/error.log to check for any errors as to why it isn’t starting:

tail /var/log/directadmin/error.log

 

DirectAdmin cannot start if another process is already running in the same port. It will give “Bind Error: Make sure there aren’t any copies running in the background. Address already in use”.

In such cases, we pinpoint the process that is running and kill it before restarting the DirectAdmin service.

5. IP Blacklist

Blacklisted IP also can result in DirectAdmin port 2222 not working error.

For this, we check the IP in file  /usr/local/directadmin/data/admin/ip_blacklist.

To fix the error, we remove the IP from blacklist and whitelist it.

 

6. SSL ciphers issue

Similalrly, inadequate SSL ciphers may cause the DirectAdmin port 2222 not working issue. So we verify that the customers are using correct SSL ciphers for the DirectAdmin panel.

In some cases, the binaries will allow only TLSv1.2. We open the file /usr/local/directadmin/conf/directadmin.conf and update the correct entry like below.

ssl_cipher=HIGH:!aNULL:!MD5

This usually fixes port 2222 not working in DirectAdmin due to SSL ciphers issue.

 

7. Invalid time on the server

The most common cause of DirectAdmin port 2222 not working error is invalid time on the server.

To set the time on the server, we login to the server as ‘root’ and do the below steps.

1)  Note the region where the server resides.

ls /usr/share/zoneinfo/

2) Note the time zone which corresponds to that location.

ls /usr/share/zoneinfo/<YOUR_REGION> 

3) Create a symbolic link from the /etc/localtime file to the time zone we need.

4) Set the time and date on the server.

`date MMDDhhmmYYYY`

5) Update the DirectAdmin license with the command:

/usr/local/directadmin/scripts/getLicense.sh <cid> <lic_id>

6) Restart the DirectAdmin service and you can see DirectAdmin loading fine.

 

[Need more assistance in DirectAdmin port 2222 not working error? We’ll fix it for you.]

 

Conclusion

In short, DirectAdmin port 2222 not working error is mainly due to firewall issues, incorrect ethernet_dev settings, invalid DirectAdmin license issue and so on. Today we saw how our Support Engineers fix this error for our customers.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Categories

Tags