• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx

  • We are developing a new feature in Plesk that will help you promote your websites or business on social media. We want to conduct a one-hour online UX test to present the prototype and collect feedback. If you are interested in the feature, please book a meeting via this link.
    Thank you in advance!
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Issue Apache doesn't accept connections from nginx anymore

Heinrich

Basic Pleskian
Hello everyone,

since two days or so nginx only produces gateway timeouts (Error 504), unless I set the domain in question to not use the proxy but serve all data with nginx.
But I can't do that with webmail.

In any case, I'd like the server to work again properly.
plesk repair all didn't fix the problem, neither did
plesk sbin httpdmng --reconfigure-all

I also can't find any specific errors in the logs of apache....

The day the problem occurred I used apt to reinstall openssl and ca-certificates. So possibly nginx and apache can't communicate because of TLS settings.
Are there any CAs I would need to reinstall, too. PLESK specific...?
 
For starters, is your Apache even running? What does 'systemctl status apache2.service' report? Can you stop and start Apache normally?
 
Yes it is. I used 'service apache2 status' but the output is the same and "running" in written in a friendly, non-threatening green.

apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: active (running) since Sa 2019-11-23 15:10:30 UTC; 4h 19min ago
Docs: man:systemd-sysv-generator(8)
Process: XXXXX ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCES
Process: XXXXX ExecReload=/etc/init.d/apache2 reload (code=exited, status=0/SU
Process: XXXXX ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCC
CGroup: /system.slice/apache2.service
├─11125 /usr/sbin/apache2 -k start
├─11128 Passenger watchdog
└─20929 /usr/sbin/apache2 -k start

It does seem to fail occasionally, though.
But testing the syntax didn't reveal mistakes in the configuration.
 
I think it is possible that a change in openssl has modified the configuration files in a way that Apache is not listening on the right port any longer. You can test that by
Debian:
# netstat -anp | grep apache
that should yield the ports 7080 and 7081 in the result like
Code:
tcp        0      0 0.0.0.0:7080            0.0.0.0:*               LISTEN      18435/httpd
tcp        0      0 0.0.0.0:7081            0.0.0.0:*               LISTEN      18435/httpd
unix  3      [ ]         STREAM     CONNECTED     26161915 18435/httpd

If these ports are wrong, probably the openssl modifications have modified general Apache files. And who knows what else they have done ... Depending on how many websites there are on the system and how much downtime you could afford, you could try to first remove Apache through the Plesk Installer, the reinstall it. This might be necessary to regenerate not only the configuration files that are generated by httpmng, but also the basic configuration files of the web server installation. After reinstallation, probably a reconfigure-all will be necessary, too.

But make a full backup of all websites, configurations etc. to be able to restore everything in case that this makes things worse.
 
The command returns
tcp6 0 0 :::7080 :::* LISTEN 11125/apache2
tcp6 0 0 :::7081 :::* LISTEN 11125/apache2

Not sure if nginx will use ipv6 for the proxy to apache2.

In any case, is there a way to only deinstall and reinstall apache2, without pretty much every other aspect of plesk. For when I try to use the components add/remove page, it tells me about the removal of apache is a conflict with PLESK, but also it will deinstall all extensions and a lot of other parts of my server. So, I don't want that, if it ain't necessary.
 
Well, purging apache2 with dpkg and reinstalled it, ran repair installation. So far the error remains...
 
Well, purging apache2 with dpkg and reinstalled it, ran repair installation. So far the error remains...
Oh no, that is definitely something not to do, because when you install Apache from your normal package manager, the configuration that it needs to communicate as a back end server, cannot be correct. This might have broken PHP settings, too. Too many dependencies with Plesk.

I'd probably ask official Plesk support at this point. To solve this it will need investigation on your system, but the solution will likely be to reinstall the system (given that "plesk repair installation" did not work for you) and to restore the content from your Plesk full backup.
 
Well I did restore the server to the setting before the purge and reinstall, so the original error is still occuring...
 
Back
Top