Control Web Panel

WebPanel => Apache => Topic started by: kandalf on February 27, 2022, 10:17:32 AM

Title: nginx -> apache -> php-fpm VS nginx -> php-fpm
Post by: kandalf on February 27, 2022, 10:17:32 AM
I found that CWP have a configuration that is nginx -> apache -> php-fpm what are the advantages of this instead of nginx -> php-fpm?

With nginx -> apache -> php-fpm can we still use .htaccess?

At the moment I'm using Nginx + Varnish + Apache php-cgi, I don't know exactly the impact of Varnish since I don't change any configuration but all websites work well.

Most of the examples on the internet use nginx + php-fpm or apache + php-fpm, I don't understand what are exactly the advantages of have nginx + apache + php-fpm
Title: Re: nginx -> apache -> php-fpm VS nginx -> php-fpm
Post by: studio4host on February 27, 2022, 12:17:11 PM
using apache allows you to have more flexibility as for nginx all config needs to be done in the nginx vhost conf file,
while apache is more flexible with additional modules and rules like with htacces, PHP custom configuration .user.ini ...and even some scripts will not work well with nginx only.
Title: Re: nginx -> apache -> php-fpm VS nginx -> php-fpm
Post by: kandalf on February 27, 2022, 12:49:31 PM
using apache allows you to have more flexibility as for nginx all config needs to be done in the nginx vhost conf file,
while apache is more flexible with additional modules and rules like with htacces, PHP custom configuration .user.ini ...and even some scripts will not work well with nginx only.

But with nginx -> apache -> php-fpm all regular htaccess rules will work like in my current config that is Nginx + Apache php-cgi?
Title: Re: nginx -> apache -> php-fpm VS nginx -> php-fpm
Post by: iraqiboy90 on February 27, 2022, 09:20:47 PM
using apache allows you to have more flexibility as for nginx all config needs to be done in the nginx vhost conf file,
while apache is more flexible with additional modules and rules like with htacces, PHP custom configuration .user.ini ...and even some scripts will not work well with nginx only.

But with nginx -> apache -> php-fpm all regular htaccess rules will work like in my current config that is Nginx + Apache php-cgi?

yes and no. Everything will work normally in htaccess except the rules that nginx has been specifically configured to take over. Either way, the best server option is "nginx - varnish - apache - phpfpm"
Title: Re: nginx -> apache -> php-fpm VS nginx -> php-fpm
Post by: kandalf on February 28, 2022, 09:15:38 AM
using apache allows you to have more flexibility as for nginx all config needs to be done in the nginx vhost conf file,
while apache is more flexible with additional modules and rules like with htacces, PHP custom configuration .user.ini ...and even some scripts will not work well with nginx only.

But with nginx -> apache -> php-fpm all regular htaccess rules will work like in my current config that is Nginx + Apache php-cgi?

yes and no. Everything will work normally in htaccess except the rules that nginx has been specifically configured to take over. Either way, the best server option is "nginx - varnish - apache - phpfpm"

In reallity at the moment in my current server  I have nginx - varnish - apache php-cgi, but I think varnish it not working. After reading a little but varnish seems a little tricky, we need to configure and test it on every website, I will host losts of client websites I don't want to implement anything that required a special configuration for each one.

I'm more interested in have a default configuration like nginx - apache - php-fpm and if I required for some website enable the nginx - varnish - apache - phpfpm
Title: Re: nginx -> apache -> php-fpm VS nginx -> php-fpm
Post by: iraqiboy90 on February 28, 2022, 09:11:32 PM
Even when selecting nginx - varnish - apache - php on "Select Webserver", Varnish is by default not enabled on domains. Which is good, because like you said, it is tricky.
I have experienced it to be extremely aggressive and will probably conflict with other caching tools.

To enable varnish, re-select the "nginx - varnish - apache - php" on "Webserver Domain Conf" for that specific domain.

Tip: To clear varnish cache for a user instead of the entire server, login to userCP and find the clear cache page.