<?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>浮山狼de博客 &#187; webserver</title>
	<atom:link href="https://www.fushanlang.com/category/programming-skill/webserver/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.fushanlang.com</link>
	<description>next station - 下一站，活在当下，且行且思</description>
	<lastBuildDate>Sat, 29 Nov 2014 15:14:11 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.2.5</generator>
	<item>
		<title>vps推荐之DigitalOcean</title>
		<link>https://www.fushanlang.com/vps-recommended-digitalocean-2349/</link>
		<comments>https://www.fushanlang.com/vps-recommended-digitalocean-2349/#comments</comments>
		<pubDate>Tue, 14 Jan 2014 16:36:42 +0000</pubDate>
		<dc:creator><![CDATA[fushanlang]]></dc:creator>
				<category><![CDATA[colud]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[webserver]]></category>
		<category><![CDATA[虚拟主机]]></category>
		<category><![CDATA[digitalocean]]></category>
		<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://www.fushanlang.com/blog/?p=2349</guid>
		<description><![CDATA[<p>作为一个爱折腾的网站”程序猿“，我用过多家vps，由于一般支持paypal 月付， 所以基本上都会用两三个月，不行就换另一家。</p> <p>1.Yard VPS</p> <p>台湾人开的，有中文支持，貌似也支持支付宝付款，偶尔会有7折，5折，甚至4折的优惠码，这个用过xen plan 768MB的一款vps，后来由于晚上的时候，网站速度慢，所以就没坚持继续使用，换了另外一家PhotonVPS ，后来才知道原来是一家的囧。</p> <p>2.BudgetVM</p> <p>这家也还好，openvz的vps 流量限制挺高都超过1T，3T的，xen plan 也很实惠，机房选的是洛杉矶，速度还可以当时用过时间最长的是xen vps plan 是10刀/月。</p> <p>3.Virpus</p> <p>找便宜性价比较高的vps是找到这个，当时用是9.5刀/月的 plan,流量1T，现在各大vps都在比流量限制，所以Virpus的流量限制也像BudgetVM一样 提高到3T了。</p> <p>4.SemoWeb</p> <p>是个老主机商（跟最近这两年雨后春笋般的新主机商比），卖的vps plan很便宜但是用过了才知道，一分钱一分货，如果手头紧，想拿vps练练手还是可以试用一下的。</p> <p>5.WeLoveServers</p> <p>这家vps打折打得很凶，在赵荣vps推荐里有很多打折信息，入手了一个openvz的，但是选的德州机房，做外贸站的可以考虑。</p> <p>6.Linode</p> <p>如果想省心再省心，但是别想着省钱，Linode绝对是最佳选择，尤其是为了适应新的vps提供商竞争，linode 升级了自己的vps plan之后。</p> <p>7.DigitalOcean</p> <p>lucky 7! 用过了这么多vps，终于等到了DigitalOcean，终于不想用再试了。目前已用半年了，操作模式跟普通VPS不太相同，用过Amazon Ec2的同学都会知道，它是按需收费的，它的直接竞争对手是伟大的amazon ec2.</p> <p>一个1G 内存30G SSD硬盘 双核CPU的 droplet（digitalocean 创建的节点称之为droplet 水滴）一个小时是0.7美分，你没看错就是这么便宜。</p> <p>又一次调试一个第三方功能，公司没测试主机了，我临时创建了一个droplet，搞了2个多小时测试完毕，账单时1.5美分，最有趣的是，DigitalOcean 竟然运行你的billing 余额是负数， 这也就意味着你可以先用再付钱， oh my god，就像水电煤气费一样，真的与前面几家预付费的vps很大不同。</p> <p>有兴趣的同学可以尝试一下。</p> <span style="color:#777"> . . . &#8594; Read More: <a href="https://www.fushanlang.com/vps-recommended-digitalocean-2349/">vps推荐之DigitalOcean</a></span>]]></description>
				<content:encoded><![CDATA[<p>作为一个爱折腾的网站”程序猿“，我用过多家vps，由于一般支持paypal 月付， 所以基本上都会用两三个月，不行就换另一家。</p>
<p>1.<a href="http://www.yardvps.com/billing/aff.php?aff=2239" target="_blank">Yard VPS</a></p>
<p>台湾人开的，有中文支持，貌似也支持支付宝付款，偶尔会有7折，5折，甚至4折的优惠码，这个用过xen plan 768MB的一款vps，后来由于晚上的时候，网站速度慢，所以就没坚持继续使用，换了另外一家<a href="http://www.photonvps.com/billing/aff.php?aff=3656" target="_blank">PhotonVPS </a>，后来才知道原来是一家的囧。</p>
<p>2.<a href="https://www.budgetvm.com/account/aff.php?aff=251" target="_blank">BudgetVM</a></p>
<p>这家也还好，openvz的vps 流量限制挺高都超过1T，3T的，xen plan 也很实惠，机房选的是洛杉矶，速度还可以当时用过时间最长的是xen vps plan 是10刀/月。</p>
<p>3.<a href="http://myvirpus.com/aff.php?aff=1690" target="_blank">Virpus</a></p>
<p>找便宜性价比较高的vps是找到这个，当时用是9.5刀/月的 plan,流量1T，现在各大vps都在比流量限制，所以<a href="http://myvirpus.com/aff.php?aff=1690" target="_blank">Virpus</a>的流量限制也像<a href="https://www.budgetvm.com/account/aff.php?aff=251" target="_blank">BudgetVM</a>一样 提高到3T了。</p>
<p>4.<a href="http://www.semoweb.com/billing/aff.php?aff=389" target="_blank">SemoWeb</a></p>
<p>是个老主机商（跟最近这两年雨后春笋般的新主机商比），卖的vps plan很便宜但是用过了才知道，一分钱一分货，如果手头紧，想拿vps练练手还是可以试用一下的。</p>
<p>5.<a href="http://core.weloveservers.net/aff.php?aff=293" target="_blank">WeLoveServers</a></p>
<p>这家vps打折打得很凶，在赵荣vps推荐里有很多打折信息，入手了一个openvz的，但是选的德州机房，做外贸站的可以考虑。</p>
<p>6.<a href="https://www.linode.com/?r=45a535f84ed2429b6d9c867a8be9e79a3b4a4542" target="_blank">Linode</a></p>
<p>如果想省心再省心，但是别想着省钱，<a href="https://www.linode.com/?r=45a535f84ed2429b6d9c867a8be9e79a3b4a4542" target="_blank">Linode</a>绝对是最佳选择，尤其是为了适应新的vps提供商竞争，linode 升级了自己的vps plan之后。</p>
<p>7.<a href="https://www.digitalocean.com/?refcode=a55d9e682c3a" target="_blank">DigitalOcean</a></p>
<p>lucky 7! 用过了这么多vps，终于等到了<a href="https://www.digitalocean.com/?refcode=a55d9e682c3a" target="_blank">DigitalOcean</a>，终于不想用再试了。目前已用半年了，操作模式跟普通VPS不太相同，用过Amazon Ec2的同学都会知道，它是按需收费的，它的直接竞争对手是伟大的amazon ec2.</p>
<p>一个1G 内存30G SSD硬盘 双核CPU的 droplet（digitalocean 创建的节点称之为droplet 水滴）一个小时是0.7美分，你没看错就是这么便宜。</p>
<p>又一次调试一个第三方功能，公司没测试主机了，我临时创建了一个droplet，搞了2个多小时测试完毕，账单时1.5美分，最有趣的是，<a href="https://www.digitalocean.com/?refcode=a55d9e682c3a" target="_blank">DigitalOcean </a>竟然运行你的billing 余额是负数， 这也就意味着你可以先用再付钱， oh my god，就像水电煤气费一样，真的与前面几家预付费的vps很大不同。</p>
<p>有兴趣的同学可以尝试一下。</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>https://www.fushanlang.com/vps-recommended-digitalocean-2349/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>varnish 400 503错误的原因及解决方法(转)</title>
		<link>https://www.fushanlang.com/arnish-400-503-cuo-wu-di-yuan-yin-ji-jie-jue-fang-fa-zhuan-2226/</link>
		<comments>https://www.fushanlang.com/arnish-400-503-cuo-wu-di-yuan-yin-ji-jie-jue-fang-fa-zhuan-2226/#comments</comments>
		<pubDate>Tue, 04 Sep 2012 07:39:11 +0000</pubDate>
		<dc:creator><![CDATA[fushanlang]]></dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[webserver]]></category>
		<category><![CDATA[杂类]]></category>
		<category><![CDATA[varnish]]></category>

		<guid isPermaLink="false">http://www.fushanlang.com/blog/?p=2226</guid>
		<description><![CDATA[<p>varnish运行中频繁出现400，503错误</p> <p>400错误出现，是因为varnish认为客户端请求header行数及长度过大，其默认最大接受的请求header行数为64，最大长度（所有请求header行长度之和）为2048，解决这个问题比较简单，在varnish启动参数中加入：</p> <p>-p http_max_hdr=256</p> <p>-p http_req_hdr_len=8192</p> <p>再重启varnish, 即可解决其400错误</p> <p>503错误，这是因为varnish对后端服务器响应header有限制，默认长度是2048，可将其调大一些</p> <p>-p http_resp_hdr_len=8192</p> <p>再重启之，即可解决这个问题.</p> <p>转自:http://zhangxugg-163-com.iteye.com/blog/1153267</p> ]]></description>
				<content:encoded><![CDATA[<p>varnish运行中频繁出现400，503错误</p>
<p>400错误出现，是因为varnish认为客户端请求header行数及长度过大，其默认最大接受的请求header行数为64，最大长度（所有请求header行长度之和）为2048，解决这个问题比较简单，在varnish启动参数中加入：</p>
<p>-p http_max_hdr=256</p>
<p>-p http_req_hdr_len=8192</p>
<p>再重启varnish, 即可解决其400错误</p>
<p>503错误，这是因为varnish对后端服务器响应header有限制，默认长度是2048，可将其调大一些</p>
<p>-p http_resp_hdr_len=8192</p>
<p>再重启之，即可解决这个问题.</p>
<p>转自:http://zhangxugg-163-com.iteye.com/blog/1153267</p>
]]></content:encoded>
			<wfw:commentRss>https://www.fushanlang.com/arnish-400-503-cuo-wu-di-yuan-yin-ji-jie-jue-fang-fa-zhuan-2226/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>centos6+lighttpd+php-cgi</title>
		<link>https://www.fushanlang.com/centos6lighttpdphp-cgi-2224/</link>
		<comments>https://www.fushanlang.com/centos6lighttpdphp-cgi-2224/#comments</comments>
		<pubDate>Tue, 04 Sep 2012 07:38:13 +0000</pubDate>
		<dc:creator><![CDATA[fushanlang]]></dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[webserver]]></category>
		<category><![CDATA[杂类]]></category>
		<category><![CDATA[lamp]]></category>

		<guid isPermaLink="false">http://www.fushanlang.com/blog/?p=2224</guid>
		<description><![CDATA[1. lighttpd <p>由于CentOS官方的源中没有Lighttpd包，因此需要手动导入RPMforge源。 请根据自己系统的情况选择如下32/64位、CentOS 5/CentOS 6操作系统的源并安装好，具体请浏览 http://pkgs.repoforge.org/rpmforge-release/ 选择合适的rpm安装包。</p> # wget -c http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm # rpm -ivh rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm  2.lighttpd-fastcgi #yum install lighttpd-fastcgi php-cli #chkconfig --levels 235 lighttpd on //start on boot. 4、配置Lighttpd与PHP5 <p>将Lighttpd配置为fastCGI模式，只需要修改三个配置文件，并且比较简单。</p> <p>1、打开 /etc/php.ini 文件</p> <p>&#160;</p> 1 vi /etc/php.ini <p>在php.ini文件最后加如下一行语句并保存：</p> <p>cgi.fix_pathinfo = 1</p> <p>2、打开 /etc/lighttpd/modules.conf 文件：</p> <p>&#160;</p> 1 vi /etc/lighttpd/modules.conf <p>将 include “conf.d/fastcgi.conf” 一行取消注释并保存，如下图：</p> <p></p> <p>3、打开/etc/lighttpd/conf.d/fastcgi.conf 文件：</p> <p>&#160;</p> 1 <span style="color:#777"> . . . &#8594; Read More: <a href="https://www.fushanlang.com/centos6lighttpdphp-cgi-2224/">centos6+lighttpd+php-cgi</a></span>]]></description>
				<content:encoded><![CDATA[<h2>1. lighttpd</h2>
<p>由于CentOS官方的源中没有Lighttpd包，因此需要手动导入RPMforge源。<br />
请根据自己系统的情况选择如下32/64位、CentOS 5/CentOS 6操作系统的源并安装好，具体请浏览 http://pkgs.repoforge.org/rpmforge-release/ 选择合适的rpm安装包。</p>
<pre># wget -c http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
# rpm -ivh rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm</pre>
<h2> 2.lighttpd-fastcgi</h2>
<pre>#yum install lighttpd-fastcgi php-cli
#chkconfig --levels 235 lighttpd on   //start on boot.</pre>
<h4>4、配置Lighttpd与PHP5</h4>
<p>将Lighttpd配置为fastCGI模式，只需要修改三个配置文件，并且比较简单。</p>
<p>1、打开 /etc/php.ini 文件</p>
<p>&nbsp;</p>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>vi /etc/php.ini</code></td>
</tr>
</tbody>
</table>
<p>在php.ini文件最后加如下一行语句并保存：</p>
<blockquote><p>cgi.fix_pathinfo = 1</p></blockquote>
<p>2、打开 /etc/lighttpd/modules.conf 文件：</p>
<p>&nbsp;</p>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>vi /etc/lighttpd/modules.conf</code></td>
</tr>
</tbody>
</table>
<p>将 include “conf.d/fastcgi.conf” 一行取消注释并保存，如下图：</p>
<p><a href="http://www.kuqin.com/upimg/allimg/120815/093Q06218-1.png"><img title="lighttpd-fastcgi" src="http://www.kuqin.com/upimg/allimg/120815/093Q06218-1.png" alt="" width="370" height="236" /></a></p>
<p>3、打开/etc/lighttpd/conf.d/fastcgi.conf 文件：</p>
<p>&nbsp;</p>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>vi/etc/lighttpd/conf.d/fastcgi.conf</code></td>
</tr>
</tbody>
</table>
<p>找到 fastcgi.server这一节配置段，并将其全部反注释（使之生效），并修改为如下（注意红色为修改部分）：</p>
<blockquote><p>fastcgi.server = ( “.php” =&gt;<br />
( “php-local” =&gt;<br />
(<br />
“socket” =&gt; “/tmp/php-fastcgi-1.socket“,<br />
“bin-path” =&gt; “/usr/bin/php-cgi“,<br />
“max-procs” =&gt; 1,<br />
“broken-scriptfilename” =&gt; “enable”,<br />
)<br />
),<br />
( “php-tcp” =&gt;<br />
(<br />
“host” =&gt; “127.0.0.1″,<br />
“port” =&gt; 9999,<br />
“check-local” =&gt; “disable”,<br />
“broken-scriptfilename” =&gt; “enable”,<br />
)<br />
),</p>
<p>( “php-num-procs” =&gt;<br />
(<br />
“socket” =&gt; “/tmp/php-fastcgi-2.socket“,<br />
“bin-path” =&gt; “/usr/bin/php-cgi“,<br />
“bin-environment” =&gt; (<br />
“PHP_FCGI_CHILDREN” =&gt; “16″,<br />
“PHP_FCGI_MAX_REQUESTS” =&gt; “10000″,<br />
),<br />
“max-procs” =&gt; 5,<br />
“broken-scriptfilename” =&gt; “enable”,<br />
)<br />
),<br />
)</p></blockquote>
<p>最后保存即可。</p>
<p>现在可以重启Lighttpd使之生效：</p>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>[root@www ~]</code><code># /etc/init.d/lighttpd restart </code></td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>https://www.fushanlang.com/centos6lighttpdphp-cgi-2224/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Amazon mount s3 to Ec2 with s3fs</title>
		<link>https://www.fushanlang.com/amazon-mount-s3-to-ec2-with-s3fs-2190/</link>
		<comments>https://www.fushanlang.com/amazon-mount-s3-to-ec2-with-s3fs-2190/#comments</comments>
		<pubDate>Wed, 18 Jul 2012 04:22:41 +0000</pubDate>
		<dc:creator><![CDATA[fushanlang]]></dc:creator>
				<category><![CDATA[amazon]]></category>
		<category><![CDATA[colud]]></category>
		<category><![CDATA[webserver]]></category>
		<category><![CDATA[amazon ec2]]></category>
		<category><![CDATA[amazon s3]]></category>

		<guid isPermaLink="false">http://www.fushanlang.com/blog/?p=2190</guid>
		<description><![CDATA[<p>理论上，S3 是一个全球存储区域网络 (SAN)，它表现为一个超大的硬盘，您可以在其中存储和检索数字资产。但是，从技术上讲，Amazon 的架构有一些不同。您通过 S3 存储和检索的资产被称为对象。对象存储在存储段（bucket）中。您可以用硬盘进行类比：对象就像是文件，存储段就像是文件夹（或目录）。与硬盘一样，对象和存储段也可以通过统一资源标识符（Uniform Resource Identifier，URI）查找。(http://aws.amazon.com/s3)</p> <p>创建S3，登录到 https://console.aws.amazon.com/s3/home，点击“create bucket”，可以创建一个s3硬盘。</p> <p>安装包：</p> /*Download: http://s3fs.googlecode.com/files/s3fs-1.61.tar.gz Download SHA1 checksum: 8f6561ce00b41c667b738595fdb7b42196c5eee6 Download size: 154904 */ wget http://s3fs.googlecode.com/files/s3fs-1.61.tar.gz tar xvzf s3fs-1.61.tar.gz cd s3fs-1.61/ sudo ./configure --prefix=/usr sudo make sudo make install <p>Install prerequisites before compiling:</p> <p>在编译之前，有些辅助库需要安装，ubuntu系统需要确认安装以下软件包： Install prerequisites before compiling:</p> apt-get install gcc apt-get install build-essential apt-get install <span style="color:#777"> . . . &#8594; Read More: <a href="https://www.fushanlang.com/amazon-mount-s3-to-ec2-with-s3fs-2190/">Amazon mount s3 to Ec2 with s3fs</a></span>]]></description>
				<content:encoded><![CDATA[<p>理论上，S3 是一个全球存储区域网络 (SAN)，它表现为一个超大的硬盘，您可以在其中存储和检索数字资产。但是，从技术上讲，Amazon 的架构有一些不同。您通过 S3 存储和检索的资产被称为对象。对象存储在存储段（bucket）中。您可以用硬盘进行类比：对象就像是文件，存储段就像是文件夹（或目录）。与硬盘一样，对象和存储段也可以通过统一资源标识符（Uniform Resource Identifier，URI）查找。(<a href="http://aws.amazon.com/s3">http://aws.amazon.com/s3</a>)</p>
<p><strong>创建S3</strong>，登录到 https://console.aws.amazon.com/s3/home，点击“create bucket”，可以创建一个s3硬盘。</p>
<p>安装包：</p>
<pre class="javascript" name="code">
/*Download: http://s3fs.googlecode.com/files/s3fs-1.61.tar.gz
Download SHA1 checksum: 8f6561ce00b41c667b738595fdb7b42196c5eee6
Download size: 154904
*/
wget http://s3fs.googlecode.com/files/s3fs-1.61.tar.gz
tar xvzf s3fs-1.61.tar.gz
cd s3fs-1.61/
sudo ./configure --prefix=/usr
sudo make
sudo make install</pre>
<p>Install prerequisites before compiling:</p>
<p>在编译之前，有些辅助库需要安装，ubuntu系统需要确认安装以下软件包：<br />
Install prerequisites before compiling:</p>
<pre class="javascript" name="code">
    apt-get install gcc
    apt-get install build-essential
    apt-get install libfuse-dev
    apt-get install fuse-utils
    apt-get install libcurl4-openssl-dev
    apt-get install libxml2-dev
    apt-get install mime-support 
</pre>
<p>Fedora / CentOS系统需要安装以下软件包:</p>
<pre class="javascript" name="code">
    yum install gcc
    yum install libstdc++-devel
    yum install gcc-c++
    yum install fuse
    yum install fuse-devel
    yum install curl-devel
    yum install libxml2-devel
    yum install openssl-devel
    yum install mailcap 
</pre>
<p>s3fs的编译需要fuse版本在2.8.4以上，如果系统默认安装的fuse版本低于2.8.4,则需要另外编译安装fuse2.8.4.<br />
找到两个source fuse的安装包地址。</p>
<pre class="javascript" name="code">
$ sudo wget https://launchpad.net/ubuntu/+archive/primary/+files/fuse_2.8.4.orig.tar.gz  (source 1)
$ sudo wget http://sourceforge.net/projects/fuse/files/fuse-2.X/2.8.4/fuse-2.8.4.tar.gz/download (source 2)
$ cd fuse-2.8.4/
$ tar xzf fuse_2.8.4.orig.tar.gz 
$ sudo ./configure 
$ sudo make
$ sudo make install
$ sudo export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/lib64/pkgconfig/
$ sudo   ldconfig
$ sudo   modprobe fuse
$ sudo   pkg-config --modversion fuse (confirm that 2.8.4 is the version displayed)
  
</pre>
<p>一切准备好之后，再回到s3fs-1.61目录继续：</p>
<pre class="javascript" name="code">
cd s3fs-1.61/
sudo ./configure --prefix=/usr
sudo make
sudo make install
</pre>
<p>之后输入命令s3fs 有option提示说明s3fs安装成功。</p>
<p>如何使用s3fs mount s3?</p>
<pre class="javascript" name="code">
$ sudo vim /etc/passwd-s3fs
</pre>
<p>输入[accessKeyId]:[secretAccessKey]键值对,访问<a href="https://portal.aws.amazon.com/gp/aws/securityCredentials">Amazon securityCredentials</a>里面有.</p>
<pre class="javascript" name="code">
sudo chmod 640 /etc/passwd-s3fs
sudo mkdir  /mnt/s3
sudo s3fs [your-s3-bucket-name] /mnt/s3 -ouse_cache=/tmp -o allow_other
</pre>
<p>以上可以将s3 mount到ec2上的/mnt/里面， 如果卸掉可以用umount：</p>
<pre class="javascript" name="code">
sudo umount /mnt/s3
</pre>
<p>from<br />
<blockquote>http://code.google.com/p/s3fs/wiki/InstallationNotes</p></blockquote>
<blockquote><p>http://www.redmine.org/projects/redmine/wiki/HowToInstallRedmineOnUbuntuServer</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>https://www.fushanlang.com/amazon-mount-s3-to-ec2-with-s3fs-2190/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>linux-SYN-netstat TIME_WAIT</title>
		<link>https://www.fushanlang.com/linux-syn-the-netstat-the-time_wait-2127/</link>
		<comments>https://www.fushanlang.com/linux-syn-the-netstat-the-time_wait-2127/#comments</comments>
		<pubDate>Wed, 06 Jun 2012 07:44:59 +0000</pubDate>
		<dc:creator><![CDATA[fushanlang]]></dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[webserver]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[liunx]]></category>
		<category><![CDATA[SYN flood]]></category>

		<guid isPermaLink="false">http://www.fushanlang.com/blog/?p=2127</guid>
		<description><![CDATA[Linux Web服务器连接数控制 <p>平时检测网站服务器连接数情况，常用的如  netstat -ant &#124;awk &#8216;{print $6}&#8217;&#124;sort&#124;uniq -c &#124;sort -n  给出如下统计</p> TIME_WAIT 3699 CLOSE_WAIT 52 FIN_WAIT1 32 SYN_SENT 1 FIN_WAIT2 2 ESTABLISHED 17 SYN_RECV 45 CLOSING 6 <p>有时会发现大量的TIME_WAIT，SYN_RECV,  CLOSE_WAIT  ,  FIN_WAIT状态，此时需要对系统参数做些调整：</p> vi /etc/sysctl net.ipv4.tcp_tw_reuse = 1 net.ipv4.tcp_tw_recycle = 1 net.ipv4.tcp_keepalive_time = 1000 net.ipv4.tcp_fin_timeout = 30 net.ipv4.tcp_window_scaling = 0 net.ipv4.tcp_sack = 0 net.ipv4.tcp_max_syn_backlog = <span style="color:#777"> . . . &#8594; Read More: <a href="https://www.fushanlang.com/linux-syn-the-netstat-the-time_wait-2127/">linux-SYN-netstat TIME_WAIT</a></span>]]></description>
				<content:encoded><![CDATA[<h2>Linux Web服务器连接数控制</h2>
<p>平时检测网站服务器连接数情况，常用的如  <strong>netstat -ant |awk &#8216;{print $6}&#8217;|sort|uniq -c |sort -n</strong>  给出如下统计</p>
<pre>
TIME_WAIT 3699
CLOSE_WAIT 52
FIN_WAIT1 32
SYN_SENT 1
FIN_WAIT2 2
ESTABLISHED 17
SYN_RECV 45
CLOSING 6</pre>
<p>有时会发现大量的TIME_WAIT，SYN_RECV,  CLOSE_WAIT  ,  FIN_WAIT状态，此时需要对系统参数做些调整：</p>
<pre>vi /etc/sysctl</pre>
<pre>net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_keepalive_time = 1000
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_window_scaling = 0
net.ipv4.tcp_sack = 0
net.ipv4.tcp_max_syn_backlog = 8192
net.ipv4.tcp_max_tw_buckets = 5000
net.ipv4.ip_local_port_range = 1024 65000
net.core.netdev_max_backlog =8096</pre>
<p>先执行<strong>sysctl -p</strong> 让新设置生效，然后再次执行<strong> netstat -ant |awk &#8216;{print $6}&#8217;|sort|uniq -c |sort -n</strong>  给出如下统计：</p>
<pre>
TIME_WAIT 36
CLOSE_WAIT 52
FIN_WAIT1 32
SYN_SENT 1
FIN_WAIT2 2
ESTABLISHED 2700
SYN_RECV 4
CLOSING 6</pre>
]]></content:encoded>
			<wfw:commentRss>https://www.fushanlang.com/linux-syn-the-netstat-the-time_wait-2127/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.129 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2025-12-17 17:12:06 -->
