• 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
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

Resolved Cant start Apache Server (502 Bad Gateway)

N2S

New Pleskian
I was using the "Advisor" tool to install recomended extensions/turn on security settings.. All websites on server are showing this error: 502 Bad Gateway -- I was following this article since I got the same error message when updating the server. This is the error I receive when trying to START Apache from Plesk:
Unable to start service: Unable to manage service by apache_control_adapter: ('start', 'web'). Error:

Plesk Onyx 17.8.11 Update #60 on Debian 8
 
another error message...

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] => website1.com,website2.com,website3.com ) Details: [2019-07-19 02:18:06.988] 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-07-19 02:18:08.131] ERR [panel] Apache config (15635169590.78897100) 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:
 
AUTOMATIC EMAIL FROM PLESK:
Unable to generate the web server configuration file on the host <stock.ovh> because of the following errors:

Template_Exception: Can not restart web server:
file: /opt/psa/admin/plib/Service/Driver/Web/Server/Apache.php
line: 111
code: 0

Please resolve the errors in web server configuration templates and generate the file again.
 
root@stock:~# plesk repair web

Checking Plesk version .............................................. [OK]

Checking for custom configuration templates ......................... [OK]

Checking the JkWorkersFile directive in the Apache configuration .... [OK]

Checking associations between domains and IP addresses .............. [OK]

Checking for corrupted reference between IP collections and
IPaddresses ......................................................... [OK]

Checking for links between APS applications and subscriptions ....... [OK]

Checking for the Zend extension declaraion in php.ini ............... [OK]

Check symbolic links for latest virtual host config files ........... [OK]

Checking for system users home directories consistency .............. [OK]

Checking for records with empty name field in the Configurations table
................................................................... [OK]

Checking for nginx ULIMIT value ..................................... [OK]

Checking for extra configurations in database not owned by any object
................................................................... [OK]

Checking the configuration of Apache modules ........................ [OK]

Repairing web server configuration

Reinstall SSL/TLS certificates and set the default certificate for all IP addresses? [Y/n] n

File not found: website1.com.conf
File not found: website2.com.conf ............................... [ERROR]

Repair server-wide configuration parameters for web servers? [Y/n]
 
What I see when I login to PLESK:
New configuration files for the Apache web server were not created due to the errors in configuration templates: Can not restart web server: . Detailed error descriptions were sent to you by email. Please resolve the issues and click here to generate broken configuration files once again or here to generate all configuration files. See the details in Configuration Troubleshooter
 
What I see when I login to PLESK:
New configuration files for the Apache web server were not created due to the errors in configuration templates: Can not restart web server: . Detailed error descriptions were sent to you by email. Please resolve the issues and click here to generate broken configuration files once again or here to generate all configuration files. See the details in Configuration Troubleshooter

Have you tried re-generate all configuration files?
 
nano /var/log/apache2/error.log
[Fri Jul 19 00:54:29.929276 2019] [ssl:warn] [pid 14572] AH01909: webmail.website1.com:443:0 server certificate does NOT include an ID which matches the server name
[Fri Jul 19 00:54:29.929892 2019] [ssl:warn] [pid 14572] AH01909: webmail.website2.com:443:0 server certificate does NOT include an ID which matches the server name
[Fri Jul 19 00:54:29.930578 2019] [ssl:warn] [pid 14572] AH01909: webmail.website3.com:443:0 server certificate does NOT include an ID which matches the server name
[Fri Jul 19 00:54:29.931704 2019] [ssl:warn] [pid 14572] AH01909: lists:443:0 server certificate does NOT include an ID which matches the server name
[Fri Jul 19 00:54:29.932358 2019] [ssl:warn] [pid 14572] AH01909: default-111_11_111_11:443:0 server certificate does NOT include an ID which matches the server name
[Fri Jul 19 00:54:29.934641 2019] [mpm_prefork:notice] [pid 14572] AH00163: Apache/2.4.10 (Debian) mod_fcgid/2.3.9 OpenSSL/1.0.1t configured -- resuming normal operations
[Fri Jul 19 00:54:29.934668 2019] [core:notice] [pid 14572] AH00094: Command line: '/usr/sbin/apache2'
[Fri Jul 19 01:02:27.858632 2019] [mpm_prefork:notice] [pid 14572] AH00169: caught SIGTERM, shutting down
[Fri Jul 19 01:02:29.339676 2019] [unique_id:alert] [pid 4083] (EAI 2)Name or service not known: AH01564: unable to find IPv4 address of "stock.ovh"
AH00016: Configuration Failed
[Fri Jul 19 01:03:45.830886 2019] [unique_id:alert] [pid 4988] (EAI 2)Name or service not known: AH01564: unable to find IPv4 address of "stock.ovh"

in the above text: replaced my server ip with "111_11_111_11".


nano /etc/hosts

# Your system has configured 'manage_etc_hosts' as True.
# As a result, if you wish for changes to this file to persist
# then you will need to either
# a.) make changes to the master file in /etc/cloud/templates/hosts.tmpl
# b.) change or remove the value of 'manage_etc_hosts' in
# /etc/cloud/cloud.cfg or cloud-config from user-data
127.0.1.1 vps11111.localdomain vps11111
127.0.0.1 localhost

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
 
Back
Top