Solved Unable to Change DirectAdmin Port!

Adrenaline

Verified User
Joined
Sep 23, 2015
Messages
38
Hello everyone

After changing the DirectAdmin port and opening it in the firewall, I am unable to access the control panel!

Code:
nano /usr/local/directadmin/conf/directadmin.conf
port=2295
systemctl restart directadmin

firewall-cmd --permanent --add-port=2295/tcp
firewall-cmd --reload

Does anyone know what is the problem?
 
check the directadmin error log

Code:
[root@server ~]# cat /var/log/directadmin/error.log
2025:02:08-06:06:25: Socket write error: fd is connected to a pipe or socket whose reading end is closed.  When this  happens the writing process will also receive a SIG_PIPE signal.  (Thus, the write return value is seen only if  the program catches, blocks or ignores this signal.)
2025:02:08-06:06:25: Send:sendData(/JS_CREATION_CHECK): attempted to send 1922 bytes, but only 0 were delivered
2025:02:08-06:23:26: Socket write error: fd is connected to a pipe or socket whose reading end is closed.  When this  happens the writing process will also receive a SIG_PIPE signal.  (Thus, the write return value is seen only if  the program catches, blocks or ignores this signal.)
2025:02:08-06:23:26: Send:sendData(/HTM_INDEX_USER): attempted to send 8827 bytes, but only 137 were delivered
2025:02:08-06:23:45: clean_dangerious_env_vars:Spam::saveSettings: cleared dangerous variable: SAFE_CODE=
2025:02:08-06:23:45: File ./data/users/admin/domains.list has been written to after this process read it.  Not going to overwrite it. This read timestamp=1738979965, before-write timestamp=1738983224
2025:02:08-06:28:36: File ./data/users/admin/domains.list has been written to after this process read it.  Not going to overwrite it. This read timestamp=1738983224, before-write timestamp=1738983516
 
firewall-cmd --permanent --add-port=2295/tcp
Do you still have firewall-cmd running and not CSF? Because normally when installing DA then also CSF/LFD is used and poort should be opened in there.
It's also a better fireawll than the default present in the OS (better disable or don't use those profiles).

If you don't use CSF/LFD then check for example with telnet from outside or use a command like:
iptables -L INPUT
to see if port is indeed opened in the firewall.
 
Do you still have firewall-cmd running and not CSF? Because normally when installing DA then also CSF/LFD is used and poort should be opened in there.
It's also a better fireawll than the default present in the OS (better disable or don't use those profiles).

If you don't use CSF/LFD then check for example with telnet from outside or use a command like:
iptables -L INPUT
to see if port is indeed opened in the firewall.
Problem solved!

I had disabled CSF and installed firewalld, but after placing the DirectAdmin port in CSF (despite it being disabled), the problem was solved!
Generally, I prefer nftables first, then iptables, and finally firewalld.
I'm not interested in csf and ufw :)
 
I'm not interested in csf and ufw :)
Ufw is just the Debian alternative for firewalld from Redhat, they all work on nftables/iptables.
CSF is just a shell which uses iptables, but can do loads of bruteforce blocks and other good things so you don't have to configure everything manually. Makes life a lot easier.
But ofcourse you're free to use what you like better. ;)
 
Back
Top