Control Web Panel
WebPanel => PHP => Topic started by: AdventureTime on March 10, 2022, 05:15:44 AM
-
Hello,
I have installed PHP-FPM and changed my webserver from Apache to either Nginx or Nginx + Varnish Cache. However, I am receiving a 502 Bad Gateway message for my website, which is the initial installation of WordPress.
I have selected the latest version of PHP, which is something like 7.4.28.
May you please help me?
Thanks!
-
Please make sure you have a pro license, or any verison of FPM will be disabled automatically. If you do have pro, make sure you start the PHP-FPM service
systemctl start php-fpm74
systemctl enable php-fpm74
-
Please make sure you have a pro license, or any verison of FPM will be disabled automatically. If you do have pro, make sure you start the PHP-FPM service
systemctl start php-fpm74
systemctl enable php-fpm74
I am happy to say that I am now using the pro version.
(https://i.imgur.com/WKlbJKg.png)
However, I only see the following even after enabling PHP-FPM
(https://i.imgur.com/TGhsRmJ.png)
-
You may need to rebuild your configs after enabling fpm
-
You may need to rebuild your configs after enabling fpm
I found the issue. I tried to explore these first:
(https://i.imgur.com/DLHsrut.png)
I honestly don't know the difference between the two.
Moving forward, I checked the User Accounts > List Accounts and I noticed the Domain Name has a missing .com that is why it does not work. I fixed it by deleting and recreating the User Account again.
To my surprise, it worked. To be sure, I did the Fix Permissions stuff and Web Server Settings > Web Servers Main Conf / Web Servers Domain Conf.
Finally, it worked!
-
Main config is for ALL of your accounts that don't have specific configurations. Domain Config allows you to use a different template for an individual account, or domain. Once you explore some more, you will get the hang of it.
-
Main config is for ALL of your accounts that don't have specific configurations. Domain Config allows you to use a different template for an individual account or domain. Once you explore some more, you will get the hang of it.
I thought it was something that would be mandatory for domains to have. At least now I know. I don't wholly understand the template's purpose, but I think either I will use default or php-fpm as the template, right?
-
Main config is for ALL of your accounts that don't have specific configurations. Domain Config allows you to use a different template for an individual account or domain. Once you explore some more, you will get the hang of it.
I thought it was something that would be mandatory for domains to have. At least now I know. I don't wholly understand the template's purpose, but I think either I will use default or php-fpm as the template, right?
Yes. Set the Main config to Default is fine. I
As to the Domain Configs, let's say you have a Joomla site, that requires specific settings from apache or nginx. You can create a new template with those specific settings, and set that domain to use it. NEVER edit the config files directly, because any changes made can be overwritten on an update of CWP, or a config rebuild
-
Main config is for ALL of your accounts that don't have specific configurations. Domain Config allows you to use a different template for an individual account or domain. Once you explore some more, you will get the hang of it.
I thought it was something that would be mandatory for domains to have. At least now I know. I don't wholly understand the template's purpose, but I think either I will use default or php-fpm as the template, right?
Yes. Set the Main config to Default is fine. I
As to the Domain Configs, let's say you have a Joomla site, that requires specific settings from apache or nginx. You can create a new template with those specific settings, and set that domain to use it. NEVER edit the config files directly, because any changes made can be overwritten on an update of CWP, or a config rebuild
Thank you!
I activated the AutoSSL feature through Let's Encrypt.
Now I always receive a 403 Forbidden message.
I changed the type of web server from nginx + Varnish Cache to nginx only, vice-versa.
I am still receiving a 403 message whenever I visit my site both SSL and non-SSL version of it.
-
403 errors typically means that you have permission issues. make sure directories are chmod 755, and files 644 in your web roots. Also make sure the files are owned by the user
-
I am still receiving a 403 message whenever I visit my site both SSL and non-SSL version of it.
Do you have mod_security enabled by any chance? It may be blocking a script that runs when you visit the page?
Either way, 403 message is usually user related. Meaning you added something that's blocking you.
-
I am still receiving a 403 message whenever I visit my site both SSL and non-SSL version of it.
Do you have mod_security enabled by any chance? It may be blocking a script that runs when you visit the page?
Either way, 403 message is usually user related. Meaning you added something that's blocking you.
Yes, I have mod_security enabled.
Also, the 403 message started to appear when I used AutoSSL and received the Let's Encrypt certificate.
-
you should also check the /usr/local/apache/domlogs/ for both the access and error logs. They should give some insight as to why you are receiving 403 errors.
-
you should also check the /usr/local/apache/domlogs/ for both the access and error logs. They should give some insight as to why you are receiving 403 errors.
I am mainly using nginx.
-
I have removed the AutoSSL thing, and it still says 403 Forbidden. The website would work if I tried using simply Apache or nginx + Varnish + Apache. I decided to use CWP Pro to install php-fpm[/] and avoid Apache altogether. Any thoughts about why making nginx the primary server does not work? Thanks.
-
Nginx cannot run without php-fpm. Apache uses built in modules to connect to php. Nginx does not have those, so it requires a standalone version of php such as php-cgi or php-fpm
-
Nginx cannot run without php-fpm. Apache uses built-in modules to connect to php. Nginx does not have those, so it requires a standalone version of php such as php-cgi or php-fpm
Yes, I agree. That is why I purchased and subscribed to the CWP Pro version to support its development.
However, I noticed I could not use nginx alone. I would need to use something that has Apache for it to work.
Is it because it is incompatible with the latest version of 7.4 of PHP? Or do I need to use the last 5.6 version?
My current configuration is nginx > varnish > apache.
I prefer either nginx alone or nginx > varnish.
I accidentally solved it.
I pressed fixed permission when user nobody is selected.
nginx alone works now.
and nginx > varnish still doesn't work though.
(https://i.imgur.com/duTxMaw.png)
Also, I don't understand this:
Nginx & Varnish
Additional Options: nginx/php-fpm, proxy
HTTP: Nginx (80) --> Varnish (82)
HTTPS: Nginx (443) --> Varnish (82)
Info: Useful as nginx/varnish proxy cache for NodeJS, Ruby, Tomcat
** Requires custom configuration per domain, as default behavior is proxy to varnish.
** Varnish you can enable additionally for domains you need.
What does it require and what do I need to do?
-
nginx + varnish can be used only if you proxy varnish to the custom app, like nodejs, tomcat....
if you want to use php then you can use only the option where the last server is nginx or apache.
However, you can also set per domain to use nginx + php-fpm if you have selected nginx/varnish webserver setup.
-
nginx + varnish can be used only if you proxy varnish to the custom app, like nodejs, tomcat....
if you want to use php then you can use only the option where the last server is nginx or apache.
However, you can also set per domain to use nginx + php-fpm if you have selected nginx/varnish webserver setup.
Oh wait. I can't use Varnish for WordPress?
How to proxy it or something?
-
Why don't you make your life easier by switching to Nginx & Varnish & Apache and then assign "Nginx -> php-fpm" to those sites you insist on having it "nginx - php-fpm"?
Basically, make your wordpress run with Nginx - Varnish - Apache.
Varnish needs to be manually enabled by re-selecting this webserver configuration through the WebServer Domain Conf.
There you can choose a varnish template made for wordpress.
My wordpress site is running like this with varnish.
-
nginx + varnish can be used only if you proxy varnish to the custom app, like nodejs, tomcat....
if you want to use php then you can use only the option where the last server is nginx or apache.
However, you can also set per domain to use nginx + php-fpm if you have selected nginx/varnish webserver setup.
Oh wait. I can't use Varnish for WordPress?
How to proxy it or something?
You can check our wiki how to use Varnish,
http://wiki.centos-webpanel.com/how-to-install-varnish
-
Why don't you make your life easier by switching to Nginx & Varnish & Apache and then assign "Nginx -> php-fpm" to those sites you insist on having it "nginx - php-fpm"?
Basically, make your wordpress run with Nginx - Varnish - Apache.
Varnish needs to be manually enabled by re-selecting this webserver configuration through the WebServer Domain Conf.
There you can choose a varnish template made for wordpress.
My wordpress site is running like this with varnish.
I tried to make my life easier too. However, I prefer to avoid Apache because it is completely unstable. I have seen the performance of nginx and it seems that completely utilizing nginx is the way to go...
-
nginx + varnish can be used only if you proxy varnish to the custom app, like nodejs, tomcat....
if you want to use php then you can use only the option where the last server is nginx or apache.
However, you can also set per domain to use nginx + php-fpm if you have selected nginx/varnish webserver setup.
Oh wait. I can't use Varnish for WordPress?
How to proxy it or something?
You can check our wiki how to use Varnish,
http://wiki.centos-webpanel.com/how-to-install-varnish
Thanks for this!