<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Web Server Hacks Blog - Hacks for Dedicated/VPS Servers, SSH, and Plesk &#187; nginx</title>
	<atom:link href="http://webserverhacks.com/tag/nginx/feed/" rel="self" type="application/rss+xml" />
	<link>http://webserverhacks.com</link>
	<description>Hacks for Dedicated/VPS Servers, SSH, and Plesk</description>
	<lastBuildDate>Tue, 01 Nov 2011 23:56:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>How to Install PHP-FPM for Nginx!</title>
		<link>http://webserverhacks.com/web-server-hacks/how-to-install-php-fpm-for-nginx/</link>
		<comments>http://webserverhacks.com/web-server-hacks/how-to-install-php-fpm-for-nginx/#comments</comments>
		<pubDate>Fri, 01 Jul 2011 18:28:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Nginx Hacks]]></category>
		<category><![CDATA[Web Server Hacks]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[install php-fpm]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://webserverhacks.com/?p=138</guid>
		<description><![CDATA[Recently, I&#8217;ve switched some of my web servers that handle large file downloads from spawn-cgi to PHP-FPM.  The result is that I can handle more large files with more PHP-CGI processes while my site still loads well even if there&#8217;s many concurrent downloads going on. I am still experimenting with PHP-FPM but it seems like a pretty good way to go as far as handling the PHP-CGI processes. To do this, you will need to install EPEL &#38; CentALT repositories: rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-3.noarch.rpm rpm -Uvh http://centos.alt.ru/repository/centos/5/x86_64/centalt-release-5-3.noarch.rpm Then do: yum install php-fpm to install php-fpm. Edit the file /etc/php-fpm.conf and my suggested setting changes: &#60;value name=&#8221;user&#8221;&#62;apache&#60;/value&#62; &#60;value name=&#8221;group&#8221;&#62;apache&#60;/value&#62; The max_children is set to 1 as default, set it to something like 50, this really is the cool part about php-fpm. &#60;value name=&#8221;max_children&#8221;&#62;50&#60;/value&#62; &#160; PHP-FPM doesn&#8217;t allow for root user and group so I set it to apache.  You will also need to set your web directories to apache user and group by doing: chown apache:apache /mywebdirectory Start the PHP-FPM by doing: /sbin/service php-fpm start If you get some kind of session errors, simply erase all the session files where the error shows. For CentOS, you can do: chkconfig php-fpm on so it &#8230; <a href="http://webserverhacks.com/web-server-hacks/how-to-install-php-fpm-for-nginx/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Recently, I&#8217;ve switched some of my web servers that handle large file downloads from spawn-cgi to PHP-FPM.  The result is that I can handle more large files with more PHP-CGI processes while my site still loads well even if there&#8217;s many concurrent downloads going on.</p>
<p>I am still experimenting with PHP-FPM but it seems like a pretty good way to go as far as handling the PHP-CGI processes.</p>
<p>To do this, you will need to install EPEL &amp; CentALT repositories:</p>
<p><strong>rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-3.noarch.rpm</strong></p>
<p><strong>rpm -Uvh http://centos.alt.ru/repository/centos/5/x86_64/centalt-release-5-3.noarch.rpm</strong></p>
<p>Then do:</p>
<p><strong>yum install php-fpm </strong></p>
<p>to install php-fpm.</p>
<p>Edit the file <strong>/etc/php-fpm.conf</strong></p>
<p>and my suggested setting changes:</p>
<p><strong>&lt;value name=&#8221;user&#8221;&gt;apache&lt;/value&gt;</strong><br />
<strong>&lt;value name=&#8221;group&#8221;&gt;apache&lt;/value&gt;</strong></p>
<p>The max_children is set to 1 as default, set it to something like 50, this really is the cool part about php-fpm.</p>
<p><strong>&lt;value name=&#8221;max_children&#8221;&gt;50&lt;/value&gt;</strong></p>
<p>&nbsp;</p>
<p>PHP-FPM doesn&#8217;t allow for root user and group so I set it to apache.  You will also need to set your web directories to apache user and group by doing:</p>
<p><strong>chown apache:apache /mywebdirectory</strong></p>
<p>Start the PHP-FPM by doing:</p>
<p><strong>/sbin/service php-fpm start</strong></p>
<p>If you get some kind of session errors, simply erase all the session files where the error shows.</p>
<p>For CentOS, you can do:</p>
<p><strong>chkconfig php-fpm on</strong></p>
<p>so it will start whenever your webserver is rebooted.</p>
<p>If you have been using fastcgi, make sure to do:</p>
<p><strong>chkconfig fastcgi off </strong></p>
<p>so it doesn&#8217;t interfere.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://webserverhacks.com/web-server-hacks/how-to-install-php-fpm-for-nginx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Optimize Large File Downloads on Nginx!</title>
		<link>http://webserverhacks.com/web-server-hacks/how-to-optimize-large-file-downloads-on-nginx/</link>
		<comments>http://webserverhacks.com/web-server-hacks/how-to-optimize-large-file-downloads-on-nginx/#comments</comments>
		<pubDate>Thu, 30 Jun 2011 19:32:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Nginx Hacks]]></category>
		<category><![CDATA[Web Server Hacks]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[large file downloads]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[optimize]]></category>

		<guid isPermaLink="false">http://webserverhacks.com/?p=134</guid>
		<description><![CDATA[For those of you who have large file downloads on your web server, your web server might have trouble loading the faster parts of your website while users hog your bandwidth. I&#8217;ve been researching many ways to optimize large file downloads but probably the best way is to simply rate limit the bandwidth on how fast each user can download. You can add the following line to your HTTP directive in /etc/nginx/nginx.conf: limit_rate 100k This will limit each user to download at maximum of 100kb/second. You can change this number to see which one fits best for your server. You can also add limit_rate_after clause to only limit after a portion of the file has been downloaded: limit_rate_after 1m; limit_rate 100k This will limit downloads only after the first megabyte, potentially not slowing down smaller file downloads and your website.]]></description>
			<content:encoded><![CDATA[<p>For those of you who have large file downloads on your web server, your web server might have trouble loading the faster parts of your website while users hog your bandwidth.</p>
<p>I&#8217;ve been researching many ways to optimize large file downloads but probably the best way is to simply rate limit the bandwidth on how fast each user can download.</p>
<p>You can add the following line to your HTTP directive in /etc/nginx/nginx.conf:</p>
<p><strong>limit_rate 100k</strong></p>
<p>This will limit each user to download at maximum of 100kb/second.</p>
<p>You can change this number to see which one fits best for your server.</p>
<p>You can also add limit_rate_after clause to only limit after a portion of the file has been downloaded:</p>
<p><strong>limit_rate_after 1m;</strong><br />
<strong> limit_rate 100k</strong></p>
<p>This will limit downloads only after the first megabyte, potentially not slowing down smaller file downloads and your website.</p>
]]></content:encoded>
			<wfw:commentRss>http://webserverhacks.com/web-server-hacks/how-to-optimize-large-file-downloads-on-nginx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Fix One PHP-CGI Running!</title>
		<link>http://webserverhacks.com/web-server-hacks/how-to-fix-one-php-cgi-running/</link>
		<comments>http://webserverhacks.com/web-server-hacks/how-to-fix-one-php-cgi-running/#comments</comments>
		<pubDate>Mon, 04 Apr 2011 01:01:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web Server Hacks]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[one php-cgi process]]></category>
		<category><![CDATA[spawn-cgi]]></category>

		<guid isPermaLink="false">http://webserverhacks.com/?p=101</guid>
		<description><![CDATA[The other day I had a problem with one of my newest servers, upon which I had installed new version of Nginx and Spawn-fcgi. Well, my Nginx kept crashing, actually my PHP-cgi processes started crashing after the server ran for a bit. The weird thing was, the server had no load. Upon carefully watching my &#8220;top&#8221; status in linux for awhile, I realized there&#8217;s only one PHP-CGI process running, whereas all my other Nginx web servers ran multiple (around 5-6 at any given time). I compared out the versions of the Spawn-cgi and realized the new Spawn-cgi I had installed only spawned one PHP-CGI process. I decided to install an older version off Lighttpd and it fixed the problem: wget http://www.lighttpd.net/download/lighttpd-1.4.18.tar.bz2 tar -xvjf lighttpd-1.4.18.tar.bz2 cd lighttpd-1.4.18 ./configure make cp src/spawn-fcgi /usr/bin/spawn-fcgi After that restart your PHP-CGI: /sbin/service fastcgi stop /sbin/service fastcgi start Yey, problem solved and now Nginx server runs multiple PHP-CGI processes and no more weird crashes. Sometimes, older programs work better. Perhaps the new Spawn-cgi version has bugs?]]></description>
			<content:encoded><![CDATA[<p>The other day I had a problem with one of my newest servers, upon which I had installed new version of Nginx and Spawn-fcgi.</p>
<p>Well, my Nginx kept crashing, actually my PHP-cgi processes started crashing after the server ran for a bit.  The weird thing was, the server had no load.</p>
<p>Upon carefully watching my &#8220;top&#8221; status in linux for awhile, I realized there&#8217;s only one PHP-CGI process running, whereas all my other Nginx web servers ran multiple (around 5-6 at any given time).</p>
<p>I compared out the versions of the Spawn-cgi and realized the new Spawn-cgi I had installed only spawned one PHP-CGI process.</p>
<p>I decided to install an older version off Lighttpd and it fixed the problem:</p>
<p><strong>wget http://www.lighttpd.net/download/lighttpd-1.4.18.tar.bz2<br /> <br />
tar -xvjf lighttpd-1.4.18.tar.bz2<br /> <br />
cd lighttpd-1.4.18<br /> <br />
./configure<br /> <br />
make<br /> <br />
cp src/spawn-fcgi /usr/bin/spawn-fcgi</strong> </p>
<p>After that restart your PHP-CGI:</p>
<p><strong>/sbin/service fastcgi stop<br /> <br />
/sbin/service fastcgi start</strong> </p>
<p>Yey, problem solved and now Nginx server runs multiple PHP-CGI processes and no more weird crashes.  Sometimes, older programs work better.   Perhaps the new Spawn-cgi version has bugs?</p>
]]></content:encoded>
			<wfw:commentRss>http://webserverhacks.com/web-server-hacks/how-to-fix-one-php-cgi-running/feed/</wfw:commentRss>
		<slash:comments>69</slash:comments>
		</item>
	</channel>
</rss>

