<?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; Web Server</title>
	<atom:link href="http://www.icez.net/blog/topics/webserver/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.3.1</generator>
		<item>
		<title>0126 &#124; ติดตั้ง Zabbix Server บน CentOS</title>
		<link>http://www.icez.net/blog/1392/zabbix-server-installation-centos</link>
		<comments>http://www.icez.net/blog/1392/zabbix-server-installation-centos#comments</comments>
		<pubDate>Tue, 06 Dec 2011 08:22:06 +0000</pubDate>
		<dc:creator>icez</dc:creator>
				<category><![CDATA[IP Network]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Web Server]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[monitor]]></category>
		<category><![CDATA[zabbix]]></category>

		<guid isPermaLink="false">http://www.icez.net/blog/?p=1392</guid>
		<description><![CDATA[ก่อนอื่น เตรียม repository ให้พร้อม + MySQL Server 1 ฐานข้อมูลครับ เนื่องจาก zabbix ไม่ได้เป็น repository หลักของ centos จึงทำให้ต้องมีการติดตั้ง repository เพิ่มเติมเล็กน้อย ****** วิธีนี้ไม่รับประกันว่าสามารถลงคู่กับเครื่องที่มี DirectAdmin ได้ ****** 1) EPEL centos 5 : rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm centos 6 : rpm -Uvh http://download.fedora.redhat.com/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm 2) Atomic wget -qO - http://www.atomicorp.com/installers/atomic &#124; sh พร้อมแล้วก็ติดตั้งกันได้เลยครับ CentOS 64-bit: yum -y install zabbix-server-mysql.x86_64 zabbix-web-mysql.x86_64 CentOS 32-bit: [...]]]></description>
			<content:encoded><![CDATA[<p>ก่อนอื่น เตรียม repository ให้พร้อม + MySQL Server 1 ฐานข้อมูลครับ<br />
เนื่องจาก zabbix ไม่ได้เป็น repository หลักของ centos<br />
จึงทำให้ต้องมีการติดตั้ง repository เพิ่มเติมเล็กน้อย</p>
<p>****** วิธีนี้ไม่รับประกันว่าสามารถลงคู่กับเครื่องที่มี DirectAdmin ได้ ******</p>
<h3>1) EPEL</h3>
<p>centos 5 :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rpm <span style="color: #660033;">-Uvh</span> http:<span style="color: #000000; font-weight: bold;">//</span>download.fedora.redhat.com<span style="color: #000000; font-weight: bold;">/</span>pub<span style="color: #000000; font-weight: bold;">/</span>epel<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">5</span><span style="color: #000000; font-weight: bold;">/</span>i386<span style="color: #000000; font-weight: bold;">/</span>epel-release-<span style="color: #000000;">5</span>-<span style="color: #000000;">4</span>.noarch.rpm</pre></div></div>

<p>centos 6 :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rpm <span style="color: #660033;">-Uvh</span> http:<span style="color: #000000; font-weight: bold;">//</span>download.fedora.redhat.com<span style="color: #000000; font-weight: bold;">/</span>pub<span style="color: #000000; font-weight: bold;">/</span>epel<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">6</span><span style="color: #000000; font-weight: bold;">/</span>x86_64<span style="color: #000000; font-weight: bold;">/</span>epel-release-<span style="color: #000000;">6</span>-<span style="color: #000000;">5</span>.noarch.rpm</pre></div></div>

<h3>2) Atomic</h3>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><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.atomicorp.com<span style="color: #000000; font-weight: bold;">/</span>installers<span style="color: #000000; font-weight: bold;">/</span>atomic <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sh</span></pre></div></div>

<p><span id="more-1392"></span></p>
<hr />
<p>พร้อมแล้วก็ติดตั้งกันได้เลยครับ<br />
CentOS 64-bit:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">yum <span style="color: #660033;">-y</span> <span style="color: #c20cb9; font-weight: bold;">install</span> zabbix-server-mysql.x86_64 zabbix-web-mysql.x86_64</pre></div></div>

<p>CentOS 32-bit:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">yum <span style="color: #660033;">-y</span> <span style="color: #c20cb9; font-weight: bold;">install</span> zabbix-server-mysql zabbix-web-mysql</pre></div></div>

<p>เปิดไฟล์ /etc/zabbix/zabbix_server.conf ขึ้นมา<br />
แก้ไข option เกี่ยวกับการเชื่อมต่อ database ประมาณนี้</p>
<pre>DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zbx@localhost
</pre>
<p>แล้วก็ import database</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>doc<span style="color: #000000; font-weight: bold;">/</span>zabbix-server-mysql-<span style="color: #000000; font-weight: bold;">*/</span>create<span style="color: #000000; font-weight: bold;">/</span>schema<span style="color: #000000; font-weight: bold;">/</span>mysql.sql <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>doc<span style="color: #000000; font-weight: bold;">/</span>zabbix-server-mysql-<span style="color: #000000; font-weight: bold;">*/</span>create<span style="color: #000000; font-weight: bold;">/</span>data<span style="color: #000000; font-weight: bold;">/*</span>.sql <span style="color: #000000; font-weight: bold;">|</span> mysql <span style="color: #660033;">-u</span> zabbix <span style="color: #660033;">-p</span> zabbix</pre></div></div>

<p>แล้วเข้าเว็บได้เลยฮะ http://IP/zabbix/ มันจะเด้งเข้าหน้าติดตั้งให้เลย<br />
ก็ทำไปตามขั้นตอน ปรับตั้งค่า php.ini แล้วก็ระบุ user/pass เข้าฐานข้อมูลครับ<br />
เสร็จแล้วให้ login ด้วย user admin / pass zabbix</p>
<p>* สำหรับ directadmin สั่ง ln -s /usr/share/zabbix /var/www/html/ เพิ่มอีกคำสั่งครับ</p>
<p>ตอนต่อไป (ที่ไม่รู้ว่าจะมาเมื่อไหร่) พบกับการตั้งค่า zabbix เบื้องต้นครับ</p>
]]></content:encoded>
			<wfw:commentRss>http://www.icez.net/blog/1392/zabbix-server-installation-centos/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>0125 &#124; การคำนวณ load ของ server</title>
		<link>http://www.icez.net/blog/1300/server-load-estimation</link>
		<comments>http://www.icez.net/blog/1300/server-load-estimation#comments</comments>
		<pubDate>Tue, 20 Sep 2011 14:27:46 +0000</pubDate>
		<dc:creator>icez</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Web Server]]></category>
		<category><![CDATA[Calculate]]></category>
		<category><![CDATA[Traffic]]></category>

		<guid isPermaLink="false">http://www.icez.net/blog/?p=1300</guid>
		<description><![CDATA[สืบเนื่องจากคำถามที่เจอบ่อยๆ: - เว็บผมมีคนเข้า วันละ xxxx คน พี่รับไหวมั้ยครับ - เว็บผมมีคนเข้า วันละ xxxx คน ต้องใช้ host ประมาณไหนเหรอครับ ============================================== เรื่องมันมีอยู่ว่า server 1 เครื่อง ก็เปรียบเสมือนกับ ห้อง 1 ห้อง มีขนาดความจุรับได้ N คน &#8220;พร้อมๆ กัน&#8221; แล้วก็มาถามว่า ไอ้ห้อง 1 ห้องที่ว่านี่ &#8220;วันนึง&#8221; จะรองรับ &#8220;คนเข้า&#8221; ได้กี่คนครับ? ============================================== ปัจจัยที่เกิดขึ้นคือ 1) คนที่เข้าห้องนั้น อยู่ในห้องนานแค่ไหน? = response time ของ 1 request 2) ขนาดตัวของคนที่เข้า ใหญ่แค่ไหน (แน่นอน อ้วนมากก็เปลืองพื้นที่ห้องมาก) = request+response [...]]]></description>
			<content:encoded><![CDATA[<p>สืบเนื่องจากคำถามที่เจอบ่อยๆ:</p>
<p>- เว็บผมมีคนเข้า วันละ xxxx คน พี่รับไหวมั้ยครับ<br />
- เว็บผมมีคนเข้า วันละ xxxx คน ต้องใช้ host ประมาณไหนเหรอครับ</p>
<p>==============================================</p>
<p>เรื่องมันมีอยู่ว่า server 1 เครื่อง ก็เปรียบเสมือนกับ ห้อง 1 ห้อง มีขนาดความจุรับได้ N คน &#8220;พร้อมๆ กัน&#8221;<br />
แล้วก็มาถามว่า ไอ้ห้อง 1 ห้องที่ว่านี่ &#8220;วันนึง&#8221; จะรองรับ &#8220;คนเข้า&#8221; ได้กี่คนครับ?</p>
<p>==============================================</p>
<p>ปัจจัยที่เกิดขึ้นคือ</p>
<p>1) คนที่เข้าห้องนั้น อยู่ในห้องนานแค่ไหน? = response time ของ 1 request<br />
2) ขนาดตัวของคนที่เข้า ใหญ่แค่ไหน (แน่นอน อ้วนมากก็เปลืองพื้นที่ห้องมาก) = request+response size</p>
<p>จากสองข้อนี้ ก็เลยทำให้ไม่สามารถประมาณการใช้งานจริงๆ ได้หรอกครับ เพราะขึ้นอยู่กับพฤติกรรมคนดูล้วนๆ ครับ</p>
<p>ของอย่างนี้มันต้องลอง !!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.icez.net/blog/1300/server-load-estimation/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>0109 &#124; Cloud Web Hosting</title>
		<link>http://www.icez.net/blog/804/cloud-web-hosting</link>
		<comments>http://www.icez.net/blog/804/cloud-web-hosting#comments</comments>
		<pubDate>Fri, 27 Aug 2010 17:59:25 +0000</pubDate>
		<dc:creator>icez</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[IP Network]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Web Server]]></category>
		<category><![CDATA[carp]]></category>
		<category><![CDATA[cluster]]></category>
		<category><![CDATA[glusterfs]]></category>
		<category><![CDATA[high availability]]></category>

		<guid isPermaLink="false">http://www.icez.net/blog/?p=804</guid>
		<description><![CDATA[บทความต่อไปนี้เป็นเพียงการทดสอบทฤษฎี หรือ Proof of Concept เท่านั้น ยังทดสอบใช้งานจริงไม่ผ่านด้วยสาเหตุทั้งปวง เป้าหมายคือสร้างโฮสติ้งที่ล่มยากๆ และรองรับงานได้ปริมาณมากครับ (โลภมากเนาะมึงนี่) ฝั่ง web server ตรงนี้เป็น cluster ย่อมๆ เลย network ใช้ Virtual IP แต่ทำงานแบบ Dual Mode คือทุกเครื่องจะมีทั้ง Active VIP และ Standby VIP โดยที่ Active VIP ของเครื่อง 1 จะเป็น Standby VIP ของเครื่อง 2 อย่างนี้ไปเรื่อยๆ แล้วใช้ glusterfs ทำ replicate เก็บข้อมูล สามารถยัด node เพิ่มได้เรื่อยๆ ถ้าต้องการพื้นที่เพิ่ม ปัญหาอย่างเดียวที่เจอตอนนี้คือ database ครับ &#8230; มัน&#8230; [...]]]></description>
			<content:encoded><![CDATA[<p>บทความต่อไปนี้เป็นเพียงการทดสอบทฤษฎี หรือ Proof of Concept เท่านั้น ยังทดสอบใช้งานจริงไม่ผ่านด้วยสาเหตุทั้งปวง<br />
เป้าหมายคือสร้าง<a target="_blank" href="http://www.thzhost.com/"><b>โฮสติ้ง</b></a>ที่ล่มยากๆ และรองรับงานได้ปริมาณมากครับ<br />
(โลภมากเนาะมึงนี่)</p>
<p>ฝั่ง web server ตรงนี้เป็น cluster ย่อมๆ เลย network ใช้ Virtual IP แต่ทำงานแบบ Dual Mode คือทุกเครื่องจะมีทั้ง Active VIP และ Standby VIP<br />
โดยที่ Active VIP ของเครื่อง 1 จะเป็น Standby VIP ของเครื่อง 2 อย่างนี้ไปเรื่อยๆ<br />
แล้วใช้ glusterfs ทำ replicate เก็บข้อมูล สามารถยัด node เพิ่มได้เรื่อยๆ ถ้าต้องการพื้นที่เพิ่ม</p>
<p>ปัญหาอย่างเดียวที่เจอตอนนี้คือ database ครับ &#8230; มัน&#8230; ทำงานพร้อมกันแบบ active-active ไม่ได้ T_T<br />
ไม่สามารถใช้ master-master replication ได้ด้วยสาเหตุบางประการ เวลา master ล่ม จะ promote slave ขึ้นมาเป็น master แทนทันที<br />
สามารถสลับเครื่องไปมาตลอด แต่ใช้ ip เดียว วิ่งผ่าน Virtual IP อันนึงครับ<br />
อันนี้เขียน script ช่วยสลับเครื่องเพิ่มเติมไว้ด้วย ยังไม่รู้ว่าใช้งานจริงแล้วจะเน่าอนาถขนาดไหน</p>
<p>สรุป software ที่ใช้ (ในชุดทดสอบ)</p>
<p>- Linux CentOS 5.5 x86_64<br />
- Apache 2.2 / PHP 5.2 / MySQL 5.0<br />
- UCARP (Redundant Network Protocol)<br />
- GlusterFS 3.0.5 (Distributed Storage Engine)<br />
- Plesk 9.5 (Web Hosting Control Panel) ==> Concept ยังไม่ได้ทดสอบใช้งานจริง</p>
<p>จำนวนเครื่องในระบบขั้นต่ำ 4 เครื่อง แบ่งเป็น<br />
- Web Server + Storage 2<br />
- Database 2</p>
<p>ถ้าให้ดีขึ้นก็จับแยก storage ออกมาหน่อยจะดีมาก ด้านล่างเป็น diagram คร่าวๆ ครับ</p>
<p><span id="more-804"></span></p>
<p align="center">
 <a href="http://upic.me/show/16003745" target="_blank"><img border="0" src="http://upic.me/ts/i/pn/img_20100828_003209.jpg"></a><br />
 <a href="http://upic.me/show/16003748" target="_blank"><img border="0" src="http://upic.me/ts/i/4g/img_20100828_003349.jpg"></a><br />
 <a href="http://upic.me/show/16003753" target="_blank"><img border="0" src="http://upic.me/ts/i/90/img_20100828_003813.jpg"></a><br />
 <a href="http://upic.me/show/16003757" target="_blank"><img border="0" src="http://upic.me/ts/i/x4/img_20100828_004140.jpg"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.icez.net/blog/804/cloud-web-hosting/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>0104 &#124; ปุ่มอัพโหลดรูปเข้า upic.me ด่วนทันใจ</title>
		<link>http://www.icez.net/blog/721/quick-upic-me-upload-button</link>
		<comments>http://www.icez.net/blog/721/quick-upic-me-upload-button#comments</comments>
		<pubDate>Sun, 11 Jul 2010 08:24:05 +0000</pubDate>
		<dc:creator>icez</dc:creator>
				<category><![CDATA[PHP Coding]]></category>
		<category><![CDATA[Web Server]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[upicme]]></category>

		<guid isPermaLink="false">http://www.icez.net/blog/?p=721</guid>
		<description><![CDATA[คุณสมบัติ - upload รูปได้ทุก format ที่ upic.me รองรับ ขนาดใหญ่ได้ถึง 2MB - เลือกอัพได้ทีละหลายๆ รูปเหมือนหน้าแรก upic.me ด้วย - มีสถานะการ upload ขึ้นตลอดการอัพ และจะหายไปเองเมื่ออัพเสร็จ - อัพเสร็จ code ขึ้นในกล่องข้อความทันที ไม่ต้องก๊อปวาง - ปรับแต่งหน้าตา สีสันของปุ่มได้ตามสะดวก (ส่วนแก้ไขข้อความ จะทำ version ถัดไปครับ) - เอาไปใช้กันได้ฟรีๆ ไม่ต้องแปะ link กลับ ไม่ต้องแปะเครดิตใดๆ ทั้งสิ้น - ไม่เปลือง bandwidth ของ host ด้วย เพราะอัพตรงเข้ามาที่ server ของ upic.me เลย ถ้างงยังไงลองดูตัวอย่าง code ด้านล่างได้เลยครับ &#60;script type=&#34;text/javascript&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>คุณสมบัติ</p>
<p>- upload รูปได้ทุก format ที่ upic.me รองรับ ขนาดใหญ่ได้ถึง 2MB<br />
- เลือกอัพได้ทีละหลายๆ รูปเหมือนหน้าแรก upic.me ด้วย<br />
- มีสถานะการ upload ขึ้นตลอดการอัพ และจะหายไปเองเมื่ออัพเสร็จ<br />
- อัพเสร็จ code ขึ้นในกล่องข้อความทันที ไม่ต้องก๊อปวาง<br />
- ปรับแต่งหน้าตา สีสันของปุ่มได้ตามสะดวก (ส่วนแก้ไขข้อความ จะทำ version ถัดไปครับ)<br />
- เอาไปใช้กันได้ฟรีๆ ไม่ต้องแปะ link กลับ ไม่ต้องแปะเครดิตใดๆ ทั้งสิ้น<br />
- ไม่เปลือง bandwidth ของ host ด้วย เพราะอัพตรงเข้ามาที่ server ของ upic.me เลย</p>
<p>ถ้างงยังไงลองดูตัวอย่าง code ด้านล่างได้เลยครับ</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&lt;script type=&quot;text/javascript&quot; src=&quot;http://upic.me/js/embedupload.js&quot;&gt;&lt;/script&gt;
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
upic_target <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;targetelement&quot;</span><span style="color: #339933;">;</span>
upic_type <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;resulttype&quot;</span><span style="color: #339933;">;</span>
upic_buttoncss <span style="color: #339933;">+=</span> <span style="color: #3366CC;">&quot;appendcss&quot;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p>upic_target => จะให้เอา code ไปแปะที่ช่องไหน<br />
upic_type => รูปแบบ code ที่แปะ มี htmlfull / htmlthumb / bbfull / bbthumb (ถ้าไม่ระบุ จะถือว่าเป็น bbthumb ครับ)<br />
upic_buttoncss => css เสริมสำหรับข้อความในปุ่ม เผื่ออยากแก้สีแก้รูปแบบ ใส่ไปได้เลยครับ (การใส่สี รองรับ code แบบ #<a href="http://search.twitter.com/search?q=%23abcdef" rel="nofollow" target="_blank" title="Search Twitter for &quot;abcdef&quot;">abcdef</a> เท่านั้นนะครับ)</p>
<p>ส่วน uploadprogress จะมีประมาณนี้ครับ</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">&lt;style type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span><span style="color: #00AA00;">&gt;</span>
<span style="color: #cc00cc;">#upic_uploader</span><span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#upic_uploadprogress</span><span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.progressWrapper</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.progressContainer</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">border-bottom</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">dotted</span> <span style="color: #cc00cc;">#ddd</span><span style="color: #00AA00;">;</span>padding<span style="color: #00AA00;">:</span><span style="color: #933;">2px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.progressName</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>color<span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">black</span><span style="color: #00AA00;">;</span>margin-<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">2px</span><span style="color: #00AA00;">;</span>float<span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.progressBarStatus</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#666</span><span style="color: #00AA00;">;</span>text-align<span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>margin<span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #933;">1px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>font-<span style="color: #000000; font-weight: bold;">size</span><span style="color: #00AA00;">:</span><span style="color: #933;">9px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
.<span style="color: #993333;">red</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #993333;">solid</span> <span style="color: #933;">1px</span> <span style="color: #cc00cc;">#B50000</span><span style="color: #00AA00;">;</span>background-<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#FFEBEB</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
.<span style="color: #993333;">green</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #993333;">solid</span> <span style="color: #933;">1px</span> <span style="color: #cc00cc;">#DDF0DD</span><span style="color: #00AA00;">;</span>background-<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#EBFFEB</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
.<span style="color: #000000; font-weight: bold;">blue</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #993333;">solid</span> <span style="color: #933;">1px</span> <span style="color: #cc00cc;">#CEE2F2</span><span style="color: #00AA00;">;</span>background-<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#F0F5FF</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.progressBarInProgress</span><span style="color: #00AA00;">,</span><span style="color: #6666ff;">.progressBarComplete</span><span style="color: #00AA00;">,</span><span style="color: #6666ff;">.progressBarError</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span><span style="color: #993333;">both</span><span style="color: #00AA00;">;</span>font-<span style="color: #000000; font-weight: bold;">size</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>width<span style="color: #00AA00;">:</span><span style="color: #933;">0%</span><span style="color: #00AA00;">;</span>height<span style="color: #00AA00;">:</span><span style="color: #933;">2px</span><span style="color: #00AA00;">;</span>background-<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">blue</span><span style="color: #00AA00;">;</span>margin-<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span><span style="color: #933;">4px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.progressBarComplete</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">100%</span><span style="color: #00AA00;">;</span>background-<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #993333;">green</span><span style="color: #00AA00;">;</span>visibility<span style="color: #00AA00;">:</span><span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.progressBarError</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">100%</span><span style="color: #00AA00;">;</span>background-<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #993333;">red</span><span style="color: #00AA00;">;</span>visibility<span style="color: #00AA00;">:</span><span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
&lt;/style<span style="color: #00AA00;">&gt;</span></pre></div></div>

<p>(พอดีมันผ่าน compressor มาหลายรอบ code เลยดูยากหน่อย ขออภัยด้วยครับ)<br />
ถ้าอยากแก้ไขหน้าตาสีสันยังไง สามารถ copy code ด้านบนไปแก้ไข แล้วใส่ต่อจาก script ได้เลยครับ</p>
<p><span id="more-721"></span></p>
<p>.<br />.<br />
<hr />.<br />.</p>
<p>ตัวอย่าง code นี้สำหรับแปะในบอร์ด SMF ไฟล์ Post.template.php ได้ทันที</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&lt;script type=&quot;text/javascript&quot; src=&quot;http://upic.me/js/embedupload.js&quot;&gt;&lt;/script&gt;
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
upic_target <span style="color: #339933;">=</span> document.<span style="color: #660066;">postmodify</span>.<span style="color: #660066;">message</span><span style="color: #339933;">;</span>
upic_type <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;bbthumb&quot;</span><span style="color: #339933;">;</span>
upic_buttoncss <span style="color: #339933;">+=</span> <span style="color: #3366CC;">&quot;color:#000000;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p>อันด้านล่างนี้สำหรับ discuz</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&lt;script type=&quot;text/javascript&quot; src=&quot;http://upic.me/js/embedupload.js&quot;&gt;&lt;/script&gt;
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
upic_target <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;postmessage&quot;</span><span style="color: #339933;">;</span>
upic_type <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;bbthumb&quot;</span><span style="color: #339933;">;</span>
upic_buttoncss <span style="color: #339933;">+=</span> <span style="color: #3366CC;">&quot;color:#000000;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p>=======================<br />
update 2010-08-07 :: custom function สำหรับแทรก code เข้าพวก wysiwyg editor ครับ</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&lt;script type=&quot;text/javascript&quot; src=&quot;http://upic.me/js/embedupload.js&quot;&gt;&lt;/script&gt;
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
upic_target <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;postmessage&quot;</span><span style="color: #339933;">;</span>
upic_type <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;bbthumb&quot;</span><span style="color: #339933;">;</span>
upic_buttoncss <span style="color: #339933;">+=</span> <span style="color: #3366CC;">&quot;color:#000000;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">function</span> upic_custom<span style="color: #009900;">&#40;</span>urlshow<span style="color: #339933;">,</span> urlfull<span style="color: #339933;">,</span> urlthumb<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #006600; font-style: italic;">// do anything here </span>
<span style="color: #009900;">&#125;</span> 
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p>ตัวอย่างด้านล่างสำหรับ SMF 2.0 ขึ้นไปครับ รองรับการทำงานของ WYSIWYG editor เรียบร้อย</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&lt;script type=&quot;text/javascript&quot; src=&quot;http://upic.me/js/embedupload.js&quot;&gt;&lt;/script&gt;
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
upic_target <span style="color: #339933;">=</span> document.<span style="color: #660066;">postmodify</span>.<span style="color: #660066;">message</span><span style="color: #339933;">;</span>
upic_type <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;bbthumb&quot;</span><span style="color: #339933;">;</span>
upic_buttoncss  <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;color:#000000;&quot;</span><span style="color: #339933;">;</span>
upic_buttontext <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;Select Images &lt;span class=<span style="color: #000099; font-weight: bold;">\&quot;</span>buttonSmall<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;(2 MB Max)&lt;/span&gt;&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> upic_custom<span style="color: #009900;">&#40;</span>urlshow<span style="color: #339933;">,</span> urlfull<span style="color: #339933;">,</span> urlthumb<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>oEditorHandle_message.<span style="color: #660066;">bRichTextEnabled</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
oEditorHandle_message.<span style="color: #660066;">insertText</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;a href=<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span> <span style="color: #339933;">+</span> urlshow <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;img src=<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span> <span style="color: #339933;">+</span> urlthumb <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span> border=<span style="color: #000099; font-weight: bold;">\&quot;</span>0<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;/a&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
upic_target.<span style="color: #660066;">value</span> <span style="color: #339933;">+=</span> <span style="color: #3366CC;">&quot;[url=&quot;</span><span style="color: #339933;">+</span>urlshow<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;][img]&quot;</span><span style="color: #339933;">+</span>urlthumb<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;[/img][/url]&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.icez.net/blog/721/quick-upic-me-upload-button/feed</wfw:commentRss>
		<slash:comments>100</slash:comments>
		</item>
		<item>
		<title>0102 &#124; MRTG monitoring script for nginx</title>
		<link>http://www.icez.net/blog/710/mrtg-monitoring-script-for-nginx</link>
		<comments>http://www.icez.net/blog/710/mrtg-monitoring-script-for-nginx#comments</comments>
		<pubDate>Tue, 06 Jul 2010 04:27:20 +0000</pubDate>
		<dc:creator>icez</dc:creator>
				<category><![CDATA[IP Network]]></category>
		<category><![CDATA[Web Server]]></category>
		<category><![CDATA[mrtg]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://www.icez.net/blog/?p=710</guid>
		<description><![CDATA[สร้างไฟล์ /root/bin/mrtg-nginx.pl ข้อมูลตามนี้ #!/usr/bin/perl # $Revision: 2 $ # $Date: 2008-09-12 15:11:40 +0300 (Fri, 12 Sep 2008) $ &#160; my %opt = &#40; # http link to nginx stub_status, be sure turn on stub_status in nginx conf nginx_status =&#62; 'http://localhost:80/status', # path for program what may dump web page, normaly lynx -dump # lynx =&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>สร้างไฟล์ /root/bin/mrtg-nginx.pl ข้อมูลตามนี้</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span>
<span style="color: #666666; font-style: italic;"># $Revision: 2 $</span>
<span style="color: #666666; font-style: italic;"># $Date: 2008-09-12 15:11:40 +0300 (Fri, 12 Sep 2008) $</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">%opt</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>
<span style="color: #666666; font-style: italic;"># http link to nginx stub_status, be sure turn on stub_status in nginx conf</span>
    nginx_status   <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'http://localhost:80/status'</span><span style="color: #339933;">,</span>
<span style="color: #666666; font-style: italic;"># path for program what may dump web page, normaly lynx -dump</span>
<span style="color: #666666; font-style: italic;">#    lynx            =&gt; 'lynx -dump',</span>
    lynx            <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'wget -q -Y off -O -'</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$opt</span><span style="color: #009900;">&#123;</span>var<span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #b1b100;">if</span> <span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$opt</span><span style="color: #009900;">&#123;</span>nginx_status<span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #b1b100;">if</span> <span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #b1b100;">and</span> <span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=~/^</span>http<span style="color: #339933;">:</span>\<span style="color: #339933;">/</span>\<span style="color: #339933;">/</span><span style="color: #0000ff;">\w</span><span style="color: #339933;">+/;</span>
<span style="color: #0000ff;">$opt</span><span style="color: #009900;">&#123;</span>var<span style="color: #009900;">&#125;</span> <span style="color: #339933;">||=</span> <span style="color: #ff0000;">''</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$do</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">`$opt{lynx} $opt{nginx_status}`</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$opt</span><span style="color: #009900;">&#123;</span>var<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">eq</span> <span style="color: #ff0000;">'req'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #0000ff;">$do</span><span style="color: #339933;">=~/^</span>Active connections<span style="color: #339933;">:</span>\<span style="color: #000066;">s</span><span style="color: #339933;">*</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">\d</span><span style="color: #339933;">+</span><span style="color: #009900;">&#41;</span>\<span style="color: #000066;">s</span><span style="color: #339933;">*</span>$<span style="color: #339933;">/</span>ms <span style="color: #b1b100;">or</span> <span style="color: #000066;">warn</span> <span style="color: #ff0000;">&quot;Error! Can't find data!<span style="color: #000099; font-weight: bold;">\n</span>IN :<span style="color: #000099; font-weight: bold;">\n</span>$do&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #0000ff;">$opt</span><span style="color: #009900;">&#123;</span>d2<span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$opt</span><span style="color: #009900;">&#123;</span>d1<span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$1</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">elsif</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$opt</span><span style="color: #009900;">&#123;</span>var<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">eq</span> <span style="color: #ff0000;">'con'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #0000ff;">$do</span><span style="color: #339933;">=~/^</span>\<span style="color: #000066;">s</span><span style="color: #339933;">*</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">\d</span><span style="color: #339933;">+</span><span style="color: #009900;">&#41;</span>\<span style="color: #000066;">s</span><span style="color: #339933;">+</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">\d</span><span style="color: #339933;">+</span><span style="color: #009900;">&#41;</span>\<span style="color: #000066;">s</span><span style="color: #339933;">+</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">\d</span><span style="color: #339933;">+</span><span style="color: #009900;">&#41;</span>\<span style="color: #000066;">s</span><span style="color: #339933;">*</span>$<span style="color: #339933;">/</span>ms <span style="color: #b1b100;">or</span> <span style="color: #000066;">warn</span> <span style="color: #ff0000;">&quot;Error! Can't find data!<span style="color: #000099; font-weight: bold;">\n</span>IN :<span style="color: #000099; font-weight: bold;">\n</span>$do&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #0000ff;">$opt</span><span style="color: #009900;">&#123;</span>d2<span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$opt</span><span style="color: #009900;">&#123;</span>d1<span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$3</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">#elsif { $do=~/^Reading:\s+(\d+).*Writing:\s+(\d+).*Waiting:\s+(\d+)/; }</span>
<span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #0000ff;">$opt</span><span style="color: #009900;">&#123;</span>var<span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'ERROR'</span><span style="color: #339933;">;</span>
    <span style="color: #0000ff;">$opt</span><span style="color: #009900;">&#123;</span>d2<span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$opt</span><span style="color: #009900;">&#123;</span>d1<span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
    <span style="color: #000066;">warn</span> <span style="color: #ff0000;">&quot;Error! Please read the help and set (req|con)<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;$opt{d1}<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;$opt{d2}<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">#print &quot;$opt{up}\n&quot; if $opt{up};</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Nginx $opt{var}<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>เสร็จแล้วสั่ง<br />
chmod a+x /root/bin/mrtg-nginx.pl<br />
ให้รันได้</p>
<p>แล้วเอาไอ้นี่ไปใส่ใน nginx.conf ส่วนของ vhost นะครับ</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">location <span style="color: #339933;">/</span>status <span style="color: #009900;">&#123;</span>
    stub_status on<span style="color: #339933;">;</span>
    access_log off<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>แล้วก็&#8230; อันนี้เอาไปใส่ใน mrtg.cfg</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">Target<span style="color: #009900;">&#91;</span>nginx<span style="color: #339933;">.</span>newconns<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> `<span style="color: #339933;">/</span>root<span style="color: #339933;">/</span>bin<span style="color: #339933;">/</span>mrtg<span style="color: #339933;">-</span>nginx<span style="color: #339933;">.</span>pl con`
Title<span style="color: #009900;">&#91;</span>nginx<span style="color: #339933;">.</span>newconns<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> NGINX Connections
PageTop<span style="color: #009900;">&#91;</span>nginx<span style="color: #339933;">.</span>newconns<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> <span style="color: #339933;">&lt;</span>H1<span style="color: #339933;">&gt;</span>NGINX Connections<span style="color: #339933;">&lt;/</span>H1<span style="color: #339933;">&gt;</span>
MaxBytes<span style="color: #009900;">&#91;</span>nginx<span style="color: #339933;">.</span>newconns<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> <span style="color: #cc66cc;">10000000000</span>
ShortLegend<span style="color: #009900;">&#91;</span>nginx<span style="color: #339933;">.</span>newconns<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> c<span style="color: #339933;">/</span>s
YLegend<span style="color: #009900;">&#91;</span>nginx<span style="color: #339933;">.</span>newconns<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> Conns <span style="color: #339933;">/</span> sec
LegendI<span style="color: #009900;">&#91;</span>nginx<span style="color: #339933;">.</span>newconns<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> In
LegendO<span style="color: #009900;">&#91;</span>nginx<span style="color: #339933;">.</span>newconns<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span>
Legend1<span style="color: #009900;">&#91;</span>nginx<span style="color: #339933;">.</span>newconns<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">New</span> inbound connections
Legend2<span style="color: #009900;">&#91;</span>nginx<span style="color: #339933;">.</span>newconns<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span>
Options<span style="color: #009900;">&#91;</span>nginx<span style="color: #339933;">.</span>newconns<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> growright<span style="color: #339933;">,</span>nopercent
&nbsp;
Target<span style="color: #009900;">&#91;</span>nginx<span style="color: #339933;">.</span>requests<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> `<span style="color: #339933;">/</span>root<span style="color: #339933;">/</span>bin<span style="color: #339933;">/</span>mrtg<span style="color: #339933;">-</span>nginx<span style="color: #339933;">.</span>pl req`
Title<span style="color: #009900;">&#91;</span>nginx<span style="color: #339933;">.</span>requests<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> NGINX Requests
PageTop<span style="color: #009900;">&#91;</span>nginx<span style="color: #339933;">.</span>requests<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> <span style="color: #339933;">&lt;</span>H1<span style="color: #339933;">&gt;</span>NGINX Requests<span style="color: #339933;">&lt;/</span>H1<span style="color: #339933;">&gt;</span>
MaxBytes<span style="color: #009900;">&#91;</span>nginx<span style="color: #339933;">.</span>requests<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> <span style="color: #cc66cc;">10000000000</span>
ShortLegend<span style="color: #009900;">&#91;</span>nginx<span style="color: #339933;">.</span>requests<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> req
YLegend<span style="color: #009900;">&#91;</span>nginx<span style="color: #339933;">.</span>requests<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> Req
LegendI<span style="color: #009900;">&#91;</span>nginx<span style="color: #339933;">.</span>requests<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> In
LegendO<span style="color: #009900;">&#91;</span>nginx<span style="color: #339933;">.</span>requests<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span>
Legend1<span style="color: #009900;">&#91;</span>nginx<span style="color: #339933;">.</span>requests<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">New</span> inbound connections
Legend2<span style="color: #009900;">&#91;</span>nginx<span style="color: #339933;">.</span>requests<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span>
Options<span style="color: #009900;">&#91;</span>nginx<span style="color: #339933;">.</span>requests<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> growright<span style="color: #339933;">,</span>nopercent<span style="color: #339933;">,</span>gauge</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.icez.net/blog/710/mrtg-monitoring-script-for-nginx/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>0098 &#124; ปิดงาน admission 2553</title>
		<link>http://www.icez.net/blog/633/%e0%b8%9b%e0%b8%b4%e0%b8%94%e0%b8%87%e0%b8%b2%e0%b8%99-admission-2553</link>
		<comments>http://www.icez.net/blog/633/%e0%b8%9b%e0%b8%b4%e0%b8%94%e0%b8%87%e0%b8%b2%e0%b8%99-admission-2553#comments</comments>
		<pubDate>Fri, 07 May 2010 15:25:17 +0000</pubDate>
		<dc:creator>icez</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[IP Network]]></category>
		<category><![CDATA[PHP Coding]]></category>
		<category><![CDATA[Web Server]]></category>
		<category><![CDATA[admission]]></category>
		<category><![CDATA[bandwidth]]></category>
		<category><![CDATA[internet]]></category>

		<guid isPermaLink="false">http://www.icez.net/blog/?p=633</guid>
		<description><![CDATA[ปีนี้พิเศษนิดนึงที่ admissions.mxphone.com และเว็บประกาศผลในเครือ bodinzone ทั้งหมด จะยิงมายัง server เดียวเพื่อทดสอบประสิทธิภาพระบบ cloud computing ครับ (แหม่ ใช้คำซะอินเทรนด์) เอาจริงๆ มันก็ไม่เชิง cloud หรอก แค่เปลี่ยนระบบจัดการข้อมูลใหม่นิดหน่อยเพื่อให้แก้ไขระบบได้สะดวกขึ้น และเสี่ยงต่อการถูกโจมตีจนระบบล่มใช้งานไม่ได้ (DDoS) น้อยลง เนื่องจากการเข้าใช้งานเป็นไปในลักษณะนั้น ผลงานรอบนี้ ขอยกความดีความชอบให้ @rtsp ได้เลยครับ ส่วนความผิดพลาดทั้งหลายผมขอน้อมรับไว้เอง เนื่องด้วยยังอ่อนประสบการณ์เรื่องนี้พอดี T_T ทำให้ระบบร่วงไปประมาณ 30 นาที (ช่วง 17.30 &#8211; 18.00 น.) (มีเวลาเตรียมงาน นับเป็นชั่วโมงก็ราวๆ 4-5 ชั่วโมง แทบไม่ได้ทดสอบอะไรระบบใหม่นี้เลย) แต่ดูแล้ว ผลเป็นที่น่าพอใจ และปีหน้าไม่พลาดแล้วครับ cloud computing จงเจริญ สถิติ: ปริมาณ bandwidth peak 11.6 Mbps เมื่อ [...]]]></description>
			<content:encoded><![CDATA[<p>ปีนี้พิเศษนิดนึงที่ admissions.mxphone.com และเว็บประกาศผลในเครือ bodinzone ทั้งหมด<br />
จะยิงมายัง server เดียวเพื่อทดสอบประสิทธิภาพระบบ cloud computing ครับ (แหม่ ใช้คำซะอินเทรนด์)</p>
<p>เอาจริงๆ มันก็ไม่เชิง cloud หรอก แค่เปลี่ยนระบบจัดการข้อมูลใหม่นิดหน่อยเพื่อให้แก้ไขระบบได้สะดวกขึ้น<br />
และเสี่ยงต่อการถูกโจมตีจนระบบล่มใช้งานไม่ได้ (DDoS) น้อยลง เนื่องจากการเข้าใช้งานเป็นไปในลักษณะนั้น</p>
<p>ผลงานรอบนี้ ขอยกความดีความชอบให้ @<a href="https://twitter.com/rtsp">rtsp</a> ได้เลยครับ ส่วนความผิดพลาดทั้งหลายผมขอน้อมรับไว้เอง<br />
เนื่องด้วยยังอ่อนประสบการณ์เรื่องนี้พอดี T_T ทำให้ระบบร่วงไปประมาณ 30 นาที (ช่วง 17.30 &#8211; 18.00 น.)<br />
(มีเวลาเตรียมงาน นับเป็นชั่วโมงก็ราวๆ 4-5 ชั่วโมง แทบไม่ได้ทดสอบอะไรระบบใหม่นี้เลย)</p>
<p><a href="http://upic.me/e63ek" target="_blank"><img border="0" src="http://upic.me/i/pf/9dvwc.png"></a></p>
<p>แต่ดูแล้ว ผลเป็นที่น่าพอใจ และปีหน้าไม่พลาดแล้วครับ cloud computing จงเจริญ</p>
<p>สถิติ:<br />
ปริมาณ bandwidth peak 11.6 Mbps เมื่อ 18.05 น.โดยประมาณ (แทบจะทันทีที่ระบบกลับมาใช้ได้)<br />
ปริมาณการร้องขอเข้าใช้งานสูงสุด ณ เวลานั้น 1200 ครั้ง ต่อวินาที โดยประมาณ<br />
CPU ช่วงจังหวะสูงสุดใช้ประมาณ 3 Core เต็มๆ (เทียบจาก Core 2 Quad ความเร็ว 2.53 GHz)<br />
RAM ใช้ไปประมาณ 2GB</p>
<p>ข้อมูลเชิงเทคนิค<br />
Web Server: lighttpd 1.4.19<br />
Server-Side Scripting: PHP 5.2.6<br />
Database: MySQL 5.0.51<br />
IDC: <a href="http://www.servenet.co.th">ServeNet</a></p>
<p>ปีหน้าเอา atom server มารันดีมั้ยเนี่ย :D</p>
]]></content:encoded>
			<wfw:commentRss>http://www.icez.net/blog/633/%e0%b8%9b%e0%b8%b4%e0%b8%94%e0%b8%87%e0%b8%b2%e0%b8%99-admission-2553/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>0096 &#124; เบื้องหลังความแรงของ upic.me</title>
		<link>http://www.icez.net/blog/546/upic-me-server-facility</link>
		<comments>http://www.icez.net/blog/546/upic-me-server-facility#comments</comments>
		<pubDate>Fri, 19 Feb 2010 13:29:21 +0000</pubDate>
		<dc:creator>icez</dc:creator>
				<category><![CDATA[IP Network]]></category>
		<category><![CDATA[Web Server]]></category>
		<category><![CDATA[bandwidth]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[cdn]]></category>
		<category><![CDATA[upicme]]></category>

		<guid isPermaLink="false">http://www.icez.net/blog/?p=546</guid>
		<description><![CDATA[อธิบายสั้นๆ ง่ายๆ ด้วยสองรูปนี้ ว่าแต่&#8230; แรงจริงเรอะ (ฮาาาาา)]]></description>
			<content:encoded><![CDATA[<p align="center">อธิบายสั้นๆ ง่ายๆ ด้วยสองรูปนี้</p>
<p align="center"><a href="http://upic.me/i/df/8l9kc.jpg" target="_blank" rel="lightbox[546]"><img border="0" src="http://upic.me/tw/i/df/8l9kc.jpg"></a> <a href="http://upic.me/i/i3/0uakc.jpg" target="_blank" rel="lightbox[546]"><img border="0" src="http://upic.me/tw/i/i3/0uakc.jpg"></a></p>
<p align="center">ว่าแต่&#8230; แรงจริงเรอะ (ฮาาาาา)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.icez.net/blog/546/upic-me-server-facility/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>0085 &#124; DirectAdmin + mod_fcgid + php fastcgi</title>
		<link>http://www.icez.net/blog/389/directadmin-mod_fcgid-php-fastcgi</link>
		<comments>http://www.icez.net/blog/389/directadmin-mod_fcgid-php-fastcgi#comments</comments>
		<pubDate>Fri, 13 Nov 2009 23:14:02 +0000</pubDate>
		<dc:creator>icez</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Web Server]]></category>
		<category><![CDATA[directadmin]]></category>
		<category><![CDATA[fastcgi]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[PHP Coding]]></category>

		<guid isPermaLink="false">http://www.icez.net/blog/?p=389</guid>
		<description><![CDATA[ก่อนอื่น copy &#038; paste ตามสูตร cd /usr/local/src wget http://mirrors.issp.co.th/apache/httpd/mod_fcgid/mod_fcgid-2.3.4.tar.bz2 tar jxf mod_fcgid-2.3.4.tar.bz2 cd mod_fcgid-2.3.4 APXS=/usr/sbin/apxs ./configure.apxs &#38;&#38; make &#38;&#38; make install chmod 755 -R /var/lib/httpd mkdir /fcgi ไปที่ /usr/local/directadmin/custombuild/ เปิดไฟล์ options.conf แก้ php5_cgi=yes ส่วน php อันอื่น no ให้หมด แล้วสั่ง ./build php จนเสร็จ แล้วเปิดไฟล์ /etc/httpd/conf/extra/httpd-info.conf เพิ่มไอ้นี่ต่อท้าย LoadModule fcgid_module /usr/lib/apache/mod_fcgid.so &#160; SharememPath /var/run/fcgid_shm SocketPath /var/lib/httpd/fcgid/sock &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>ก่อนอื่น copy &#038; paste ตามสูตร</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>src
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>mirrors.issp.co.th<span style="color: #000000; font-weight: bold;">/</span>apache<span style="color: #000000; font-weight: bold;">/</span>httpd<span style="color: #000000; font-weight: bold;">/</span>mod_fcgid<span style="color: #000000; font-weight: bold;">/</span>mod_fcgid-2.3.4.tar.bz2
<span style="color: #c20cb9; font-weight: bold;">tar</span> jxf mod_fcgid-2.3.4.tar.bz2
<span style="color: #7a0874; font-weight: bold;">cd</span> mod_fcgid-2.3.4
<span style="color: #007800;">APXS</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>apxs .<span style="color: #000000; font-weight: bold;">/</span>configure.apxs <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span>
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">755</span> <span style="color: #660033;">-R</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>httpd
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>fcgi</pre></div></div>

<p>ไปที่ /usr/local/directadmin/custombuild/<br />
เปิดไฟล์ options.conf แก้ php5_cgi=yes ส่วน php อันอื่น no ให้หมด<br />
แล้วสั่ง ./build php จนเสร็จ</p>
<p>แล้วเปิดไฟล์ /etc/httpd/conf/extra/httpd-info.conf<br />
เพิ่มไอ้นี่ต่อท้าย</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">LoadModule</span> fcgid_module /usr/lib/apache/mod_fcgid.so
&nbsp;
SharememPath /var/run/fcgid_shm
SocketPath /var/lib/httpd/fcgid/sock
&nbsp;
&nbsp;
&nbsp;
&lt;<span style="color: #000000; font-weight:bold;">IfModule</span> mod_fcgid.c&gt;
  IdleTimeout <span style="color: #ff0000;">3600</span>
  ProcessLifeTime <span style="color: #ff0000;">7200</span>
  MaxProcessCount <span style="color: #ff0000;">128</span>
  DefaultMaxClassProcessCount <span style="color: #ff0000;">4</span>
  IPCConnectTimeout <span style="color: #ff0000;">60</span>
  IPCCommTimeout <span style="color: #ff0000;">90</span>
  DefaultInitEnv RAILS_ENV production
<span style="color: #adadad; font-style: italic;">#  DefaultInitEnv PHP_FCGI_CHILDREN 4</span>
<span style="color: #adadad; font-style: italic;">#  MaxRequestsPerProcess 500</span>
&lt;/<span style="color: #000000; font-weight:bold;">IfModule</span>&gt;
&nbsp;
&lt;<span style="color: #000000; font-weight:bold;">Directory</span> <span style="color: #7f007f;">&quot;/home&quot;</span>&gt;
        <span style="color: #00007f;">AllowOverride</span> <span style="color: #0000ff;">All</span>
        <span style="color: #00007f;">Options</span> SymLinksIfOwnerMatch
        <span style="color: #00007f;">Order</span> <span style="color: #00007f;">allow</span>,<span style="color: #00007f;">deny</span>
        <span style="color: #00007f;">Allow</span> from <span style="color: #0000ff;">all</span>
        &lt;<span style="color: #000000; font-weight:bold;">IfModule</span> sapi_apache2.c&gt;
        <span style="color: #00007f;">php_admin_flag</span> engine <span style="color: #0000ff;">off</span>
        &lt;/<span style="color: #000000; font-weight:bold;">IfModule</span>&gt;
        &lt;<span style="color: #000000; font-weight:bold;">IfModule</span> mod_php5.c&gt;
        <span style="color: #00007f;">php_admin_flag</span> engine <span style="color: #0000ff;">off</span>
        &lt;/<span style="color: #000000; font-weight:bold;">IfModule</span>&gt;
&lt;/<span style="color: #000000; font-weight:bold;">Directory</span>&gt;</pre></div></div>

<p>เสร็จแล้วเข้าไป folder /usr/local/directadmin/data/templates<br />
เปิดไฟล์ที่ขึ้นต้นด้วย virtual_host2*.conf (มีทั้งหมด 4 ไฟล์)<br />
ใน section เดิมที่เป็น PHP ทั้งหมด ให้ comment ไว้ จะได้ประมาณนี้</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;">|*if CLI=<span style="color: #7f007f;">&quot;1&quot;</span>|
<span style="color: #adadad; font-style: italic;">#               php_admin_flag engine |PHP|</span>
<span style="color: #adadad; font-style: italic;">#               &lt;IfModule !mod_php6.c&gt;</span>
<span style="color: #adadad; font-style: italic;">#                       php_admin_flag safe_mode |SAFE_MODE|</span>
<span style="color: #adadad; font-style: italic;">#               &lt;/IfModule&gt;</span>
<span style="color: #adadad; font-style: italic;">#               php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f |USER|@|DOMAIN|'</span>
|*endif|
|*if OPEN_BASEDIR=<span style="color: #7f007f;">&quot;ON&quot;</span>|
<span style="color: #adadad; font-style: italic;">#               php_admin_value open_basedir |OPEN_BASEDIR_PATH|</span>
|*endif|
|*if SUPHP=<span style="color: #7f007f;">&quot;1&quot;</span>|
<span style="color: #adadad; font-style: italic;">#                suPHP_Engine |PHP|</span>
<span style="color: #adadad; font-style: italic;">#               suPHP_UserGroup |USER| |GROUP|</span>
|*endif|</pre></div></div>

<p>แล้วแทรกไอ้นี่เข้าไปด้านบนของไอ้เมื่อกี้</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;">	&lt;<span style="color: #000000; font-weight:bold;">IfModule</span> mod_fcgid.c&gt;
		&lt;<span style="color: #000000; font-weight:bold;">Files</span> ~ (\.fcgi)&gt;
			<span style="color: #00007f;">SetHandler</span> fcgid-<span style="color: #00007f;">script</span>
			<span style="color: #00007f;">Options</span> +<span style="color: #0000ff;">FollowSymLinks</span> +ExecCGI
		&lt;/<span style="color: #000000; font-weight:bold;">Files</span>&gt;
	&lt;/<span style="color: #000000; font-weight:bold;">IfModule</span>&gt;
	&lt;<span style="color: #000000; font-weight:bold;">IfModule</span> mod_fcgid.c&gt;
	&lt;<span style="color: #000000; font-weight:bold;">Files</span> ~ (\.php)&gt;
		<span style="color: #00007f;">SetHandler</span> fcgid-<span style="color: #00007f;">script</span>
		FCGIWrapper <span style="color: #7f007f;">&quot;/fcgi/|USER|/public_html/fcgid.sh&quot;</span> .php
		<span style="color: #00007f;">Options</span> +ExecCGI
		<span style="color: #00007f;">allow</span> from <span style="color: #0000ff;">all</span>
	&lt;/<span style="color: #000000; font-weight:bold;">Files</span>&gt;
	&lt;/<span style="color: #000000; font-weight:bold;">IfModule</span>&gt;</pre></div></div>

<p>แล้วเข้าไป folder /usr/local/directadmin/scripts/custom/<br />
สร้างไฟล์ชื่อ fcgid.sh ใส่ข้อมูลตามนี้</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PHP_FCGI_MAX_REQUESTS</span>=<span style="color: #000000;">0</span>
<span style="color: #7a0874; font-weight: bold;">exec</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>php5<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>php-cgi</pre></div></div>

<p>ใน folder เดียวกัน สร้างไฟล์ชื่อ domain_create_post.sh ใส่ข้อมูลตามนี้</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>fcgi<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${username}</span><span style="color: #000000; font-weight: bold;">/</span>public_html
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>directadmin<span style="color: #000000; font-weight: bold;">/</span>scripts<span style="color: #000000; font-weight: bold;">/</span>custom<span style="color: #000000; font-weight: bold;">/</span>fcgid.sh <span style="color: #000000; font-weight: bold;">/</span>fcgi<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${username}</span><span style="color: #000000; font-weight: bold;">/</span>public_html<span style="color: #000000; font-weight: bold;">/</span>fcgid.sh <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> 0700 <span style="color: #000000; font-weight: bold;">/</span>fcgi<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${username}</span><span style="color: #000000; font-weight: bold;">/</span>public_html<span style="color: #000000; font-weight: bold;">/</span>fcgid.sh
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>directadmin<span style="color: #000000; font-weight: bold;">/</span>scripts<span style="color: #000000; font-weight: bold;">/</span>custom<span style="color: #000000; font-weight: bold;">/</span>php.ini <span style="color: #000000; font-weight: bold;">/</span>fcgi<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${username}</span><span style="color: #000000; font-weight: bold;">/</span>public_html<span style="color: #000000; font-weight: bold;">/</span>php.ini
<span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-pi</span> <span style="color: #660033;">-w</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;s/PHPCFG_BASEDIR/\/home\/<span style="color: #007800;">${username}</span>\//g;&quot;</span> <span style="color: #000000; font-weight: bold;">/</span>fcgi<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${username}</span><span style="color: #000000; font-weight: bold;">/</span>public_html<span style="color: #000000; font-weight: bold;">/</span>php.ini
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> <span style="color: #800000;">${username}</span>:<span style="color: #800000;">${username}</span> <span style="color: #000000; font-weight: bold;">/</span>fcgi<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${username}</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #780078;">`date`</span>  <span style="color: #007800;">${domain}</span> created  &quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>directadmin<span style="color: #000000; font-weight: bold;">/</span>domain_create.log</pre></div></div>

<p>แล้วสั่ง copy file php.ini มาใส่ไว้ใน /usr/local/directadmin/scripts/custom/php.ini<br />
เปิดไฟล์ /usr/local/directadmin/scripts/custom/php.ini ที่ก๊อปมาเมื่อกี้ แล้วหา open_basedir<br />
ซึ่งปกติมันจะ comment ไว้ ให้แก้เป็นประมาณนี้</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">open_basedir <span style="color: #339933;">=</span> PHPCFG_BASEDIR<span style="color: #339933;">:/</span>tmp<span style="color: #339933;">:/</span><span style="color: #000000; font-weight: bold;">var</span><span style="color: #339933;">/</span>tmp</pre></div></div>

<p>เสร็จแล้วสั่ง chmod a+x /usr/local/directadmin/scripts/custom/*.sh</p>
<p>*** วิธีทั้งหมดไม่รับประกันผล และควรใช้กับเครื่องเพิ่งลงใหม่เท่านั้น</p>
]]></content:encoded>
			<wfw:commentRss>http://www.icez.net/blog/389/directadmin-mod_fcgid-php-fastcgi/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>0082 &#124; MRTG สำหรับจับการทำงานของ squid</title>
		<link>http://www.icez.net/blog/369/mrtg-%e0%b8%aa%e0%b8%b3%e0%b8%ab%e0%b8%a3%e0%b8%b1%e0%b8%9a%e0%b8%88%e0%b8%b1%e0%b8%9a%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%97%e0%b8%b3%e0%b8%87%e0%b8%b2%e0%b8%99%e0%b8%82%e0%b8%ad%e0%b8%87-squid</link>
		<comments>http://www.icez.net/blog/369/mrtg-%e0%b8%aa%e0%b8%b3%e0%b8%ab%e0%b8%a3%e0%b8%b1%e0%b8%9a%e0%b8%88%e0%b8%b1%e0%b8%9a%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%97%e0%b8%b3%e0%b8%87%e0%b8%b2%e0%b8%99%e0%b8%82%e0%b8%ad%e0%b8%87-squid#comments</comments>
		<pubDate>Wed, 04 Nov 2009 10:33:16 +0000</pubDate>
		<dc:creator>icez</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Web Server]]></category>
		<category><![CDATA[mrtg]]></category>
		<category><![CDATA[squid]]></category>

		<guid isPermaLink="false">http://www.icez.net/blog/?p=369</guid>
		<description><![CDATA[แก้ squid.conf นิดหน่อย acl snmppublic snmp_community public snmp_port 3401 snmp_access allow snmppublic localhost snmp_access deny all แล้วเอาไอ้นี่ใส่ mrtg.cfg LoadMIBs: /etc/squid/mib.txt &#160; Target&#91;cacheServerRequests&#93;: cacheServerRequests&#38;cacheServerRequests:public@localhost:3401 MaxBytes&#91;cacheServerRequests&#93;: 10000000 Title&#91;cacheServerRequests&#93;: Server Requests @ localhost Options&#91;cacheServerRequests&#93;: growright, nopercent PageTop&#91;cacheServerRequests&#93;: &#60;h1&#62;Server Requests @ localhost&#60;/h1&#62; YLegend&#91;cacheServerRequests&#93;: requests/sec ShortLegend&#91;cacheServerRequests&#93;: req/s LegendI&#91;cacheServerRequests&#93;: Requests&#38;nbsp; LegendO&#91;cacheServerRequests&#93;: Legend1&#91;cacheServerRequests&#93;: Requests Legend2&#91;cacheServerRequests&#93;: &#160; Target&#91;cacheProtoClientHttpRequests&#93;: cacheProtoClientHttpRequests&#38;cacheProtoClientHttpRequests:public@localhost:3401 MaxBytes&#91;cacheProtoClientHttpRequests&#93;: 10000000 Title&#91;cacheProtoClientHttpRequests&#93;: Client [...]]]></description>
			<content:encoded><![CDATA[<p>แก้ squid.conf นิดหน่อย</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">acl snmppublic snmp_community <span style="color: #000000; font-weight: bold;">public</span>
snmp_port <span style="color: #cc66cc;">3401</span>
snmp_access allow snmppublic localhost
snmp_access deny all</pre></div></div>

<p>แล้วเอาไอ้นี่ใส่ mrtg.cfg</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">LoadMIBs<span style="color: #339933;">:</span> <span style="color: #339933;">/</span>etc<span style="color: #339933;">/</span>squid<span style="color: #339933;">/</span>mib<span style="color: #339933;">.</span>txt
&nbsp;
Target<span style="color: #009900;">&#91;</span>cacheServerRequests<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> cacheServerRequests<span style="color: #339933;">&amp;</span>cacheServerRequests<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">public</span><span style="color: #339933;">@</span>localhost<span style="color: #339933;">:</span><span style="color: #cc66cc;">3401</span>
MaxBytes<span style="color: #009900;">&#91;</span>cacheServerRequests<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> <span style="color: #cc66cc;">10000000</span>
Title<span style="color: #009900;">&#91;</span>cacheServerRequests<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> Server Requests <span style="color: #339933;">@</span> localhost
Options<span style="color: #009900;">&#91;</span>cacheServerRequests<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> growright<span style="color: #339933;">,</span> nopercent
PageTop<span style="color: #009900;">&#91;</span>cacheServerRequests<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> <span style="color: #339933;">&lt;</span>h1<span style="color: #339933;">&gt;</span>Server Requests <span style="color: #339933;">@</span> localhost<span style="color: #339933;">&lt;/</span>h1<span style="color: #339933;">&gt;</span>
YLegend<span style="color: #009900;">&#91;</span>cacheServerRequests<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> requests<span style="color: #339933;">/</span>sec
ShortLegend<span style="color: #009900;">&#91;</span>cacheServerRequests<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> req<span style="color: #339933;">/</span>s
LegendI<span style="color: #009900;">&#91;</span>cacheServerRequests<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> Requests<span style="color: #339933;">&amp;</span>nbsp<span style="color: #339933;">;</span>
LegendO<span style="color: #009900;">&#91;</span>cacheServerRequests<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span>
Legend1<span style="color: #009900;">&#91;</span>cacheServerRequests<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> Requests
Legend2<span style="color: #009900;">&#91;</span>cacheServerRequests<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span>
&nbsp;
Target<span style="color: #009900;">&#91;</span>cacheProtoClientHttpRequests<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> cacheProtoClientHttpRequests<span style="color: #339933;">&amp;</span>cacheProtoClientHttpRequests<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">public</span><span style="color: #339933;">@</span>localhost<span style="color: #339933;">:</span><span style="color: #cc66cc;">3401</span>
MaxBytes<span style="color: #009900;">&#91;</span>cacheProtoClientHttpRequests<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> <span style="color: #cc66cc;">10000000</span>
Title<span style="color: #009900;">&#91;</span>cacheProtoClientHttpRequests<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> Client Http Requests <span style="color: #339933;">@</span> localhost
Options<span style="color: #009900;">&#91;</span>cacheProtoClientHttpRequests<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> growright<span style="color: #339933;">,</span> nopercent
PageTop<span style="color: #009900;">&#91;</span>cacheProtoClientHttpRequests<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> <span style="color: #339933;">&lt;</span>h1<span style="color: #339933;">&gt;</span>Client Http Requests <span style="color: #339933;">@</span> localhost<span style="color: #339933;">&lt;/</span>h1<span style="color: #339933;">&gt;</span>
YLegend<span style="color: #009900;">&#91;</span>cacheProtoClientHttpRequests<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> requests<span style="color: #339933;">/</span>sec
ShortLegend<span style="color: #009900;">&#91;</span>cacheProtoClientHttpRequests<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> req<span style="color: #339933;">/</span>s
LegendI<span style="color: #009900;">&#91;</span>cacheProtoClientHttpRequests<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> Requests<span style="color: #339933;">&amp;</span>nbsp<span style="color: #339933;">;</span>
LegendO<span style="color: #009900;">&#91;</span>cacheProtoClientHttpRequests<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span>
Legend1<span style="color: #009900;">&#91;</span>cacheProtoClientHttpRequests<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> Requests
Legend2<span style="color: #009900;">&#91;</span>cacheProtoClientHttpRequests<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span>
&nbsp;
Target<span style="color: #009900;">&#91;</span>cacheHttpHits<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> cacheHttpHits<span style="color: #339933;">&amp;</span>cacheHttpHits<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">public</span><span style="color: #339933;">@</span>localhost<span style="color: #339933;">:</span><span style="color: #cc66cc;">3401</span>
MaxBytes<span style="color: #009900;">&#91;</span>cacheHttpHits<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> <span style="color: #cc66cc;">10000000</span>
Title<span style="color: #009900;">&#91;</span>cacheHttpHits<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> HTTP Hits <span style="color: #339933;">@</span> localhost
Options<span style="color: #009900;">&#91;</span>cacheHttpHits<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> growright<span style="color: #339933;">,</span> nopercent
PageTop<span style="color: #009900;">&#91;</span>cacheHttpHits<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> <span style="color: #339933;">&lt;</span>h1<span style="color: #339933;">&gt;</span>HTTP Hits <span style="color: #339933;">@</span> localhost<span style="color: #339933;">&lt;/</span>h1<span style="color: #339933;">&gt;</span>
YLegend<span style="color: #009900;">&#91;</span>cacheHttpHits<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> hits<span style="color: #339933;">/</span>sec
ShortLegend<span style="color: #009900;">&#91;</span>cacheHttpHits<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> hits<span style="color: #339933;">/</span>s
LegendI<span style="color: #009900;">&#91;</span>cacheHttpHits<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> Hits<span style="color: #339933;">&amp;</span>nbsp<span style="color: #339933;">;</span>
LegendO<span style="color: #009900;">&#91;</span>cacheHttpHits<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span>
Legend1<span style="color: #009900;">&#91;</span>cacheHttpHits<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> Hits
Legend2<span style="color: #009900;">&#91;</span>cacheHttpHits<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span>
&nbsp;
Target<span style="color: #009900;">&#91;</span>cacheCpuUsage<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> cacheCpuUsage<span style="color: #339933;">&amp;</span>cacheCpuUsage<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">public</span><span style="color: #339933;">@</span>localhost<span style="color: #339933;">:</span><span style="color: #cc66cc;">3401</span>
MaxBytes<span style="color: #009900;">&#91;</span>cacheCpuUsage<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> <span style="color: #cc66cc;">100</span>
AbsMax<span style="color: #009900;">&#91;</span>cacheCpuUsage<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> <span style="color: #cc66cc;">100</span>
Title<span style="color: #009900;">&#91;</span>cacheCpuUsage<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> CPU Usage <span style="color: #339933;">@</span> localhost
Options<span style="color: #009900;">&#91;</span>cacheCpuUsage<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> absolute<span style="color: #339933;">,</span> gauge<span style="color: #339933;">,</span> noinfo<span style="color: #339933;">,</span> growright<span style="color: #339933;">,</span> nopercent
Unscaled<span style="color: #009900;">&#91;</span>cacheCpuUsage<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> dwmy
PageTop<span style="color: #009900;">&#91;</span>cacheCpuUsage<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> <span style="color: #339933;">&lt;</span>h1<span style="color: #339933;">&gt;</span>CPU Usage <span style="color: #339933;">@</span> localhost<span style="color: #339933;">&lt;/</span>h1<span style="color: #339933;">&gt;</span>
YLegend<span style="color: #009900;">&#91;</span>cacheCpuUsage<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> usage <span style="color: #339933;">%</span>
ShortLegend<span style="color: #009900;">&#91;</span>cacheCpuUsage<span style="color: #009900;">&#93;</span><span style="color: #339933;">:%</span>
LegendI<span style="color: #009900;">&#91;</span>cacheCpuUsage<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> CPU Usage<span style="color: #339933;">&amp;</span>nbsp<span style="color: #339933;">;</span>
LegendO<span style="color: #009900;">&#91;</span>cacheCpuUsage<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span>
Legend1<span style="color: #009900;">&#91;</span>cacheCpuUsage<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> CPU Usage
Legend2<span style="color: #009900;">&#91;</span>cacheCpuUsage<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span>
&nbsp;
Target<span style="color: #009900;">&#91;</span>cacheSysNumReads<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> cacheSysNumReads<span style="color: #339933;">&amp;</span>cacheSysNumReads<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">public</span><span style="color: #339933;">@</span>localhost<span style="color: #339933;">:</span><span style="color: #cc66cc;">3401</span>
MaxBytes<span style="color: #009900;">&#91;</span>cacheSysNumReads<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> <span style="color: #cc66cc;">10000000</span>
Title<span style="color: #009900;">&#91;</span>cacheSysNumReads<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> HTTP I<span style="color: #339933;">/</span>O number of reads <span style="color: #339933;">@</span> localhost
Options<span style="color: #009900;">&#91;</span>cacheSysNumReads<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> growright<span style="color: #339933;">,</span> nopercent
PageTop<span style="color: #009900;">&#91;</span>cacheSysNumReads<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> <span style="color: #339933;">&lt;</span>h1<span style="color: #339933;">&gt;</span>HTTP I<span style="color: #339933;">/</span>O number of reads <span style="color: #339933;">@</span> localhost<span style="color: #339933;">&lt;/</span>h1<span style="color: #339933;">&gt;</span>
YLegend<span style="color: #009900;">&#91;</span>cacheSysNumReads<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> reads<span style="color: #339933;">/</span>sec
ShortLegend<span style="color: #009900;">&#91;</span>cacheSysNumReads<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> reads<span style="color: #339933;">/</span>s
LegendI<span style="color: #009900;">&#91;</span>cacheSysNumReads<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> I<span style="color: #339933;">/</span>O<span style="color: #339933;">&amp;</span>nbsp<span style="color: #339933;">;</span>
LegendO<span style="color: #009900;">&#91;</span>cacheSysNumReads<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span>
Legend1<span style="color: #009900;">&#91;</span>cacheSysNumReads<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> I<span style="color: #339933;">/</span>O
Legend2<span style="color: #009900;">&#91;</span>cacheSysNumReads<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span>
&nbsp;
Target<span style="color: #009900;">&#91;</span>cacheCurrentFileDescrCnt<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> cacheCurrentFileDescrCnt<span style="color: #339933;">&amp;</span>cacheCurrentFileDescrCnt<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">public</span><span style="color: #339933;">@</span>localhost<span style="color: #339933;">:</span><span style="color: #cc66cc;">3401</span>
MaxBytes<span style="color: #009900;">&#91;</span>cacheCurrentFileDescrCnt<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> <span style="color: #cc66cc;">1000000000</span>
Title<span style="color: #009900;">&#91;</span>cacheCurrentFileDescrCnt<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> Used <span style="color: #990000;">File</span> Descriptors
Options<span style="color: #009900;">&#91;</span>cacheCurrentFileDescrCnt<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> gauge<span style="color: #339933;">,</span> growright<span style="color: #339933;">,</span> nopercent
PageTop<span style="color: #009900;">&#91;</span>cacheCurrentFileDescrCnt<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> <span style="color: #339933;">&lt;</span>h1<span style="color: #339933;">&gt;</span>Number of used <span style="color: #990000;">file</span> descriptors <span style="color: #339933;">@</span> localhost<span style="color: #339933;">&lt;/</span>h1<span style="color: #339933;">&gt;</span>
YLegend<span style="color: #009900;">&#91;</span>cacheCurrentFileDescrCnt<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> <span style="color: #666666; font-style: italic;"># of FDs
</span>ShortLegend<span style="color: #009900;">&#91;</span>cacheCurrentFileDescrCnt<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> FDs
LegendI<span style="color: #009900;">&#91;</span>cacheCurrentFileDescrCnt<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> <span style="color: #990000;">File</span> Descriptors<span style="color: #339933;">&amp;</span>nbsp<span style="color: #339933;">;</span>
LegendO<span style="color: #009900;">&#91;</span>cacheCurrentFileDescrCnt<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span>
Legend1<span style="color: #009900;">&#91;</span>cacheCurrentFileDescrCnt<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> <span style="color: #990000;">File</span> Descriptors
Legend2<span style="color: #009900;">&#91;</span>cacheCurrentFileDescrCnt<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span>
&nbsp;
Target<span style="color: #009900;">&#91;</span>cacheRequestHitRatio<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> cacheRequestHitRatio<span style="color: #339933;">.</span>5<span style="color: #339933;">&amp;</span>cacheRequestHitRatio<span style="color: #339933;">.</span>60<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">public</span><span style="color: #339933;">@</span>localhost<span style="color: #339933;">:</span><span style="color: #cc66cc;">3401</span>
MaxBytes<span style="color: #009900;">&#91;</span>cacheRequestHitRatio<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> <span style="color: #cc66cc;">100</span>
AbsMax<span style="color: #009900;">&#91;</span>cacheRequestHitRatio<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> <span style="color: #cc66cc;">100</span>
Title<span style="color: #009900;">&#91;</span>cacheRequestHitRatio<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> Request Hit Ratio <span style="color: #339933;">@</span> localhost
Options<span style="color: #009900;">&#91;</span>cacheRequestHitRatio<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> absolute<span style="color: #339933;">,</span> gauge<span style="color: #339933;">,</span> noinfo<span style="color: #339933;">,</span> growright<span style="color: #339933;">,</span> nopercent
Unscaled<span style="color: #009900;">&#91;</span>cacheRequestHitRatio<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> dwmy
PageTop<span style="color: #009900;">&#91;</span>cacheRequestHitRatio<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> <span style="color: #339933;">&lt;</span>h1<span style="color: #339933;">&gt;</span>Request Hit Ratio <span style="color: #339933;">@</span> localhost<span style="color: #339933;">&lt;/</span>h1<span style="color: #339933;">&gt;</span>
YLegend<span style="color: #009900;">&#91;</span>cacheRequestHitRatio<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> <span style="color: #339933;">%</span>
ShortLegend<span style="color: #009900;">&#91;</span>cacheRequestHitRatio<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> <span style="color: #339933;">%</span>
LegendI<span style="color: #009900;">&#91;</span>cacheRequestHitRatio<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> Median Hit Ratio <span style="color: #009900;">&#40;</span>5min<span style="color: #009900;">&#41;</span><span style="color: #339933;">&amp;</span>nbsp<span style="color: #339933;">;</span>
LegendO<span style="color: #009900;">&#91;</span>cacheRequestHitRatio<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> Median Hit Ratio <span style="color: #009900;">&#40;</span>60min<span style="color: #009900;">&#41;</span><span style="color: #339933;">&amp;</span>nbsp<span style="color: #339933;">;</span>
Legend1<span style="color: #009900;">&#91;</span>cacheRequestHitRatio<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> Median Hit Ratio
Legend2<span style="color: #009900;">&#91;</span>cacheRequestHitRatio<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> Median Hit Ratio
&nbsp;
Target<span style="color: #009900;">&#91;</span>cacheRequestByteRatio<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> cacheRequestByteRatio<span style="color: #339933;">.</span>5<span style="color: #339933;">&amp;</span>cacheRequestByteRatio<span style="color: #339933;">.</span>60<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">public</span><span style="color: #339933;">@</span>localhost<span style="color: #339933;">:</span><span style="color: #cc66cc;">3401</span>
MaxBytes<span style="color: #009900;">&#91;</span>cacheRequestByteRatio<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> <span style="color: #cc66cc;">100</span>
AbsMax<span style="color: #009900;">&#91;</span>cacheRequestByteRatio<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> <span style="color: #cc66cc;">100</span>
Title<span style="color: #009900;">&#91;</span>cacheRequestByteRatio<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> Byte Hit Ratio <span style="color: #339933;">@</span> localhost
Options<span style="color: #009900;">&#91;</span>cacheRequestByteRatio<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> absolute<span style="color: #339933;">,</span> gauge<span style="color: #339933;">,</span> noinfo<span style="color: #339933;">,</span> growright<span style="color: #339933;">,</span> nopercent
Unscaled<span style="color: #009900;">&#91;</span>cacheRequestByteRatio<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> dwmy
PageTop<span style="color: #009900;">&#91;</span>cacheRequestByteRatio<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> <span style="color: #339933;">&lt;</span>h1<span style="color: #339933;">&gt;</span>Byte Hit Ratio <span style="color: #339933;">@</span> localhost<span style="color: #339933;">&lt;/</span>h1<span style="color: #339933;">&gt;</span>
YLegend<span style="color: #009900;">&#91;</span>cacheRequestByteRatio<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> <span style="color: #339933;">%</span>
ShortLegend<span style="color: #009900;">&#91;</span>cacheRequestByteRatio<span style="color: #009900;">&#93;</span><span style="color: #339933;">:%</span>
LegendI<span style="color: #009900;">&#91;</span>cacheRequestByteRatio<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> Median Hit Ratio <span style="color: #009900;">&#40;</span>5min<span style="color: #009900;">&#41;</span><span style="color: #339933;">&amp;</span>nbsp<span style="color: #339933;">;</span>
LegendO<span style="color: #009900;">&#91;</span>cacheRequestByteRatio<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> Median Hit Ratio <span style="color: #009900;">&#40;</span>60min<span style="color: #009900;">&#41;</span><span style="color: #339933;">&amp;</span>nbsp<span style="color: #339933;">;</span>
Legend1<span style="color: #009900;">&#91;</span>cacheRequestByteRatio<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> Median Hit Ratio
Legend2<span style="color: #009900;">&#91;</span>cacheRequestByteRatio<span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span> Median Hit Ratio</pre></div></div>

<p>จริงๆ มันมีอีกเพียบเลย แต่ไม่รู้จะใส่ไว้ทำไม รก</p>
]]></content:encoded>
			<wfw:commentRss>http://www.icez.net/blog/369/mrtg-%e0%b8%aa%e0%b8%b3%e0%b8%ab%e0%b8%a3%e0%b8%b1%e0%b8%9a%e0%b8%88%e0%b8%b1%e0%b8%9a%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%97%e0%b8%b3%e0%b8%87%e0%b8%b2%e0%b8%99%e0%b8%82%e0%b8%ad%e0%b8%87-squid/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<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>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Served from: www.icez.net @ 2012-02-10 18:49:30 -->
