New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
502 bad gateway nginx and minstall!
Hello!
I have a Debian vps with minstall installed on it (nginx, php, mysql).
When i did a upgrade on my minstall installation yesterday,
i got the message "502 Bad Gateway" when i visited one of my wordpress websites hosted on the vps using minstall.
Please help me with this error!
Thanks in advance!
Comments
If you are fine with payed help - welcome to private messaging
It's crazy to ask help for every question about Linux at LET. It's not support board. If you want your websites to work, hire sysadmin.
Try
chmod 666 /var/run/php5-fpm.sock
I tried it but i got the following error:
chmod: cannot access
/var/run/php5-fpm.sock': No such file or directory`LET is a community forum used by industry professionals, hobbyists, and complete newbs. People are more than welcome to ask questions about things they're not knowledgeable on - he's not asking for us to move mountains for him.
Give this guy a break, it's his first post.
if you need help, provide more details
tail /var/log/nginx/error.log
What does listen and listen.mode directives look like in
/etc/php5/fpm/pool.d/www.conf
? I'm suspecting of a file permission issue however it can be another thing too, error log would also help.my error.log file in /var/log/nginx/ is empty
There is no www.conf file in the directory: /etc/php5/fpm/pool.d/www.conf.
But is two another .conf filesthere, here is them in full:
johan.conf:
`[johan]
listen = /home/johan/http/private/php.socket
user = johan
group = johan
pm = ondemand
pm.max_children = 4
pm.max_requests = 500
php_flag[expose_php] = off
php_value[max_execution_time] = 120
php_value[memory_limit] = 64M
`
www-data.conf:
[www-data] listen = /dev/shm/php.socket user = www-data group = www-data pm = ondemand pm.max_children = 4 pm.max_requests = 500 php_flag[expose_php] = off php_value[max_execution_time] = 120 php_value[memory_limit] = 64M
Well, then try
chmod 666 /home/johan/http/private/php.socket
andchmod 666 /dev/shm/php.socket
Thanks! that help me out! now everything working and running again!
Incase you have problem in the future after updating the nginx and php, try to change the php pool config for example :
You can also use ports, no permission issues there.
Chmod the socket file will only work until you reboot the server.
Then it will go back to 502 bad gateway again.
The bug reports from nginx suggests another solution, even if its not a correct solution in a multi user environment like minstall or tuxlite provides.
The solution is to change the user and group parameters to nginx or www-data depending on your installation.
Don't forget to restart php and nginx to actually see the changes you made.
This "survives" a reboot.
Another solution is to use ports instead of sockets. However some claim that it is slower then using sockets.
Try add 'listen.mode = 0666' under '[www-data]'
something wrong between php and nginx. check php config
Speed and security penalty.
Thanks! i will try it!