<?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>iCodex&#039;s Blog &#187; VPS</title>
	<atom:link href="http://icodex.org/tag/vps/feed/" rel="self" type="application/rss+xml" />
	<link>http://icodex.org</link>
	<description>诡谲</description>
	<lastBuildDate>Fri, 13 Jan 2012 13:50:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>VPS推荐:Photonvps</title>
		<link>http://icodex.org/2010/04/vps%e6%8e%a8%e8%8d%90-photonvps/</link>
		<comments>http://icodex.org/2010/04/vps%e6%8e%a8%e8%8d%90-photonvps/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 13:08:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[小日子]]></category>
		<category><![CDATA[Photonvps]]></category>
		<category><![CDATA[VPS]]></category>

		<guid isPermaLink="false">http://icodex.org/?p=485</guid>
		<description><![CDATA[推荐Photonvps,不是因为它提供的VPS性能有多好,也不是因为它所提供的VPS价格有多低.是因为它能看到自己的定位并能付诸于行动.网上也能看到投诉photonvps的.有投诉客服服务质量,有投诉网络质量.当然我也投诉过他们的技术敷衍了事.但是扪心自问,photonvps很多过错吗?文化的差异,让客服不能很好的服务中国客户;中国的互联网络复杂,让网络质量下降.我想这些都不能怪photonvps.当出现问题的时候,不应该一昧的指责对方.能解决问题就好. 话说回来,不出现问题当然比出了问题再解决的好.包括服务商在内.谁都不想出现问题.所以试着包容.不要太苛刻了. PS:以上内容属个人意见.仅供参考. Related PostsAPF:Linux下强大的防火墙组件 (8)DOS-Deflate:帮助您有效减轻 DOS 攻击伤害 (12)]]></description>
			<content:encoded><![CDATA[<p>推荐Photonvps,不是因为它提供的VPS性能有多好,也不是因为它所提供的VPS价格有多低.是因为它能看到自己的定位并能付诸于行动.网上也能看到投诉photonvps的.有投诉客服服务质量,有投诉网络质量.当然我也投诉过他们的技术敷衍了事.但是扪心自问,photonvps很多过错吗?文化的差异,让客服不能很好的服务中国客户;中国的互联网络复杂,让网络质量下降.我想这些都不能怪photonvps.当出现问题的时候,不应该一昧的指责对方.能解决问题就好.</p>
<p>话说回来,不出现问题当然比出了问题再解决的好.包括服务商在内.谁都不想出现问题.所以试着包容.不要太苛刻了.</p>
<p>PS:以上内容属个人意见.仅供参考.</p>
<h2  class="related_post_title">Related Posts</h2><ul class="related_post"><li><a href="http://icodex.org/2010/03/powerful-firewall-advanced-policy-firewall-apf/" title="APF:Linux下强大的防火墙组件">APF:Linux下强大的防火墙组件</a> (8)</li><li><a href="http://icodex.org/2010/03/help-you-mitigate-dos-atacks-with-dos-deflate/" title="DOS-Deflate:帮助您有效减轻 DOS 攻击伤害">DOS-Deflate:帮助您有效减轻 DOS 攻击伤害</a> (12)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://icodex.org/2010/04/vps%e6%8e%a8%e8%8d%90-photonvps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>APF:Linux下强大的防火墙组件</title>
		<link>http://icodex.org/2010/03/powerful-firewall-advanced-policy-firewall-apf/</link>
		<comments>http://icodex.org/2010/03/powerful-firewall-advanced-policy-firewall-apf/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 05:37:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[codex]]></category>
		<category><![CDATA[APF]]></category>
		<category><![CDATA[DOS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[VPS]]></category>

		<guid isPermaLink="false">http://icodex.org/?p=137</guid>
		<description><![CDATA[什么是APF？ APF(Advanced Policy Firewall)是 Rf-x Networks 出品的Linux环境下的软件防火墙,被大部分Linux服务器管理员所采用,使用iptables的规则,易于理解及使用.可算是Linux使用较多的防火墙.APF的配置参数众多,有效利用这些配置参数可加强你的服务器安全,APF应该在每一台Linux服务器中得到应用. 安装APF 1.下载最新的安装包并解压缩,APF项目详细信息. #cd /usr/local/src #wget http://www.rfxn.com/downloads/apf-current.tar.gz #tar -zxf apf-current.tar.gz #cd apf-9.7-1/ 2.执行安装 #sh ./install.sh 结束安装好你会得到一些信息: ... Installation Details: Install path:         /etc/apf/ Config path:          /etc/apf/conf.apf Executable path:      /usr/local/sbin/apf ... 3.进行详细配置 #vi /etc/apf/conf.apf 默认的参数适合大多数场合,按照需要进行修改即可 DEVEL_MODE="1" &#62;&#62; DEVEL_MODE="0" RAB="0" &#62;&#62; RAB="1" RAB_PSCAN_LEVEL="2" &#62;&#62; RAB_PSCAN_LEVEL="3" TCR_PASS="1" &#62;&#62; TCR_PASS="0" DLIST_PHP="0" &#62;&#62; DLIST_PHP="1" DLIST_SPAMHAUS="0" [...]]]></description>
			<content:encoded><![CDATA[<h2>什么是APF？</h2>
<p><a href="http://icodex.org/tag/apf/" class="st_tag internal_tag" rel="tag" title="Posts tagged with APF">APF</a>(Advanced Policy Firewall)是 <a href="http://www.rfxn.com/">Rf-x Networks</a> 出品的Linux环境下的软件防火墙,被大部分Linux服务器管理员所采用,使用iptables的规则,易于理解及使用.可算是Linux使用较多的防火墙.APF的配置参数众多,有效利用这些配置参数可加强你的服务器安全,APF应该在每一台Linux服务器中得到应用.<span id="more-137"></span></p>
<h2>安装APF</h2>
<p>1.下载最新的安装包并解压缩,<a href="http://www.rfxn.com/projects/advanced-policy-firewall/">APF项目详细信息</a>.</p>
<blockquote><p><code>#cd /usr/local/src<br />
#wget <a href="http://www.rfxn.com/downloads/apf-current.tar.gz">http://www.rfxn.com/downloads/apf-current.tar.gz</a><a href="http://www.rfxn.com/downloads/apf-current.tar.gz"><strong> </strong></a><br />
#tar -zxf apf-current.tar.gz<br />
#cd apf-9.7-1/</code></p></blockquote>
<p>2.执行安装</p>
<blockquote><p><code>#sh ./install.sh</code></p></blockquote>
<p>结束安装好你会得到一些信息:</p>
<blockquote><p><code>...<br />
Installation Details:<br />
Install path:         /etc/apf/<br />
Config path:          /etc/apf/conf.apf<br />
Executable path:      /usr/local/sbin/apf<br />
...</code></p></blockquote>
<p>3.进行详细配置</p>
<blockquote><p><code>#vi /etc/apf/conf.apf</code></p></blockquote>
<p>默认的参数适合大多数场合,按照需要进行修改即可</p>
<blockquote><p><code>DEVEL_MODE="1" &gt;&gt; DEVEL_MODE="0"<br />
RAB="0" &gt;&gt; RAB="1"<br />
RAB_PSCAN_LEVEL="2" &gt;&gt; RAB_PSCAN_LEVEL="3"<br />
TCR_PASS="1" &gt;&gt; TCR_PASS="0"<br />
DLIST_PHP="0" &gt;&gt; DLIST_PHP="1"<br />
DLIST_SPAMHAUS="0" &gt;&gt; DLIST_SPAMHAUS="1"<br />
DLIST_DSHIELD="0" &gt;&gt; DLIST_DSHIELD="1"<br />
DLIST_RESERVED="0" &gt;&gt; DLIST_RESERVED="1"</code></p></blockquote>
<p>流入端口过滤</p>
<blockquote><p><code># Common ingress (inbound) TCP ports<br />
IG_TCP_CPORTS="20,21,22,25,26,53,80,110,143,443,465,993,995,3306"<br />
# Common ingress (inbound) UDP ports<br />
IG_UDP_CPORTS="21,53,465"</code></p></blockquote>
<p>流出端口过滤,<span style="color: #ff0000;">虚拟主机推荐开启</span></p>
<blockquote><p><code># Outbound (egress) filtering<br />
EGF="1"<br />
# Common outbound (egress) TCP ports<br />
EG_TCP_CPORTS="21,22,25,26,37,43,53,80,110,113,443,465,3306"<br />
# Common outbound (egress) UDP ports<br />
EG_UDP_CPORTS="20,21,53,465"</code></p></blockquote>
<p>ICMP过滤</p>
<blockquote><p><code># Common ICMP outbound (egress) types<br />
# 'internals/icmp.types' for type definition; 'all' is wildcard for any<br />
EG_ICMP_TYPES="all"</code></p></blockquote>
<p>另外还有两个值得注意的设置文件: /etc/apf/allow_hosts.rules 和 /etc/apf/deny_hosts.rules 可设置目标主机的过滤规则.如添加信任主机操作等.</p>
<p>启动APF</p>
<blockquote><p><code>#/usr/local/sbin/apf -s</code></p></blockquote>
<p>重启APF</p>
<blockquote><p><code>#/usr/local/sbin/apf -r</code></p></blockquote>
<p>查看运行日志</p>
<blockquote><p><code>#tail -f /var/log/apf_log</code></p></blockquote>
<p>添加为系统启动</p>
<blockquote><p><code>#vi /etc/rc.local</code></p></blockquote>
<p>在其中添加 "/usr/local/sbin/apf -s" 即可(不含双引号).</p>
<p>详细参数说明</p>
<blockquote>
<pre>usage /usr/local/sbin/apf [OPTION]
-s|--start ......................... load all firewall rules
-r|--restart ....................... stop (flush) &amp; reload firewall rules
-f|--stop........ .................. stop (flush) all firewall rules
-l|--list .......................... list all firewall rules
-t|--status ........................ output firewall status log
-e|--refresh ....................... refresh &amp; resolve dns names in trust rules
-a HOST CMT|--allow HOST COMMENT ... add host (IP/FQDN) to allow_hosts.rules and
 immediately load new rule into firewall
-d HOST CMT|--deny HOST COMMENT .... add host (IP/FQDN) to deny_hosts.rules and
 immediately load new rule into firewall
-u|--remove HOST ................... remove host from [glob]*_hosts.rules
 and immediately remove rule from firewall
-o|--ovars ......................... output all configuration options</pre>
</blockquote>
<p>此外,APF自9.6 (rev:2)版本之后增加了RAB模块.该模块取代了旧版本的antidos模块.可有效减轻拒绝服务攻击带来的影响,但需要iptables的内核模块ipt_recent的支持.如下图我在VPS上启动APF后的屏显,提示RAB模块无法启用.内核模块ipt_recent没有找到.因此建议在内核支持以及iptables模块支持的情况下使用.</p>
<p><a rel="attachment wp-att-145" href="http://icodex.org/2010/03/powerful-firewall-advanced-policy-firewall-apf/apf/"><img class="alignnone size-medium wp-image-145" title="apf" src="http://www.icodex.org/wp-content/uploads/2010/03/apf-400x160.jpg?e97550" alt="" width="400" height="160" /></a></p>
<h3><strong>Faq</strong></h3>
<blockquote><p><strong><span style="color: #ff0000;">Problem</span>:</strong> If you get  this error apf(xxxxx): {glob} unable to load iptables module  (ip_tables), aborting.<br />
<strong><span style="color: #339966;">Solution</span>:</strong> Try  changing SET_MONOKERN=”0″ to SET_MONOKERN=”1″ , then apf -r</p>
<p><strong><span style="color: #ff0000;">Problem</span>:</strong> If you get  this message: apf(xxxxx): {glob} !!DEVELOPMENT MODE ENABLED!! – firewall  will flush every 5 minutes.<br />
<strong><span style="color: #339966;">Solution</span>:</strong> you need  to change DEVEL_MODE=1 to DEVEL_MODE=0, make sure your config is working  first.</p></blockquote>
<p>Via:http://www.securecentos.com/basic-security/install-firewall/</p>
<h2  class="related_post_title">Related Posts</h2><ul class="related_post"><li><a href="http://icodex.org/2010/03/help-you-mitigate-dos-atacks-with-dos-deflate/" title="DOS-Deflate:帮助您有效减轻 DOS 攻击伤害">DOS-Deflate:帮助您有效减轻 DOS 攻击伤害</a> (12)</li><li><a href="http://icodex.org/2010/04/setting-up-pptpd-with-apf/" title="设置pptpd与apf">设置pptpd与apf</a> (0)</li><li><a href="http://icodex.org/2010/04/vps%e6%8e%a8%e8%8d%90-photonvps/" title="VPS推荐:Photonvps">VPS推荐:Photonvps</a> (0)</li><li><a href="http://icodex.org/2010/03/centos%e6%9c%80%e5%b0%8f%e5%8c%96%e5%ae%89%e8%a3%85gnome%e5%92%8cvnc/" title="CentOS最小化安装Gnome和VNC">CentOS最小化安装Gnome和VNC</a> (8)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://icodex.org/2010/03/powerful-firewall-advanced-policy-firewall-apf/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>DOS-Deflate:帮助您有效减轻 DOS 攻击伤害</title>
		<link>http://icodex.org/2010/03/help-you-mitigate-dos-atacks-with-dos-deflate/</link>
		<comments>http://icodex.org/2010/03/help-you-mitigate-dos-atacks-with-dos-deflate/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 03:29:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[codex]]></category>
		<category><![CDATA[APF]]></category>
		<category><![CDATA[DOS]]></category>
		<category><![CDATA[VPS]]></category>

		<guid isPermaLink="false">http://icodex.org/?p=132</guid>
		<description><![CDATA[DOS-Deflate 是由Zaf开发的脚本,最初是在MediaLayer服务器上使用,以协助管理员解决拒绝服务攻击(DOS)问题.如何防范拒绝服务攻击一直是服务器管理员研究的一个课题,尤其是使用VPS(虚拟服务器)的管理员.由于是在虚拟的环境下,既不好要求服务商增加硬件防火墙,又因为本身虚拟的架构导致了一些内核模块(如:connlimit)无法安装.VPS或者服务器要完全防止拒绝服务攻击是不太现实的,依靠某个模块只能减轻攻击产生的影响,并不能真正杜绝攻击.服务器性能及网络频宽决定了防止攻击的实施难易度. 诡谲在这里推荐VPS(vz)管理员使用DOS-Deflate脚本.通过APF添加动态过滤.脚本安装简单,防范攻击的效果也很不错.但是需要注意,安装前需确定Advanced Policy Firewall (APF)已经在你的系统安装并运行良好.否则将不会起到封禁攻击IP的作用. 安装step by step 1.以root用户登录终端. 2.下载安装脚本 #cd /usr/local/src #wget http://www.inetbase.com/scripts/ddos/install.sh 3.安装防护 #sh ./install.sh 安装完成之后.可以在/usr/local/ddos/路径找到配置文件和sh脚本.配置十分简单,你只需编辑/usr/local/ddos/ddos.conf文件. 参数配置示范: ##### Paths of the script and other files PROGDIR="/usr/local/ddos" PROG="/usr/local/ddos/ddos.sh" IGNORE_IP_LIST="/usr/local/ddos/ignore.ip.list"  # 白名单.如有反向代理,注意添加本机地址和本机外网IP地址,防止提供反向代理的主机被判定为攻击. CRON="/etc/cron.d/ddos.cron" APF="/etc/apf/apf" IPT="/sbin/iptables" ##### frequency in minutes for running the script ##### Caution: Every time this setting is changed, run the script [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://icodex.org/tag/dos/" class="st_tag internal_tag" rel="tag" title="Posts tagged with DOS">DOS</a>-Deflate 是由Zaf开发的脚本,最初是在MediaLayer服务器上使用,以协助管理员解决拒绝服务攻击(<a href="http://icodex.org/tag/dos/" class="st_tag internal_tag" rel="tag" title="Posts tagged with DOS">DOS</a>)问题.如何防范拒绝服务攻击一直是服务器管理员研究的一个课题,尤其是使用VPS(虚拟服务器)的管理员.由于是在虚拟的环境下,既不好要求服务商增加硬件防火墙,又因为本身虚拟的架构导致了一些内核模块(如:connlimit)无法安装.VPS或者服务器要完全防止拒绝服务攻击是不太现实的,依靠某个模块只能减轻攻击产生的影响,并不能真正杜绝攻击.服务器性能及网络频宽决定了防止攻击的实施难易度.</p>
<p>诡谲在这里推荐VPS(vz)管理员使用DOS-Deflate脚本.通过APF添加动态过滤.脚本安装简单,防范攻击的效果也很不错.但是需要注意,安装前需确定<a href="http://icodex.org/2010/03/powerful-firewall-advanced-policy-firewall-apf/">Advanced Policy Firewall (APF)</a>已经在你的系统安装并运行良好.否则将不会起到封禁攻击IP的作用.<span id="more-132"></span></p>
<h2>安装step by step</h2>
<p>1.以root用户登录终端.</p>
<p>2.下载安装脚本</p>
<blockquote><p>#cd /usr/local/src<br />
#wget http://www.inetbase.com/scripts/ddos/install.sh</p></blockquote>
<p>3.安装防护</p>
<blockquote><p>#sh ./install.sh</p></blockquote>
<p>安装完成之后.可以在/usr/local/ddos/路径找到配置文件和sh脚本.配置十分简单,你只需编辑/usr/local/ddos/ddos.conf文件.</p>
<p>参数配置示范:</p>
<blockquote><p><code>##### Paths of the script and other files<br />
PROGDIR="/usr/local/ddos"<br />
PROG="/usr/local/ddos/ddos.sh"<br />
IGNORE_IP_LIST="/usr/local/ddos/ignore.ip.list"  # <span style="color: #ff0000;">白名单.如有反向代理,注意添加本机地址和本机外网IP地址,防止提供反向代理的主机被判定为攻击.</span><br />
CRON="/etc/cron.d/ddos.cron"<br />
<a href="http://icodex.org/tag/apf/" class="st_tag internal_tag" rel="tag" title="Posts tagged with APF">APF</a>="/etc/<a href="http://icodex.org/tag/apf/" class="st_tag internal_tag" rel="tag" title="Posts tagged with APF">apf</a>/apf"<br />
IPT="/sbin/iptables"</code></p>
<p><code>##### frequency in minutes for running the script<br />
##### Caution: Every time this setting is changed, run the script with --cron<br />
##### option so that the new frequency takes effect<br />
FREQ=1</code></p>
<p><code>##### How many connections define a bad IP? Indicate that below.  # <span style="color: #ff0000;">单IP发起连接数阀值,不建议设置太低.</span><br />
NO_OF_CONNECTIONS=150</code></p>
<p><code>##### APF_BAN=1 (Make sure your APF version is atleast 0.96)<br />
##### APF_BAN=0 (Uses iptables for banning ips instead of APF)<br />
APF_BAN=1</code></p>
<p><code>##### KILL=0 (Bad IPs are'nt banned, good for interactive execution of script)<br />
##### KILL=1 (Recommended setting)<br />
KILL=1</code></p>
<p><code>##### An email is sent to the following address when an IP is banned.   # <span style="color: #ff0000;">当单IP发起的连接数超过阀值后,将发邮件给指定的收件人.</span><br />
##### Blank would suppress sending of mails<br />
EMAIL_TO="root"</code></p>
<p><code>##### Number of seconds the banned ip should remain in blacklist.   # <span style="color: #ff0000;">设置被挡IP多少秒后移出黑名单.</span><br />
BAN_PERIOD=600<br />
</code></p></blockquote>
<p><span style="color: #ff0000;"><strong>此外还要修改两个地方</strong></span>.</p>
<p>1. 在/usr/local/ddos/ddos.sh的第134行.注释掉这行,前面加'#'号</p>
<blockquote><p><code>#echo $CURR_LINE_IP &gt;&gt; $IGNORE_IP_LIST</code></p></blockquote>
<p>2.在同个文件大概117行处,将netstat -ntu | awk '{print $5}' | cut -d: -f1 |  sort | uniq -c | sort -nr &gt; $BAD_IP_LIST注释掉然后在下面添加 netstat -ntu | awk  '{print $5}' | egrep -o "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}"  | sort | uniq -c | sort -nr &gt; $BAD_IP_LIST</p>
<p>模拟发起dos攻击后,系统管理员将收到邮件,告知过去1分钟禁止了哪些IP和其发起的连接数.</p>
<p><a rel="attachment wp-att-164" href="http://icodex.org/2010/03/help-you-mitigate-dos-atacks-with-dos-deflate/banned-ips/"><img class="alignnone size-medium wp-image-164" title="Banned IPs" src="http://www.icodex.org/wp-content/uploads/2010/03/Banned-IPs-400x134.jpg?e97550" alt="Banned IPs" width="400" height="134" /></a></p>
<h2>卸载</h2>
<p>以root用户登录终端,下载反安装脚本</p>
<blockquote><p><code>#wget http://www.inetbase.com/scripts/ddos/uninstall.ddos<br />
#sh ./uninstall.ddos<br />
</code></p></blockquote>
<h2  class="related_post_title">Related Posts</h2><ul class="related_post"><li><a href="http://icodex.org/2010/03/powerful-firewall-advanced-policy-firewall-apf/" title="APF:Linux下强大的防火墙组件">APF:Linux下强大的防火墙组件</a> (8)</li><li><a href="http://icodex.org/2010/04/setting-up-pptpd-with-apf/" title="设置pptpd与apf">设置pptpd与apf</a> (0)</li><li><a href="http://icodex.org/2010/04/vps%e6%8e%a8%e8%8d%90-photonvps/" title="VPS推荐:Photonvps">VPS推荐:Photonvps</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://icodex.org/2010/03/help-you-mitigate-dos-atacks-with-dos-deflate/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic (Feed is rejected)
Page Caching using disk: enhanced
Database Caching 15/27 queries in 0.027 seconds using disk: basic
Object Caching 583/590 objects using disk: basic
Content Delivery Network via www.icodex.org

Served from: icodex.org @ 2012-02-06 12:35:06 -->
