Apache starts but Nginx doesn't

If Apache is running, Nginx won’t run and if Nginx is running Apache won’t start.

There haven’t been any changes made to the server so I’m not sure why the sudden errors. It’s been running fine these last few months until now this binding issue.

This is Nginx trying to start when Apache is running.

2022/05/21 16:12:05 [emerg] 9219#9219: bind() to 10.0.0.35:8080 failed (98: Address already in use)

2022/05/21 16:12:05 [emerg] 9219#9219: bind() to 10.0.0.35:8443 failed (98: Address already in use)

2022/05/21 16:12:05 [emerg] 9219#9219: bind() to 10.0.0.35:8080 failed (98: Address already in use)

2022/05/21 16:12:05 [emerg] 9219#9219: bind() to 10.0.0.35:8443 failed (98: Address already in use)

2022/05/21 16:12:05 [emerg] 9219#9219: bind() to 10.0.0.35:8080 failed (98: Address already in use)

2022/05/21 16:12:05 [emerg] 9219#9219: bind() to 10.0.0.35:8443 failed (98: Address already in use)

2022/05/21 16:12:05 [emerg] 9219#9219: bind() to 10.0.0.35:8080 failed (98: Address already in use)

2022/05/21 16:12:05 [emerg] 9219#9219: bind() to 10.0.0.35:8443 failed (98: Address already in use)

2022/05/21 16:12:05 [emerg] 9219#9219: bind() to 10.0.0.35:8080 failed (98: Address already in use)

2022/05/21 16:12:05 [emerg] 9219#9219: bind() to 10.0.0.35:8443 failed (98: Address already in use)

2022/05/21 16:12:05 [emerg] 9219#9219: still could not bind()

This is Apache trying to run when Nginx is running

May 21 16:23:03 serverhostname.here systemd[1]: Starting The Apache HTTP Server...
May 21 16:23:03 serverhostname.here apachectl[18938]: (98)Address already in use: AH00072: make_sock: could not bind to address 10.0.0.35:8443
May 21 16:23:03 serverhostname.here apachectl[18938]: no listening sockets available, shutting down
May 21 16:23:03 serverhostname.here apachectl[18938]: AH00015: Unable to open logs
May 21 16:23:03 serverhostname.here apachectl[18935]: Action 'start' failed.
May 21 16:23:03 serverhostname.here apachectl[18935]: The Apache error log may have more information.
May 21 16:23:03 serverhostname.here systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
May 21 16:23:03 serverhostname.here systemd[1]: apache2.service: Failed with result 'exit-code'.
May 21 16:23:03 serverhostname.here systemd[1]: Failed to start The Apache HTTP Server.t' failed.

Nginx should never bind to 8080 or 8443

So there look like a config issue in one of your config files

How do I find out what caused it/which config file is corrupted? I haven’t touched this server in a while, so there haven’t been any changes besides whatever is automated by the control panel/updates on the server.

How does /usr/local/hesita/conf/hestia.conf looks like?

ANTISPAM_SYSTEM=‘spamassassin’
ANTIVIRUS_SYSTEM=‘clamav-daemon’
API=‘yes’
API_ALLOWED_IP=‘public_ip,127.0.0.1,0.0.0.0’
BACKEND_PORT=‘877’
BACKUP_GZIP=‘11’
BACKUP_MODE=‘zstd’
BACKUP_SYSTEM=‘local,ftp’
CRON_SYSTEM=‘cron’
DB_PMA_ALIAS=‘phpmyadmin’
DB_SYSTEM=‘mysql’
DEBUG_MODE=‘true’
DISK_QUOTA=‘yes’
DNS_SYSTEM=‘bind9’
ENFORCE_SUBDOMAIN_OWNERSHIP=‘yes’
FILE_MANAGER=‘true’
FIREWALL_EXTENSION=‘fail2ban’
FIREWALL_SYSTEM=‘iptables’
FTP_SYSTEM=‘vsftpd’
IMAP_SYSTEM=‘dovecot’
INACTIVE_SESSION_TIMEOUT=‘60’
LANGUAGE=‘en’
LOGIN_STYLE=‘default’
MAIL_SYSTEM=‘exim4’
PHPMYADMIN_KEY=‘’
PLUGIN_APP_INSTALLER=‘true’
POLICY_CSRF_STRICTNESS=‘1’
POLICY_SYSTEM_ENABLE_BACON=‘false’
POLICY_SYSTEM_HIDE_ADMIN=‘no’
POLICY_SYSTEM_HIDE_SERVICES=‘no’
POLICY_SYSTEM_PASSWORD_RESET=‘yes’
POLICY_SYSTEM_PROTECTED_ADMIN=‘no’
POLICY_SYSTEM_PROTECTED_ADMIN=‘yes’
POLICY_USER_CHANGE_THEME=‘yes’
POLICY_USER_DELETE_LOGS=‘yes’
POLICY_USER_EDIT_DETAILS=‘yes’
POLICY_USER_EDIT_DNS_TEMPLATES=‘yes’
POLICY_USER_EDIT_WEB_TEMPLATES=‘yes’
POLICY_USER_VIEW_LOGS=‘yes’
POLICY_USER_VIEW_SUSPENDED=‘’
PROXY_PORT=‘80’
PROXY_SSL_PORT=‘443’
PROXY_SYSTEM=‘nginx’
RELEASE_BRANCH=‘release’
SERVER_SMTP_ADDR=‘’
SERVER_SMTP_HOST=‘’
SERVER_SMTP_PASSWD=‘’
SERVER_SMTP_PORT=‘’
SERVER_SMTP_SECURITY=‘’
SERVER_SMTP_USER=‘’
SMTP_RELAY=‘true’
SMTP_RELAY_HOST=‘awssettings’
SMTP_RELAY_PORT=‘awssettings’
SMTP_RELAY_USER=‘awssettings’
STATS_SYSTEM=‘awstats’
THEME=‘dark’
UPDATE_HOSTNAME_SSL=‘yes’
UPGRADE_SEND_EMAIL=‘true’
UPGRADE_SEND_EMAIL_LOG=‘true’
USE_SERVER_SMTP=‘false’
VERSION=‘1.5.15’
WEBMAIL_ALIAS=‘rocketfuel’
WEBMAIL_SYSTEM=‘rainloop,roundcube’
WEB_BACKEND=‘php-fpm’
WEB_PORT=‘8080’
WEB_RGROUPS=‘www-data’
WEB_SSL=‘mod_ssl’
WEB_SSL_PORT=‘8443’
WEB_SYSTEM=‘apache2’

#!/bin/bash
source /etc/hestiacp/hestia.conf
source $HESTIA/func/main.sh

for user in $($BIN/v-list-users plain | cut -f1 ); do
   $BIN/v-rebuild-web-domains $user 
done

To rebuild all the web domains templates

Ran this and rebooted, still no difference. Only one is able to come on. I tried rebuilding each one with v-rebuild-web-domains aswell and that didn’t work either.

Strange…

I have no idea probally there is a config file acting not as it should be

Feel free to DM me with the ssh details

My public keys can be found here:
https://github.com/jaapmarcus.keys

Changed WEB_PORT to 8081 and WEB_SSL_PORT to 8441 in /usr/local/hestia/conf/hestia.conf (picked it up from this thread) to two different ports one/two characters up/down, ran your script to rebuild all the users and it’s now binding and allowing it to start.

image

Is there a base Nginx template that I should be looking at to compare with other config files? I’d like to go through my configuration files and see what’s causing this.

I’m gonna make a backup of this server and move it over to a fresh install on a different server so the websites can stay live, then you could perhaps take a look after if I don’t find anything myself?

Here’s a list of ports that are being bound after I started them both. Posting it just incase you can see something irregular with it.

It seems my templates are corrupted somehow? Because after doing this, going to a website that isn’t suspended in my users shows the suspended screen. And if I unsuspend the suspended user, the websites go to normal but they go to each other instead of their own domain. So if I went to x1.com it will redirect me to x2.com which is completely seperate?

That is strange I haven’t seen an issue like this in the past

Also nginx should not listen to port 8081 / 80441

So there is something wrong.