• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue Apache breaks because of hosts not set permanently, IPv4, hostname, 502 Bad Gateway

Anton Keller

New Pleskian
Hi,
It seems while rebuilding templates with the plesk repair tool, I got more errors and the site shows a
"502 Bad Gateway" error
Can someone help me out?

Unable to configure the web server: Execution failed. Command: httpdmng Arguments: Array ( [0] => --reconfigure-all ) Details: Execution failed. Command: httpdmng Arguments: Array ( [0] => --reconfigure-domains [1] => mysite.com,myothersite.com ) Details: [2019-06-04 10:20:25.368] ERR [util_exec] proc_close() failed ['/opt/psa/admin/bin/apache_control_adapter' '--restart' '--restart-interval' '0' '--http-port' '7080' '--https-port' '7081'] with exit code [255] [2019-06-04 10:20:26.071] ERR [panel] Apache config (15596362950.78857600) generation failed: Template_Exception: Can not restart web server: file: /opt/psa/admin/plib/Service/Driver/Web/Server/Apache.php line: 111 code: 0 Can not restart web server:
 
Did you try to change "Apache Web Server" configuration? Tools & Settings?

This happened to me once when I removed required Apache Modules.
 
I don't think I did but maybe..
this is the new error I got right after doing the last tweak I mentioned:

Error: Can not reconfigure web server configurations: Unable to execute httpdmng: [2019-06-05 15:19:47.593] ERR [util_exec] proc_close() failed ['/opt/psa/admin/bin/apache_control_adapter' '--restart' '--restart-interval' '0' '--http-port' '7080' '--https-port' '7081'] with exit code [255]
[2019-06-05 15:19:49.180] ERR [panel] Apache config (15597406570.96238700) generation failed: Template_Exception: Can not restart web server:
file: /opt/psa/admin/plib/Service/Driver/Web/Server/Apache.php
line: 111
code: 0
Can not restart web server:
 
It normally does not start due to errors in configuration files. The Apache error log gives you all the details needed to find the reason.
 
Hi Peter, all I get from the log files is this multiple times :
8195#0: *3339 connect() failed (111: Connection refused) while connecting to upstream nginx error

It may be an Nginx error but I can't solve it.
 
8195#0: *3339 connect() failed (111: Connection refused) while connecting to upstream nginx error

This error is from NGINX. Also it means the Apache is not working. So the error is not related to NGINX.

Tools & Settings > Service Management then Stop the NGINX.

Then try to restart Apache via SSH. It will give you a details error message to troubleshoot.
 
Don't know what you mean.. the troubleshooter tells me there is a problem in Apache template and it cannot repair it. I didn't touch any template myself, except the thing you pointed the other day that did nothing.
Now I stopped the Nginx in service Management , I tried to start Apache from SSH with
service apache2 start
Then nothing at all
Cannot start it either from service management.
For the report, I don't know what it contains exactly, I thought you guys have access to it from an ID I gave you. If not, I won't post it here unless it's common practice.
 
ok..

When you stop NGINX via Panel.

Then #service apache2 restart

Do you get Active: active (running) When you run #service apache2 status ?
 
I got:
apache2.service - LSB: Apache2 web server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─forking.conf
Active: inactive (dead) since Thu 2019-06-06 10:38:41 CEST; 38s ago
Process: 19997 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
Process: 19982 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)

Jun 06 10:38:41 stock.ovh systemd[1]: Starting LSB: Apache2 web server...
Jun 06 10:38:41 stock.ovh apache2[19982]: Starting web server: apache2Action 'start' failed.
Jun 06 10:38:41 stock.ovh apache2[19982]: The Apache error log may have more information.
Jun 06 10:38:41 stock.ovh apache2[19982]: .
Jun 06 10:38:41 stock.ovh apache2[19997]: Stopping web server: apache2.
Jun 06 10:38:41 stock.ovh systemd[1]: Started LSB: Apache2 web server.
 
My Report ID is TR-PLSK-41938
Well. This is just a technical report to the reporting system without any problem description, steps to reproduce, expected results, etc. You have to submit a support ticket with all these details and as a very useful addition for the further ticket processing just point to this report id.
 
ok.. you can now check the Apache Error Log. It will tell you exactly which Apache Template has the issue.

EDIT - # vi /var/log/apache2/error.log
 
Sorry but this file is empty: /var/log/apache2/access.log
I tried vim and nano to be sure.

I may just give up since this thread is taking time from everyone. Feel free to continue help if you feel like it.
 
Back
Top