• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • 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.

apache server terminates after nginx redirection..

Vinay Samant

New Pleskian
I am using Plesk 12.5 on OVH Debian8 Dedicated.
It comes with inbuilt nginx as reverse proxy. This is something i am experiencing for 1st time!
Its fast and really cool! But i am facing 2 problems :
1. Apache server uses more than 100%(??) CPU. And ultimately shuts down. It can only be restarted after closing nginx process.
2. whether i m using nginx or apache, my images are not served using SSL. And hence https:// websites looks like mixed website and generates warning.

Detailed Situation :
1. I have a client colteneindia.com. Nothing in /. Wordpress site installed in /wordpress.
2. Another 2 custom application installed in 2 directories /crm /SFA.
3. With original server config, as nginx reverse proxy, if i use 2 rewrite rules with apache and nginx to redirect entire / traffic to /wordpress and force https:// then huge blocking can be observed at 7081/7080 ports. And then finally apache stops and nginx returns bad gateway. this happened 6-7 times.
4. I tried many threads, uninstalled nginx, reinstalled, reconfigured like what not but no luck.
5. One notable thing, if nginx is not running, things are excellent! So whats your advice on this?

**in any case, how can i set correct redirection/rewrite that will :
1. redirect each / query to /wordpress except "/crm" "/SFA"
2. How to force all request through SSL whether /crm or /wordpress and it should not show mixed website.
 
@Vinay Samant

Start installing your WordPress (henceforth: WP) instance to the root directory /.

This way, you do not have the need to redirect traffic AND you will probably do not have any problems with Apache and/or Nginx: after all, it is very likely that your rewrite rules cause a continuous loop, certainly when taking into account that WP has it´s own rules.

In essence, with the WP instance installed in the root directory /, you simply can use the default Nginx configuration.

Hope the above helps.

Regards....
 
but my apache server (nginx is kept closed) is shutting down every 16-18 hours, whatsoever.
my wordpress website is just transferred there, no-one actually access it.
we are accessign only /crm and /SFA. And i am using single redirect for SSL. Still my server shutdown early morning 6.24.
All my logs dont have anything suspicious, but CPU usage was above 80%.. i restarted it at 10:20. And now things are normal.
but i dont know why is it restarting and how to handle this.
I just remove SSL redirection also. but not sure it will help..

As I mentioned, my specific requirement is SSL and serving all http traffic by https. I am using free certificte from "lets encrypt" for testing.
should i start nginx or not?

is there some paid assistance available from Plesk where your experts can look into this?
 
@Vinay Samant

Note that the Plesk Experts are in essence expert volunteers on this forum.

Also note that Plesk has paid-for support, but you do not actually have an issue that would be worth contacting support.

The "Apache shutdown" is quite common, in the sense that Apache uses a lot of resources and can be overloading itself for many, many reasons (for instance, insufficient RAM).

The "Apache shutdown" and the high CPU usage does not have to be related: high CPU usage can also be related to log rotation or cronjobs (or even updates, for that matter).

It is very likely that, given the time of the "shutdown", that the high CPU usage is related to cronjobs, log rotation or updates, with the high CPU usage causing an "Apache shutdown".

The above implies that we have to tackle the high CPU usage first.

One reason for enabling Nginx is to offload requests (and therefore tasks) from Apache: Nginx is a reverse proxy and some simple settings can improve overall performance.

However, even though enabling Nginx is almost a "must", one should also make the handling of requests by Apache more effective.

For that reason, one should enable FPM on Apache.

The endresult would be that you have a domain with the Apache + FPM (server by Apache, not Nginx) + Nginx (for serving static files directly) stack.

This stack will increase performance noticeably.

Furthermore, applying PHP 7.0.3 (current PHP 7 version, provided by Plesk) would also increase performance considerably. Enable that too.

Naturally, some other tweaks of configuration settings can be done, but try to implement the settings as mentioned above.

Finally, if you want all requests via HTTPS just start a conversation with me (hover over my profile and click "conversation"), so I can help you or talk you through the process.

Hope the above helps!

Regards, looking forward to hear from you.......
 
Back
Top