<?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>icez network &#187; ip</title>
	<atom:link href="http://www.icez.net/blog/tags/ip/feed" rel="self" type="application/rss+xml" />
	<link>http://www.icez.net/blog</link>
	<description>Technical Blog by icez network</description>
	<lastBuildDate>Mon, 30 Jan 2012 17:31:37 +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>0064 &#124; แก้ปัญหา IP ใน log apache ไม่ตรง</title>
		<link>http://www.icez.net/blog/131/%e0%b9%81%e0%b8%81%e0%b9%89%e0%b8%9b%e0%b8%b1%e0%b8%8d%e0%b8%ab%e0%b8%b2-ip-%e0%b9%83%e0%b8%99-log-apache-%e0%b9%84%e0%b8%a1%e0%b9%88%e0%b8%95%e0%b8%a3%e0%b8%87</link>
		<comments>http://www.icez.net/blog/131/%e0%b9%81%e0%b8%81%e0%b9%89%e0%b8%9b%e0%b8%b1%e0%b8%8d%e0%b8%ab%e0%b8%b2-ip-%e0%b9%83%e0%b8%99-log-apache-%e0%b9%84%e0%b8%a1%e0%b9%88%e0%b8%95%e0%b8%a3%e0%b8%87#comments</comments>
		<pubDate>Fri, 19 Jun 2009 04:17:44 +0000</pubDate>
		<dc:creator>icez</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Web Server]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[ip]]></category>
		<category><![CDATA[squid]]></category>

		<guid isPermaLink="false">http://www.icez.net/blog/?p=131</guid>
		<description><![CDATA[ที่มา: การติดตั้ง mod_rpaf &#8211; reverse proxy add forward รายละเอียดตามไปดูในที่มาละกันเนาะ ขี้เกียจพิมพ์ซ้ำ เอาวิธีก๊อปวางบ้านๆ ของเราดีกว่า wget http://stderr.net/apache/rpaf/download/mod_rpaf-0.6.tar.gz tar -xvzf mod_rpaf-0.6.tar.gz cd mod_rpaf-0.6 apxs -i -c -n mod_rpaf-2.0.so mod_rpaf-2.0.c เปิดไฟล์ config apache (แนะนำให้ใส่ใน /etc/httpd/conf.d/mod_rpaf.conf) แก้ตัวแดงๆ ให้ตรงกับเครื่องคุณเองด้วยนะครับ - อันบนเอาบรรทัดสุดท้ายจากคำสั่ง apxs มา - อันล่างเอาเป็น ip ของเครื่อง squid LoadModule rpaf_module /usr/lib64/httpd/modules/mod_rpaf-2.0.so RPAFenable On RPAFsethostname Off RPAFproxy_ips 127.0.0.1 RPAFheader X-Forwarded-For ถ้าใช้ตัวนี้ ก็เอา ipfix.php [...]]]></description>
			<content:encoded><![CDATA[<p>ที่มา: <a href="http://toey.tc20.net/2009/05/25/%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B8%95%E0%B8%B4%E0%B8%94%E0%B8%95%E0%B8%B1%E0%B9%89%E0%B8%87-mod_rpaf-reverse-proxy-add-forward/" target="_blank">การติดตั้ง mod_rpaf &#8211; reverse proxy add forward</a></p>
<p>รายละเอียดตามไปดูในที่มาละกันเนาะ ขี้เกียจพิมพ์ซ้ำ<br />
เอาวิธีก๊อปวางบ้านๆ ของเราดีกว่า</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>stderr.net<span style="color: #000000; font-weight: bold;">/</span>apache<span style="color: #000000; font-weight: bold;">/</span>rpaf<span style="color: #000000; font-weight: bold;">/</span>download<span style="color: #000000; font-weight: bold;">/</span>mod_rpaf-<span style="color: #000000;">0.6</span>.tar.gz
<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xvzf</span> mod_rpaf-<span style="color: #000000;">0.6</span>.tar.gz
<span style="color: #7a0874; font-weight: bold;">cd</span> mod_rpaf-<span style="color: #000000;">0.6</span>
apxs <span style="color: #660033;">-i</span> <span style="color: #660033;">-c</span> <span style="color: #660033;">-n</span> mod_rpaf-<span style="color: #000000;">2.0</span>.so mod_rpaf-<span style="color: #000000;">2.0</span>.c</pre></div></div>

<p>เปิดไฟล์ config apache (แนะนำให้ใส่ใน /etc/httpd/conf.d/mod_rpaf.conf)<br />
แก้ตัวแดงๆ ให้ตรงกับเครื่องคุณเองด้วยนะครับ<br />
- อันบนเอาบรรทัดสุดท้ายจากคำสั่ง apxs มา<br />
- อันล่างเอาเป็น ip ของเครื่อง squid</p>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family: monospace;">LoadModule rpaf_module <span style="color: red; font-weight: bold;">/usr/lib64/httpd/modules/mod_rpaf-2.0.so</span>
RPAFenable On
RPAFsethostname Off
RPAFproxy_ips <span style="color: red; font-weight: bold;">127.0.0.1</span>
RPAFheader X-Forwarded-For</pre>
</div>
</div>
<p>ถ้าใช้ตัวนี้ ก็เอา ipfix.php ออกไปได้เลยครับ</p>
<p><strong>บทความที่เกี่ยวข้อง</strong><br />
- <a href="http://www.icez.net/blog/59/squid-26-as-reverse-transparent-proxy">0052 | squid 2.6 as reverse transparent proxy</a><br />
- <a href="http://www.icez.net/blog/60/%e0%b8%82%e0%b8%ad%e0%b8%87%e0%b9%81%e0%b8%96%e0%b8%a1-reverse-proxy-ipfix-php">0053 | ของแถม reverse proxy ipfix.php</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.icez.net/blog/131/%e0%b9%81%e0%b8%81%e0%b9%89%e0%b8%9b%e0%b8%b1%e0%b8%8d%e0%b8%ab%e0%b8%b2-ip-%e0%b9%83%e0%b8%99-log-apache-%e0%b9%84%e0%b8%a1%e0%b9%88%e0%b8%95%e0%b8%a3%e0%b8%87/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>0063 &#124; block IP ต่างประเทศ ไม่ให้ FTP เข้ามาได้</title>
		<link>http://www.icez.net/blog/122/block-ip-%e0%b8%95%e0%b9%88%e0%b8%b2%e0%b8%87%e0%b8%9b%e0%b8%a3%e0%b8%b0%e0%b9%80%e0%b8%97%e0%b8%a8-%e0%b9%84%e0%b8%a1%e0%b9%88%e0%b9%83%e0%b8%ab%e0%b9%89-ftp-%e0%b9%80%e0%b8%82%e0%b9%89%e0%b8%b2</link>
		<comments>http://www.icez.net/blog/122/block-ip-%e0%b8%95%e0%b9%88%e0%b8%b2%e0%b8%87%e0%b8%9b%e0%b8%a3%e0%b8%b0%e0%b9%80%e0%b8%97%e0%b8%a8-%e0%b9%84%e0%b8%a1%e0%b9%88%e0%b9%83%e0%b8%ab%e0%b9%89-ftp-%e0%b9%80%e0%b8%82%e0%b9%89%e0%b8%b2#comments</comments>
		<pubDate>Thu, 11 Jun 2009 03:25:17 +0000</pubDate>
		<dc:creator>icez</dc:creator>
				<category><![CDATA[IP Network]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[ip]]></category>

		<guid isPermaLink="false">http://www.icez.net/blog/?p=122</guid>
		<description><![CDATA[บทความสิ้นคิด ก๊อปวางก็ใช้งานได้ทันทีไม่ต้องปรุง (ยิ่งกว่ามาม่าอีก) iptables -D INPUT -p tcp --dport 21 -j FTPFILTER iptables -N FTPFILTER iptables -F FTPFILTER iptables -A FTPFILTER -j REJECT for i in `wget -qO - http://www.icez.net/files/thaiiplist`; do iptables -I FTPFILTER -s $i -j ACCEPT done iptables -A INPUT -p tcp --dport 21 -j FTPFILTER เสร็จแล้วอย่าลืมสั่ง save iptables ด้วยนะครับ Redhat/CentOS/Fedora: service iptables [...]]]></description>
			<content:encoded><![CDATA[<p>บทความสิ้นคิด ก๊อปวางก็ใช้งานได้ทันทีไม่ต้องปรุง (ยิ่งกว่ามาม่าอีก)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">iptables <span style="color: #660033;">-D</span> INPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #000000;">21</span> <span style="color: #660033;">-j</span> FTPFILTER
iptables <span style="color: #660033;">-N</span> FTPFILTER
iptables <span style="color: #660033;">-F</span> FTPFILTER
iptables <span style="color: #660033;">-A</span> FTPFILTER <span style="color: #660033;">-j</span> REJECT
<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #660033;">-qO</span> - http:<span style="color: #000000; font-weight: bold;">//</span>www.icez.net<span style="color: #000000; font-weight: bold;">/</span>files<span style="color: #000000; font-weight: bold;">/</span>thaiiplist<span style="color: #000000; font-weight: bold;">`</span>; <span style="color: #000000; font-weight: bold;">do</span>
iptables <span style="color: #660033;">-I</span> FTPFILTER <span style="color: #660033;">-s</span> <span style="color: #007800;">$i</span> <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #000000; font-weight: bold;">done</span>
iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #000000;">21</span> <span style="color: #660033;">-j</span> FTPFILTER</pre></div></div>

<p>เสร็จแล้วอย่าลืมสั่ง save iptables ด้วยนะครับ<br />
Redhat/CentOS/Fedora: service iptables save<br />
Debian/Ubuntu: iptables-save</p>
<p>ขอบคุณรายการ ip ประเทศไทย จาก <a href="http://software77.net/geo-ip/" target="_blank">http://software77.net/geo-ip/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.icez.net/blog/122/block-ip-%e0%b8%95%e0%b9%88%e0%b8%b2%e0%b8%87%e0%b8%9b%e0%b8%a3%e0%b8%b0%e0%b9%80%e0%b8%97%e0%b8%a8-%e0%b9%84%e0%b8%a1%e0%b9%88%e0%b9%83%e0%b8%ab%e0%b9%89-ftp-%e0%b9%80%e0%b8%82%e0%b9%89%e0%b8%b2/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>0041 &#124; ตรวจสอบข้อมูลแบบง่ายๆ ด้วย PHP 5.2</title>
		<link>http://www.icez.net/blog/48/%e0%b8%95%e0%b8%a3%e0%b8%a7%e0%b8%88%e0%b8%aa%e0%b8%ad%e0%b8%9a%e0%b8%82%e0%b9%89%e0%b8%ad%e0%b8%a1%e0%b8%b9%e0%b8%a5%e0%b9%81%e0%b8%9a%e0%b8%9a%e0%b8%87%e0%b9%88%e0%b8%b2%e0%b8%a2%e0%b9%86</link>
		<comments>http://www.icez.net/blog/48/%e0%b8%95%e0%b8%a3%e0%b8%a7%e0%b8%88%e0%b8%aa%e0%b8%ad%e0%b8%9a%e0%b8%82%e0%b9%89%e0%b8%ad%e0%b8%a1%e0%b8%b9%e0%b8%a5%e0%b9%81%e0%b8%9a%e0%b8%9a%e0%b8%87%e0%b9%88%e0%b8%b2%e0%b8%a2%e0%b9%86#comments</comments>
		<pubDate>Sun, 16 Nov 2008 07:19:22 +0000</pubDate>
		<dc:creator>icez</dc:creator>
				<category><![CDATA[PHP Coding]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[ip]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://www.icez.net/blog/?p=48</guid>
		<description><![CDATA[แบบว่านั่งหาข้อมูลไปเรื่อยๆ (จะใช้ทำ project ครับ) ก็เลยเจอไอ้นี่เข้าให้ แจ่มดีแฮะ จะได้ไม่ต้องนั่งจำ regex อยู่ &#60;?php &#160; /*** an IP address ***/ $ip = &#34;2001:0db8:85a3:08d3:1319:8a2e:0370:7334&#34;; &#160; /*** try to validate as IPV6 address ***/ if&#40;filter_var&#40;$ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6&#41; === FALSE&#41; &#123; echo &#34;$ip is not a valid IP&#34;; &#125; else &#123; echo &#34;$ip is valid&#34;; &#125;?&#62; ที่มา: PHP Tutorials Examples Filtering Data [...]]]></description>
			<content:encoded><![CDATA[<p>แบบว่านั่งหาข้อมูลไปเรื่อยๆ<br />
(จะใช้ทำ project ครับ)<br />
ก็เลยเจอไอ้นี่เข้าให้ แจ่มดีแฮะ จะได้ไม่ต้องนั่งจำ regex อยู่</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/*** an IP address ***/</span>
<span style="color: #000088;">$ip</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;2001:0db8:85a3:08d3:1319:8a2e:0370:7334&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/*** try to validate as IPV6 address ***/</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">filter_var</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ip</span><span style="color: #339933;">,</span> FILTER_VALIDATE_IP<span style="color: #339933;">,</span> FILTER_FLAG_IPV6<span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$ip</span> is not a valid IP&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">else</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$ip</span> is valid&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>ที่มา:<br />
<a href="http://phpro.org/tutorials/Filtering-Data-with-PHP.html#9" target="_blank">PHP Tutorials Examples Filtering Data with PHP</a><br />
<a href="http://coding.derkeiler.com/Archive/PHP/php.general/2008-07/msg00650.html" target="_blank">[PHP] IPv6 validation</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.icez.net/blog/48/%e0%b8%95%e0%b8%a3%e0%b8%a7%e0%b8%88%e0%b8%aa%e0%b8%ad%e0%b8%9a%e0%b8%82%e0%b9%89%e0%b8%ad%e0%b8%a1%e0%b8%b9%e0%b8%a5%e0%b9%81%e0%b8%9a%e0%b8%9a%e0%b8%87%e0%b9%88%e0%b8%b2%e0%b8%a2%e0%b9%86/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Served from: www.icez.net @ 2012-02-05 05:34:34 -->
