502 Error - sudden


#1

lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 14.04 LTS Release: 14.04 Codename: trusty

ee -v EasyEngine v3.7.4 Copyright © 2016 rtCamp Solutions Pvt. Ltd.

ee info NGINX (1.10.0): user www-data worker_processes auto worker_connections 4096 keepalive_timeout 30 fastcgi_read_timeout 300 client_max_body_size 100m allow 127.0.0.1

PHP (5.6.29-1):

user expose_php Off memory_limit 128M post_max_size 100M upload_max_filesize 100M max_execution_time 300

Information about www.conf ping.path /ping pm.status_path /status process_manager ondemand pm.max_requests 500 pm.max_children 100 pm.start_servers 20 pm.min_spare_servers 10 pm.max_spare_servers 30 request_terminate_timeout 300 xdebug.profiler_enable_trigger off listen 127.0.0.1:9000

Information about debug.conf ping.path /ping pm.status_path /status process_manager ondemand pm.max_requests 500 pm.max_children 100 pm.start_servers 20 pm.min_spare_servers 10 pm.max_spare_servers 30 request_terminate_timeout 300 xdebug.profiler_enable_trigger on listen 127.0.0.1:9001 ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)

MySQL (10.1.20-MariaDB) on localhost:

port wait_timeout interactive_timeout max_used_connections datadir socket my.cnf [PATH] /etc/mysql/conf.d/my.cnf

wp --allow-root --info PHP binary: /usr/bin/php5.6 PHP version: 5.6.29-1+deb.sury.org~trusty+1 php.ini used: /etc/php/5.6/cli/php.ini WP-CLI root dir: phar://wp-cli.phar WP-CLI packages dir: WP-CLI global config: WP-CLI project config: WP-CLI version: 0.24.1

I have been using ee for nearly 8 months now and all of a sudden today I started getting 502 gateway error, I tried rebooting quite a few times and restarted php frm, it kept going up and down.


#2

@Mohit_Madan is the server load is too high? (check using top command) or the site is giving 502 even after restarting php-fpm ?

Provide error logs, and configuration for better understanding. (/etc/nginx/sites-available/sitename . & included files)

also provide output of service php5.6-fpm status and service php7.0-fpm status)

if load is high, check the number of connections using following commands. netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | wc -l netstat -lnp | grep :80| wc -l


#3

root@server3:~# netstat -ntu | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | wc -l 23

root@server3:~# netstat -lnp | grep :80| wc -l 2

root@server3:/etc/nginx/sites-available# ls 22222 connectjaipur.com default thetechportal.com

I am losing valuable traffic here, any help would be appreciated. Thanks!


#4

@Mohit_Madan configuration under following files required.

cat /etc/nginx/sites-available/connectjaipur.com cat /etc/nginx/sites-available/thetechportal.com

also provide output of service php5.6-fpm status service php7.0-fpm status


#5

Sorry my bad. Here’s the requested information:

root@server3:~# cat /etc/nginx/sites-available/connectjaipur.com

server {

server_name connectjaipur.com   www.connectjaipur.com;


access_log /var/log/nginx/connectjaipur.com.access.log rt_cache; 
error_log /var/log/nginx/connectjaipur.com.error.log;


root /var/www/connectjaipur.com/htdocs;



index index.php index.html index.htm;


include common/php.conf;      
include common/wpcommon.conf;
include common/locations.conf;
include /var/www/connectjaipur.com/conf/nginx/*.conf;

} root@server3:~# cat /etc/nginx/sites-available/thetechportal.com

server {

server_name thetechportal.com   www.thetechportal.com;


access_log /var/log/nginx/thetechportal.com.access.log rt_cache; 
error_log /var/log/nginx/thetechportal.com.error.log;


root /var/www/thetechportal.com/htdocs;



index index.php index.html index.htm;


include common/php.conf;      
include common/wpcommon.conf;
include common/locations.conf;
include /var/www/thetechportal.com/conf/nginx/*.conf;

location ~ ^/(status|ping)$ { access_log off; allow 127.0.0.1; allow 47.30.61.93; deny all; include fastcgi_params; fastcgi_pass 127.0.0.1:9000; } } root@server3:~# root@server3:~# service php5.6-fpm status php5.6-fpm start/running, process 863 root@server3:~# service php7.0-fpm status php7.0-fpm: unrecognized service root@server3:~#


#6

@Mohit_Madan Above mentioned sites seems to be resolving fine :slight_smile: . I hope the issue is resolved !

For better performance, consider updating to easyengine with php7.

If you have not altered any configuration set by easyengine & if you don’t have any custom nginx configuration, you can use the following command to change php version. ee site update sitename.com --php7

you can check on


#7

Hey

Thanks for the prompt response. thetechportal.com is not working, I have to reboot the server several times and restart php5.6-fpm several times just to get it up for a couple of minutes.

Connectjaipur is working as I have migrated it to a different server.

Any help would be appreciated. :’(


#8

I have tried updating the website to php7 but still getting the 502 error :frowning:


#9

As I mentioned above, for tracking issues, always provide available logs,

tail -50 /var/log/nginx/thetechportal.com.error.log tail -50 /var/log/php/5.6/fpm.log

:frowning: since ee site update sitename.com --php7 failed, you can try changing php version manually.

(make sure you took backup of nginx configurations (under /etc/nginx) )

Also if above command face any issue, you can check on to following thread discussing similar issue.


#10

tail -50 /var/log/nginx/thetechportal.com.error.log 2017/06/21 13:12:46 [error] 803#803: *1918 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.167.114, server: thetechportal.com, request: “GET /news/gaming/feed/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com” 2017/06/21 13:12:47 [error] 803#803: *1920 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.166.71, server: thetechportal.com, request: “GET /2017/05/30/cryptocurrencies-legal-india/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com”, referrer: “https://www.google.co.in/” 2017/06/21 13:12:47 [error] 803#803: *1922 connect() failed (111: Connection refused) while connecting to upstream, client: 108.162.246.5, server: thetechportal.com, request: “GET /2016/09/21/tesla-security-update-patch-bugs/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com” 2017/06/21 13:12:47 [error] 803#803: *1924 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.179.28, server: thetechportal.com, request: “GET /wp-json/oembed/1.0/embed?url=https%3A%2F%2Fthetechportal.com%2F2016%2F11%2F04%2Fsenjo-group-global-hq-singapore%2F&format=xml HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com” 2017/06/21 13:12:47 [error] 803#803: *1926 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.167.114, server: thetechportal.com, request: “GET /futurism/feed HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com” 2017/06/21 13:12:47 [error] 803#803: *1928 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.91.197, server: thetechportal.com, request: “GET /2017/06/17/google-tensorflow-object-detection-api/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com”, referrer: “https://www.google.co.il/” 2017/06/21 13:12:47 [error] 803#803: *1929 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.167.114, server: thetechportal.com, request: “GET /internet/feed/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com” 2017/06/21 13:12:48 [error] 803#803: *1932 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.166.83, server: thetechportal.com, request: “GET /2016/04/15/oyo-rooms-reportedly-started-leasing-hotels-oyo-flagship-brand/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com”, referrer: “https://www.google.co.in/search?q=difference+between+oyo+flagship+and+premium&ie=utf-8&oe=utf-8&gws_rd=cr&ei=j2JKWdS9CsbyvAS5jIPoCA” 2017/06/21 13:12:49 [error] 803#803: *1934 connect() failed (111: Connection refused) while connecting to upstream, client: 141.101.88.148, server: thetechportal.com, request: “GET / HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com” 2017/06/21 13:12:49 [error] 803#803: *1936 connect() failed (111: Connection refused) while connecting to upstream, client: 188.114.110.100, server: thetechportal.com, request: “GET /wp-login.php HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com” 2017/06/21 13:12:49 [error] 803#803: *1938 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.167.114, server: thetechportal.com, request: “GET /news/mobile-apps-news/feed/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com” 2017/06/21 13:12:50 [error] 803#803: *1940 connect() failed (111: Connection refused) while connecting to upstream, client: 188.114.110.100, server: thetechportal.com, request: “GET / HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com” 2017/06/21 13:12:50 [error] 803#803: *1942 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.167.114, server: thetechportal.com, request: “GET /tech-culture-news/feed/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com” 2017/06/21 13:12:52 [error] 801#801: *1944 connect() failed (111: Connection refused) while connecting to upstream, client: 172.68.86.10, server: thetechportal.com, request: “GET /news/it-web-tech/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com” 2017/06/21 13:12:55 [error] 801#801: *1946 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.166.71, server: thetechportal.com, request: “GET /2017/04/12/indian-govt-studies-crypto-currency/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com”, referrer: “https://www.google.co.in/” 2017/06/21 13:12:55 [error] 801#801: *1948 connect() failed (111: Connection refused) while connecting to upstream, client: 108.162.246.5, server: thetechportal.com, request: “GET /tag/flipkart-ceo-email-hacked/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com” 2017/06/21 13:12:56 [error] 801#801: *1950 connect() failed (111: Connection refused) while connecting to upstream, client: 141.101.105.90, server: thetechportal.com, request: “GET /2016/11/11/facebook-fake-news-allegations-crazy/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com” 2017/06/21 13:12:57 [error] 805#805: *1952 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.90.234, server: thetechportal.com, request: “GET /author/jeet/page/80/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com” 2017/06/21 13:12:57 [error] 805#805: *1954 connect() failed (111: Connection refused) while connecting to upstream, client: 172.68.253.71, server: thetechportal.com, request: “GET /wp-json/oembed/1.0/embed?url=https%3A%2F%2Fthetechportal.com%2F2017%2F04%2F15%2Fspacex-hyperloop-pod-competition-2%2F&format=xml HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com” 2017/06/21 13:12:58 [error] 803#803: *1911 connect() failed (111: Connection refused) while connecting to upstream, client: 198.41.238.22, server: thetechportal.com, request: “GET /2017/06/20/apple-health-gorilla-medical-records-iphone-integration/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com”, referrer: “https://thetechportal.com/2017/06/20/apple-health-gorilla-medical-records-iphone-integration/” 2017/06/21 13:12:58 [error] 805#805: *1957 connect() failed (111: Connection refused) while connecting to upstream, client: 172.68.144.79, server: thetechportal.com, request: “GET /2017/06/20/keypr-cloud-hotel-management-series-a1-funding/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com” 2017/06/21 13:13:00 [error] 805#805: *1959 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.62.75, server: thetechportal.com, request: “GET /2017/06/21/infosys-former-head-us-immigration-files-lawsuit/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com” 2017/06/21 13:13:01 [error] 805#805: *1961 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.166.71, server: thetechportal.com, request: “GET /2017/04/12/indian-govt-studies-crypto-currency/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com”, referrer: “https://thetechportal.com/2017/04/12/indian-govt-studies-crypto-currency/” 2017/06/21 13:13:02 [error] 797#797: *1963 connect() failed (111: Connection refused) while connecting to upstream, client: 173.245.50.108, server: thetechportal.com, request: “GET /2016/03/21/godaddy-launches-cloud-servers-cloud-applications-serve-small-businesses/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com”, referrer: “https://thetechportal.com/2016/03/21/godaddy-launches-cloud-servers-cloud-applications-serve-small-businesses/” 2017/06/21 13:13:02 [error] 797#797: *1964 connect() failed (111: Connection refused) while connecting to upstream, client: 173.245.50.108, server: thetechportal.com, request: “GET /2015/04/01/godaddy-raises-460m-in-its-public-trading-debut-shares-rises-up-by-over-30/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com”, referrer: “https://thetechportal.com/2015/04/01/godaddy-raises-460m-in-its-public-trading-debut-shares-rises-up-by-over-30/” 2017/06/21 13:13:03 [error] 797#797: *1967 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.166.125, server: thetechportal.com, request: “GET /feed/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com” 2017/06/21 13:13:05 [error] 797#797: *1969 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.62.75, server: thetechportal.com, request: “GET /2017/06/21/sony-launches-koov-robotics-kit-indiegogo/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com” 2017/06/21 13:13:05 [error] 797#797: *1971 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.106.18, server: thetechportal.com, request: “GET /2017/06/21/tesla-rejigs-autopilot-software-team/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com”, referrer: “https://thetechportal.com/2017/06/21/tesla-rejigs-autopilot-software-team/” 2017/06/21 13:13:06 [error] 797#797: *1973 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.154.133, server: thetechportal.com, request: “GET /2017/05/25/airbnb-teaching-data-science/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com”, referrer: “https://www.google.co.uk/” 2017/06/21 13:13:08 [error] 797#797: *1975 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.179.154, server: thetechportal.com, request: “GET /?p=71351 HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com” 2017/06/21 13:13:08 [error] 797#797: *1976 connect() failed (111: Connection refused) while connecting to upstream, client: 141.101.105.168, server: thetechportal.com, request: “GET /2016/12/02/apple-plans-distribution-center-india/?share=twitter HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com” 2017/06/21 13:13:13 [error] 797#797: *1979 connect() failed (111: Connection refused) while connecting to upstream, client: 173.245.50.108, server: thetechportal.com, request: “GET /2016/06/09/bigrock-introduces-dedicated-linux-windows-servers-india/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com”, referrer: “https://thetechportal.com/2016/06/09/bigrock-introduces-dedicated-linux-windows-servers-india/” 2017/06/21 13:13:17 [error] 797#797: *1981 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.167.114, server: thetechportal.com, request: “GET /news/gaming/feed/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com” 2017/06/21 13:13:18 [error] 797#797: *1983 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.167.114, server: thetechportal.com, request: “GET /internet/feed/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com” 2017/06/21 13:13:18 [error] 797#797: *1985 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.222.58, server: thetechportal.com, request: “GET /category/news/gaming/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com” 2017/06/21 13:13:18 [error] 797#797: *1987 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.179.250, server: thetechportal.com, request: “GET /thetechportal.com/2015/11/11/udacity-raises-a-series-d-105-million-funding-valuation-turns-1-billion/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com” 2017/06/21 13:13:18 [error] 797#797: *1988 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.167.114, server: thetechportal.com, request: “GET /futurism/feed HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com” 2017/06/21 13:13:19 [error] 797#797: *1991 connect() failed (111: Connection refused) while connecting to upstream, client: 173.245.50.108, server: thetechportal.com, request: “GET /2016/12/06/godaddy-acquires-wp-curve/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com”, referrer: “https://thetechportal.com/2016/12/06/godaddy-acquires-wp-curve/” 2017/06/21 13:13:20 [error] 797#797: *1993 connect() failed (111: Connection refused) while connecting to upstream, client: 108.162.246.5, server: thetechportal.com, request: “GET /tag/london-startup/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com” 2017/06/21 13:13:20 [error] 797#797: *1995 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.167.114, server: thetechportal.com, request: “GET /news/mobile-apps-news/feed/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com” 2017/06/21 13:13:20 [error] 797#797: *1997 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.167.114, server: thetechportal.com, request: “GET /tech-culture-news/feed/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com” 2017/06/21 13:13:21 [error] 797#797: *1999 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.62.135, server: thetechportal.com, request: “GET /feed HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com” 2017/06/21 13:13:22 [error] 797#797: *2001 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.106.24, server: thetechportal.com, request: “GET /2014/08/03/after-s5s-ignominious-failure-has-the-s-series-lost-its-charisma/amp/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com” 2017/06/21 13:13:22 [error] 797#797: *2003 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.62.135, server: thetechportal.com, request: “GET /feed HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com” 2017/06/21 13:13:22 [error] 797#797: *2005 connect() failed (111: Connection refused) while connecting to upstream, client: 172.68.143.150, server: thetechportal.com, request: “GET /category/news/business/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com” 2017/06/21 13:13:23 [error] 797#797: *2007 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.62.135, server: thetechportal.com, request: “GET /feed HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com” 2017/06/21 13:13:24 [error] 797#797: *2009 connect() failed (111: Connection refused) while connecting to upstream, client: 108.162.238.71, server: thetechportal.com, request: “GET /2016/08/02/women-job-sheroes-series-a-funding/?share=linkedin HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com” 2017/06/21 13:13:25 [error] 800#800: *2011 connect() failed (111: Connection refused) while connecting to upstream, client: 173.245.50.108, server: thetechportal.com, request: “GET /2016/11/15/google-restricting-adsense-fake-sites/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com”, referrer: “https://thetechportal.com/2016/11/15/google-restricting-adsense-fake-sites/” 2017/06/21 13:13:25 [error] 800#800: *2013 connect() failed (111: Connection refused) while connecting to upstream, client: 172.68.142.5, server: thetechportal.com, request: “GET /news/mobile-apps-news/feed/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com”, referrer: “https://thetechportal.com/news/mobile-apps-news/feed/” 2017/06/21 13:13:25 [error] 800#800: *2015 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.146.52, server: thetechportal.com, request: “GET /tag/crm/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com

Nothing


#11

Any tips? Anyone? :frowning:


#12

@Mohit_Madan

Currently nginx is trying to connect to php7 (127.0.0.1:9070). So check php7-fpm is running on that port using netstat -ntualp |grep :9070

If not start the php7-fpm using service php7.0-fpm start

and check again and confirm whether the php-fpm is running on port 9070.

and make sure your nginx configuration is having the configuration similar to below configuration. ( specifying php7 configuration )

`server {

server_name thetechportal.com www.thetechportal.com;

access_log /var/log/nginx/thetechportal.com.access.log rt_cache; error_log /var/log/nginx/thetechportal.com.error.log;

root /var/www/thetechportal.com/htdocs;

index index.php index.html index.htm;

include common/php7.conf;

include common/wpcommon-php7.conf; include common/locations-php7.conf; include /var/www/thetechportal.com/conf/nginx/*.conf; }`

and check nginx configuration and restart. nginx -t && service nginx restart


#13

This is returning me no result. I have tried service php7.0-fpm start

but it says service is already running.

The configurations are same as you mentioned.


#14

if so, comment out any existing “listen” directive in /etc/php/7.0/fpm/pool.d/www.conf

and add the following line.

listen = 127.0.0.1:9070 and restart php7-fpm using service php7.0-fpm restart


#15

Made the changes, here’s the output now:

netstat -ntualp |grep :9000 root@server3:~# netstat -ntualp |grep :9070 tcp 0 1 43.228.237.43:34479 127.0.0.1:9070 SYN_SENT 703/nginx: worker p tcp 0 1 43.228.237.43:34435 127.0.0.1:9070 SYN_SENT 702/nginx: worker p tcp 0 1 43.228.237.43:34460 127.0.0.1:9070 SYN_SENT 703/nginx: worker p tcp 0 1 43.228.237.43:34449 127.0.0.1:9070 SYN_SENT 703/nginx: worker p tcp 0 1 43.228.237.43:34455 127.0.0.1:9070 SYN_SENT 703/nginx: worker p tcp 0 1 43.228.237.43:34477 127.0.0.1:9070 SYN_SENT 703/nginx: worker p tcp 0 1 43.228.237.43:34484 127.0.0.1:9070 SYN_SENT 703/nginx: worker p tcp 0 1 43.228.237.43:34457 127.0.0.1:9070 SYN_SENT 703/nginx: worker p tcp 0 1 43.228.237.43:34470 127.0.0.1:9070 SYN_SENT 703/nginx: worker p tcp 0 1 43.228.237.43:34469 127.0.0.1:9070 SYN_SENT 703/nginx: worker p tcp 0 1 43.228.237.43:34450 127.0.0.1:9070 SYN_SENT 703/nginx: worker p tcp 0 1 43.228.237.43:34467 127.0.0.1:9070 SYN_SENT 703/nginx: worker p tcp 0 1 43.228.237.43:34480 127.0.0.1:9070 SYN_SENT 703/nginx: worker p tcp 0 1 43.228.237.43:34440 127.0.0.1:9070 SYN_SENT 703/nginx: worker p tcp 0 1 43.228.237.43:34485 127.0.0.1:9070 SYN_SENT 703/nginx: worker p tcp 0 1 43.228.237.43:34473 127.0.0.1:9070 SYN_SENT 703/nginx: worker p tcp 0 1 43.228.237.43:34471 127.0.0.1:9070 SYN_SENT 703/nginx: worker p tcp 0 1 43.228.237.43:34476 127.0.0.1:9070 SYN_SENT 703/nginx: worker p tcp 0 1 43.228.237.43:34474 127.0.0.1:9070 SYN_SENT 703/nginx: worker p tcp 0 1 43.228.237.43:34442 127.0.0.1:9070 SYN_SENT 703/nginx: worker p tcp 0 1 43.228.237.43:34478 127.0.0.1:9070 SYN_SENT 703/nginx: worker p tcp 0 1 43.228.237.43:34445 127.0.0.1:9070 SYN_SENT 703/nginx: worker p tcp 0 1 43.228.237.43:34468 127.0.0.1:9070 SYN_SENT 703/nginx: worker p tcp 0 1 43.228.237.43:34443 127.0.0.1:9070 SYN_SENT 703/nginx: worker p tcp 0 1 43.228.237.43:34441 127.0.0.1:9070 SYN_SENT 703/nginx: worker p tcp 0 1 43.228.237.43:34452 127.0.0.1:9070 SYN_SENT 703/nginx: worker p tcp 0 1 43.228.237.43:34444 127.0.0.1:9070 SYN_SENT 703/nginx: worker p tcp 0 1 43.228.237.43:34463 127.0.0.1:9070 SYN_SENT 703/nginx: worker p tcp 0 1 43.228.237.43:34475 127.0.0.1:9070 SYN_SENT 703/nginx: worker p tcp 0 1 43.228.237.43:34454 127.0.0.1:9070 SYN_SENT 703/nginx: worker p tcp 0 1 43.228.237.43:34472 127.0.0.1:9070 SYN_SENT 703/nginx: worker p tcp 0 1 43.228.237.43:34465 127.0.0.1:9070 SYN_SENT 703/nginx: worker p tcp 0 1 43.228.237.43:34482 127.0.0.1:9070 SYN_SENT 703/nginx: worker p tcp 0 1 43.228.237.43:34438 127.0.0.1:9070 SYN_SENT 703/nginx: worker p tcp 0 1 43.228.237.43:34481 127.0.0.1:9070 SYN_SENT 703/nginx: worker p tcp 0 1 43.228.237.43:34483 127.0.0.1:9070 SYN_SENT 703/nginx: worker p

Getting 504 now :frowning:


#16

Shouldn’t it be 127.0.0.1 instead of the server ip 43.228.237.43?


#17

Here’s the error in the log file:

2017/06/21 19:18:00 [error] 698#698: *1680 upstream timed out (110: Connection timed out) while connecting to upstream, client: 162.158.122.90, server: thetechportal.com, request: “GET /news/page/3/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9070”, host: “thetechportal.com


#18

try changing following parameters in /etc/php/7.0/fpm/php.ini

request_terminate_timeout = 300 max_execution_time = 300

and make sure, /etc/nginx/nginx.conf have fastcgi_read_timeout 300;

also add listen 127.0.0.1:80 under "server { " block of /etc/nginx/sites-available/sitename` and restart nginx and php7-fpm.


#19

@antopjoseph

I did as directed above, but now not listening anything on 9070 and php7.0-fpm stops automatically:

root@server3:~# service nginx restart && service php7.0-fpm restart nginx stop/waiting nginx start/running, process 4253 stop: Unknown instance: php7.0-fpm start/running, process 4276

root@server3:~# service php7.0-fpm status php7.0-fpm stop/waiting root@server3:~# service php7.0-fpm start php7.0-fpm start/running, process 4483 root@server3:~# netstat -ntualp |grep :9070


#20

Here’s what the config file looks like:

server

{

server_name thetechportal.com   www.thetechportal.com;


access_log /var/log/nginx/thetechportal.com.access.log rt_cache;
error_log /var/log/nginx/thetechportal.com.error.log;


root /var/www/thetechportal.com/htdocs;



index index.php index.html index.htm;


include common/php7.conf;  

include common/wpcommon-php7.conf;
include common/locations-php7.conf;
include /var/www/thetechportal.com/conf/nginx/*.conf;

listen 127.0.0.1:80; }