Control Web Panel
WebPanel => CentOS 7 Problems => Topic started by: Verto on December 15, 2023, 09:11:04 PM
-
Hello, Please, I need urgent help to recover a downed server, which I am unable to recover on my own, nor do I think I have the knowledge to do so.
The error seems to report a conflict on port 80, which is occupied by Apache or by NGINX, but both have stopped working together.
My server was configured as Nginx & Varnish & Apache. But Apache won't start now and I have several websites down.
I have tried to restart everything, both the services and the server, but the problem is not solved and if I try to start Apache, I get this error:
"Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details."
-
Please run the following commands
netstat -lp | grep 80
journalctl -xe -u nginx
journalctl -xe -u apache2
-
My impatience to solve the problem and recover the downed sites, I think, has aggravated the situation.
Not knowing what to do, I decided to rebuild the server configuration from WebServer Settings/Select WebServers/ Nginx & Varnish & Apache, but the error kept occurring and in the end I discovered that Nginx and Apache were trying to use the same port. So I configured the ports correctly, and now I have managed to get the server to start. But I still have a problem, because it doesn't seem to point to any of the domains, as it doesn't show the contents of the directories where the sites are hosted. It always shows a 404 error, except in one of the domains where it shows an Apache test page.
-
If you allowed CWP to rebuild the servers, it should have change apache to port 8080 automatically. If however you installed a different version of apache, it may not work correctly.
-
Well, the truth is that I could not say. I just pressed the rebuild button, without modifying anything else. I understand that the rebuild had to be done with the configuration that I had previously, but the truth is that then I had to manually modify the ports, because I had assigned port 80 to Nginx and Apache.
How could I solve the problem?
I have several sites, which cannot be accessed right now.
-
I would rebuild the configuration Apache only to see if it get's working, and disable NGINX temporarily. Then if that works, rebuild with your current config
-
I've rebuilt it, and I've tried configuring just nginx as well, but it still doesn't direct to the directories where the websites are hosted. I don't know what else to do.
-
post your httpd.conf and your nginx.conf
-
I can't. The forum won't let me upload attachments, nor will it let me post the code for the files. It is returning an error stating that I am not authorized, when I try to post it.
-
use Pastebin or another temp hosting service to share the contents.
-
Sorry.
nginx.conf: https://pastebin.com/6bJyrH8c
httpd.conf: https://pastebin.com/vfrQBC4r
-
Your https.conf tells me that your Apache is not the cwp installed version. The Apache version for cwp should be installed under /usr/local/apache
-
Let's start by remove apache.
run from shell:
yum remove httpd apache2
Then try to reconfigure the servers from CWP Admin
-
im having a simlar problem and i have not made any changes and it just failed and i needed to roll back. i did find that there was an SSL problem also. im wondering would data and time have anything to do with it?
-
And this is why you should make a snapshot BEFORE making any major changes to a server.
Software and/or Hardware.
-
I'm having this same problem recently, and I have a little more documentation, since I have a snapshot, where upon updating, they are dependent on each other.
- http-filesystem
- httpd-tools
- httpd
- mod_ssl
It generates the following errors. Without updating this, the server operates normally, running
- CWP PRO
- AlmaLinux release 8.10 (Cerulean Leopard).
(https://ihost.com.ar/UTI/ERROR_HTTPD/UP_CWP.png)
The error starts with Apache and the FQDN. After a reboot, the reverse proxy fails with various errors and ports are busy, as if it were a different installation.
(https://ihost.com.ar/UTI/ERROR_HTTPD/ERROR_APACHE.png)
WARNING!
● nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2025-03-19 15:55:21 -03; 11s ago
Process: 1478 ExecStart=/usr/sbin/nginx (code=exited, status=1/FAILURE)
Process: 981 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
Process: 971 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
Mar 19 15:55:19 example.host.xxx nginx[1478]: nginx: [emerg] bind() to 192.168.88.240:80 failed (98: Address already in use)
Mar 19 15:55:19 example.host.xxx nginx[1478]: nginx: [emerg] bind() to 192.168.88.240:443 failed (98: Address already in use)
Mar 19 15:55:20 example.host.xxx nginx[1478]: nginx: [emerg] bind() to 192.168.88.240:80 failed (98: Address already in use)
Mar 19 15:55:20 example.host.xxx nginx[1478]: nginx: [emerg] bind() to 192.168.88.240:443 failed (98: Address already in use)
Mar 19 15:55:20 example.host.xxx nginx[1478]: nginx: [emerg] bind() to 192.168.88.240:80 failed (98: Address already in use)
Mar 19 15:55:20 example.host.xxx nginx[1478]: nginx: [emerg] bind() to 192.168.88.240:443 failed (98: Address already in use)
Mar 19 15:55:21 example.host.xxx nginx[1478]: nginx: [emerg] still could not bind()
Mar 19 15:55:21 example.host.xxx systemd[1]: nginx.service: Control process exited, code=exited status=1
Mar 19 15:55:21 example.host.xxx systemd[1]: nginx.service: Failed with result 'exit-code'.
Mar 19 15:55:21 example.host.xxx systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
After a reboot, NGIXN fails.
(https://ihost.com.ar/UTI/ERROR_HTTPD/ERROR_NGIXN.png)
WARNING!
● nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2025-03-19 15:55:21 -03; 11s ago
Process: 1478 ExecStart=/usr/sbin/nginx (code=exited, status=1/FAILURE)
Process: 981 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
Process: 971 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
Mar 19 15:55:19 example.host.xxx nginx[1478]: nginx: [emerg] bind() to 192.168.88.240:80 failed (98: Address already in use)
Mar 19 15:55:19 example.host.xxx nginx[1478]: nginx: [emerg] bind() to 192.168.88.240:443 failed (98: Address already in use)
Mar 19 15:55:20 example.host.xxx nginx[1478]: nginx: [emerg] bind() to 192.168.88.240:80 failed (98: Address already in use)
Mar 19 15:55:20 example.host.xxx nginx[1478]: nginx: [emerg] bind() to 192.168.88.240:443 failed (98: Address already in use)
Mar 19 15:55:20 example.host.xxx nginx[1478]: nginx: [emerg] bind() to 192.168.88.240:80 failed (98: Address already in use)
Mar 19 15:55:20 example.host.xxx nginx[1478]: nginx: [emerg] bind() to 192.168.88.240:443 failed (98: Address already in use)
Mar 19 15:55:21 example.host.xxx nginx[1478]: nginx: [emerg] still could not bind()
Mar 19 15:55:21 example.host.xxx systemd[1]: nginx.service: Control process exited, code=exited status=1
Mar 19 15:55:21 example.host.xxx systemd[1]: nginx.service: Failed with result 'exit-code'.
Mar 19 15:55:21 example.host.xxx systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
Do you have any idea where the problem could be?
-
Run this to see what is occupying the httpd ports:
lsof -i :80
lsof -i :443
-
Run this to see what is occupying the httpd ports:
lsof -i :80
lsof -i :443
I'm replicating the error now to respond based on what you ask!
Apache uses them, as far as I understand and see.
[root@lion ~]# lsof -i :80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
httpd 953 root 4u IPv6 27937 0t0 TCP *:http (LISTEN)
httpd 1212 apache 4u IPv6 27937 0t0 TCP *:http (LISTEN)
httpd 1213 apache 4u IPv6 27937 0t0 TCP *:http (LISTEN)
httpd 1214 apache 4u IPv6 27937 0t0 TCP *:http (LISTEN)
httpd 2870 apache 4u IPv6 27937 0t0 TCP *:http (LISTEN)
[root@lion ~]# lsof -i :443
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
httpd 953 root 6u IPv6 27945 0t0 TCP *:https (LISTEN)
httpd 1212 apache 6u IPv6 27945 0t0 TCP *:https (LISTEN)
httpd 1213 apache 6u IPv6 27945 0t0 TCP *:https (LISTEN)
httpd 1214 apache 6u IPv6 27945 0t0 TCP *:https (LISTEN)
httpd 1214 apache 18u IPv6 29624 0t0 TCP example.host.xxx:https->172.71.234.207:51248 (ESTABLISHED)
httpd 2870 apache 6u IPv6 27945 0t0 TCP *:https (LISTEN)
This is the error after rebooting, which I forgot to mention before...
WARNING!
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2025-03-19 18:50:29 -03; 6min ago
Docs: man:httpd.service(8)
Main PID: 953 (httpd)
Status: "Total requests: 66; Idle/Busy workers 100/0;Requests/sec: 0.17; Bytes served/sec: 838 B/sec"
Tasks: 278 (limit: 73297)
Memory: 64.6M
CGroup: /system.slice/httpd.service
├─ 953 /usr/sbin/httpd -DFOREGROUND
├─1209 /usr/sbin/httpd -DFOREGROUND
├─1212 /usr/sbin/httpd -DFOREGROUND
├─1213 /usr/sbin/httpd -DFOREGROUND
├─1214 /usr/sbin/httpd -DFOREGROUND
└─2870 /usr/sbin/httpd -DFOREGROUND
Mar 19 18:50:29 example.host.xxx systemd[1]: Starting The Apache HTTP Server...
Mar 19 18:50:29 example.host.xxx httpd[953]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using example.host.xxx Set the 'ServerName' directive globally to suppress this message
Mar 19 18:50:29 example.host.xxx systemd[1]: Started The Apache HTTP Server.
Mar 19 18:50:29 example.host.xxx httpd[953]: Server configured, listening on: port 443, port 80
-
Where are your IPv4?
CWP doesn't use the >RPM for Apache, CWP builds it from source.
So it showing those a new Apache .rpm files are available for install is concerning.
Also looks like you are behind a NAT.
-
Where are your IPv4?
CWP doesn't use the >RPM for Apache, CWP builds it from source.
So it showing those a new Apache .rpm files are available for install is concerning.
Also looks like you are behind a NAT.
I'm behind a MKT.
The problem occurs after updating. As you indicate, it's a different version, which is causing the conflict.
I don't know if this helps, but no changes have been made since the clean install, other than updating MariaDB to version 10.11.
[root@lion ~]# yum repolist
id del repositorio nombre del repositorio
appstream AlmaLinux 8 - AppStream
baseos AlmaLinux 8 - BaseOS
cwp CentOS Web Panel repo for Linux 8 - x86_64
epel Extra Packages for Enterprise Linux 8 - x86_64
epel-modular Extra Packages for Enterprise Linux Modular 8 - x86_64
extras AlmaLinux 8 - Extras
mariadb MariaDB
nginx nginx repo
pgdg-common PostgreSQL common RPMs for RHEL / Rocky / AlmaLinux 8 - x86_64
pgdg12 PostgreSQL 12 for RHEL / Rocky / AlmaLinux 8 - x86_64
pgdg13 PostgreSQL 13 for RHEL / Rocky / AlmaLinux 8 - x86_64
pgdg14 PostgreSQL 14 for RHEL / Rocky / AlmaLinux 8 - x86_64
pgdg15 PostgreSQL 15 for RHEL / Rocky / AlmaLinux 8 - x86_64
pgdg16 PostgreSQL 16 for RHEL / Rocky / AlmaLinux 8 - x86_64
pgdg17 PostgreSQL 17 for RHEL / Rocky / AlmaLinux 8 - x86_64
powertools AlmaLinux 8 - PowerTools
powertools-debuginfo AlmaLinux 8 - PowerTools debuginfo
powertools-source AlmaLinux 8 - PowerTools Source
varnishcache_varnish64 varnishcache_varnish64
varnishcache_varnish64-source varnishcache_varnish64-source
-
It's not an IP redirection issue, since if I restore the snapshot, everything works normally...
It only happens when updating those packages...
I sent you the list of repositories in case you see anything wrong.
-
Starburst was making a point that on your system, Apache (httpd) is only running on IPv6, not on IPv4. Is your server set up for IPv4 & IPv6 co-existing, or did you configure it to only handle IPv6? Mine is actually configured to disable IPv6. (Probably on the next major OS EOL cycle I will re-enable IPv6 and have co-existing protocols.)
-
Starburst was making a point that on your system, Apache (httpd) is only running on IPv6, not on IPv4. Is your server set up for IPv4 & IPv6 co-existing, or did you configure it to only handle IPv6? Mine is actually configured to disable IPv6. (Probably on the next major OS EOL cycle I will re-enable IPv6 and have co-existing protocols.)
Yes, I noticed that, it was always in IPv4...
The error only occurs if I apply those updates...
After updating, I just tried disabling IPv6 with
sudo nmtui
But the problem persists. I cloned the VM so I could try whatever you suggested.
In the instance without the updates, IPv6 coexists, but the configuration is all under IPv4.
And the strangest thing is that it tells me the ports are already in use after updating those packages.
-
I've apparently solved the problem. In case it helps anyone or has the same problem, here's the solution!
After much trial and error, the solution was much simpler than I thought, with the following command.
yum remove cwp-httpd httpd* -y && yum install cwp-httpd -y
I'll be testing it for a couple of days in the development environment, and if there are no problems, I'll apply it to production...
Thanks a lot for the guidance
I always follow your posts.