directadmin does not start (port 2222 already in use)

Invader Zim

Verified User
Joined
Sep 4, 2004
Messages
188
So, ever since this morning DA does not start anymore. The usual

systemctl start directadmin

just gives

Job for directadmin.service failed because the control process exited with error code. See "systemctl status directadmin.service" and "journalctl -xe" for details.

journalctl -xe says

-- Unit directadmin.service has begun starting up.
directadmin[11440]: 2021/06/11 08:19:06 fatal creating second HTTP server error=listen tcp :2222: bind: address already in use port=2222
systemd[1]: directadmin.service: main process exited, code=exited, status=1/FAILURE
systemd[1]: Failed to start DirectAdmin Web Control Panel.
-- Subject: Unit directadmin.service has failed



But there's nothing listening on port 2222. Just in case, I rebooted the server, but that didn't help at all. The error remains. The error log doesn't say anything useful either.

I did see a couple of lines like this:
2021:06:11-03:00:26: addIPtoFailedAttempts: Error creating ./data/admin/ip_access/165.227.77.164: mkdir(./data/admin/ip_access/165.227.77.164) error: Permission denied<br>

but there any no weird entries in /usr/local/directadmin/data/admin/ip_access/

Debug doesn't tell me much either.

# /usr/local/directadmin/directadmin b2000
2021/06/11 08:24:32 fatal creating second HTTP server error=listen tcp :2222: bind: address already in use port=2222
 
Just after posting this I thought, nah, that couldn't be it. So I changed ssl_port=2222 in the config to ssl_port=2223. And lo and behold, it works.

But this server has been running with both ports on 2222 for quite awhile now. What gives?
 
Another server (also after updates) now throws
fatal creating second HTTP server error=newServer failed to initialize TLS certificate cache: open /usr/local/directadmin/conf/cacert.pem: no such file or directory port=4444

There is indeed no file /usr/local/directadmin/conf/cacert.pem, but it's also not in the config.
 
Another server (also after updates) now throws
fatal creating second HTTP server error=newServer failed to initialize TLS certificate cache: open /usr/local/directadmin/conf/cacert.pem: no such file or directory port=4444

There is indeed no file /usr/local/directadmin/conf/cacert.pem, but it's also not in the config.
Just put an # before the carootcert= rule in the directadmin.conf and then start directadmin again.

I also reported this here

edit: You don't have this in your config? Thats strange. Are you using a own cert or let's encrypt?
 
There is no carootcert line in directadmin.conf. This particular server uses let's encrypt for the server/directadmin/etc.
 
It complained about the hostname not being known, but I fixed that bit with the hostname.sh shell script.
 
Another server (also after updates) now throws
fatal creating second HTTP server error=newServer failed to initialize TLS certificate cache: open /usr/local/directadmin/conf/cacert.pem: no such file or directory port=4444

There is indeed no file /usr/local/directadmin/conf/cacert.pem, but it's also not in the config.
see this post:
 
numservers=10
one_click_pma_login=1
openlitespeed=0
owsadm=/usr/local/frontpage/version5.0/bin/owsadm.exe
partition_usage_threshold=95
php_fpm_max_children_default=10
pigz=4
port=2222
pureftp=1
purge_spam_days=0
quota_partition=/
removeip=/usr/local/directadmin/scripts/removeip
renew_letsencrypt_on_suspended_domain=0
reseller_helper=reseller.site-helper.com
secure_access_group=access
 
The second server I tried to install "whmcs" has banned its IP.
The problem that whmcs ip does not allow 2222 pot because it bans the server ip I want to install.

If you have a banned server IP in the path below, it allows port 2222 when you remove it.

Remove banned IP from below path

/usr/local/directadmin/data/admin/ip_blacklist
 
Back
Top