ERRORS: Multi Sub-Domain Fastcgi_Cache + Conditional Purging


#1

Hi,

I tried following the fastcgi-cache-with-purging tute but after making the changes to the config, the “ee stack [COMMANDS]” fail to function.

I get the following error(s):

Executing service nginx restart, please wait... Unable to execute service nginx restart, exit status = 1

…and if I reboot the server, the site no longer functions:

This webpage is not available

If I revert the “/etc/nginx/sites-available/walkingfish.us” file back to the original state, the site is still unavailable after a reboot :stuck_out_tongue: and if I run a “ee stack [COMMAND]”:

Executing service nginx start, please wait... Executing service php5-fpm start, please wait... Unable to execute service php5-fpm start, exit status = 1

I have been around this several times and with no luck - The only way I can get things back to normal is to reload the server with a ‘snapshot’ from before the config change.

The System is a DigitalOcean Droplet on Ubuntu 64x using your stack configured with “ee site create walkingfish.us --wpsubdom --wpfc”.

The only other add-on to the server at this point is Fail2ban.

Below is the /etc/nginx/sites-available/walkingfish.us I tried using:

# WPSUBDOMAIN FAST CGI NGINX CONFIGURATION  

fastcgi_cache_path /var/run/nginx-cache levels=1:2 keys_zone=WORDPRESS:500m inactive=60m;  
fastcgi_cache_key "$scheme$request_method$host$request_uri";  
fastcgi_cache_use_stale error timeout invalid_header http_500;  

server {  

	server_name walkingfish.us *.walkingfish.us ;  

	access_log   /var/log/nginx/walkingfish.us.access.log;  
	error_log    /var/log/nginx/walkingfish.us.error.log;  

	root /var/www/walkingfish.us/htdocs;  
	index index.php;  

	#fastcgi_cache start  
	set $skip_cache 0;  

	# POST requests and urls with a query string should always go to PHP  
	if ($request_method = POST) {  
		set $skip_cache 1;  
	}     
	if ($query_string != "") {  
		set $skip_cache 1;  
	}     

	# Don't cache uris containing the following segments  
	if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {  
		set $skip_cache 1;  
	}     

	# Don't use the cache for logged in users or recent commenters  
	if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in") {  
		set $skip_cache 1;  
	}  

	location / {  
		try_files $uri $uri/ /index.php?$args;  
	}      

	location ~ .php$ {  
		try_files $uri /index.php;   
		include fastcgi_params;  
		fastcgi_pass unix:/var/run/php5-fpm.sock;  

		fastcgi_cache_bypass $skip_cache;  
	        fastcgi_no_cache $skip_cache;  

		fastcgi_cache WORDPRESS;  
		fastcgi_cache_valid  60m;  
	}  

	location ~ /purge(/.*) {  
	    fastcgi_cache_purge WORDPRESS "$scheme$request_method$host$1";  
	}	  

	location ~* ^.+.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {  
		access_log off;	log_not_found off; expires max;  
	}  

	location = /robots.txt { access_log off; log_not_found off; }  
	location ~ /. { deny  all; access_log off; log_not_found off; }  
}

Any help to what I may have wrong to get this functioning on my server will be appreciated.

Thnx,
Jason


#2

Hello

Please provide us server access so we can debug why your php5-fpm crashed.
Seems like your php configuration is not proper.

cross check this wirh

  
php5-fpm -t  

Send your server login details at Mitesh.Shah@rtcamp.com


#3

Hi,

The PHP configuration was never touched by anyone- It was set by rtCamp’s EasyEngine as stated above. So lets start looking with how EasyEngine installs the stack for WP MultiuSites with Sub-Doman’s and FastCGI…?

Also, there are other ways to debug w/o giving server access to someone I do not know -sorry.

Thnx


#4

Also, are you guys using the same set-up on this site (w/ cache-purge, etc)? I have to refresh anytime I make a comment or post on this site - This is not good UX. It should be automatic.


#5

Hi @jasonalankenned,

I hope your query is resolved if not then please use latest version of EasyEngine (https://github.com/rtCamp/easyengine/releases) which has a number to tweaks.

I am closing this support ticket for now. Feel free to create a new support ticket if you have any queries further. :slight_smile:


#6