<?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"
	>

<channel>
	<title>How to Config</title>
	<atom:link href="http://www.howtoconfig.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.howtoconfig.com</link>
	<description>how to config - how to configure</description>
	<pubDate>Mon, 01 Sep 2008 05:18:35 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
	<language>en</language>
			<item>
		<title>Check Transparent Proxy</title>
		<link>http://www.howtoconfig.com/os/debian/check-transparent-proxy.html</link>
		<comments>http://www.howtoconfig.com/os/debian/check-transparent-proxy.html#comments</comments>
		<pubDate>Mon, 01 Sep 2008 05:18:35 +0000</pubDate>
		<dc:creator>อัทศักดิ์ วงศ์กิตตะ</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<category><![CDATA[FreeBSD]]></category>

		<category><![CDATA[Shell script]]></category>

		<category><![CDATA[debian]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Proxy]]></category>

		<category><![CDATA[Squid]]></category>

		<category><![CDATA[Transparent]]></category>

		<category><![CDATA[TransparentProxy]]></category>

		<guid isPermaLink="false">http://www.howtoconfig.com/?p=43</guid>
		<description><![CDATA[คือมี case ที่ต้องทำ transparent proxy ครับ  แต่ว่าเวลา proxy มีปัญหา ผมอยากให้ทำการ ปลด proxy ออกเอง  ผมเลยเขียน shell script  มาเพื่อทำการ ตรวจสอบว่า proxy ทำได้หรือเปล่า ถ้าทำงานได้ ก็จะเพิ่ม iptables  ทำการสร้าง DNAT  ไปยังเครื่อง Proxy ครับ

หลักกาารง่ายๆคือ  จะใช้ curl แล้ว set proxy เป็นเครื่อง Proxy ที่เรากำหนด   เสร็จแล้วก็ให้ curl ทำการ connect ไปยัง web ปลายทาง   ถ้า connect ได้ content ที่ return มาจาก curl จะมากกว่า 0    และทำให้ script [...]]]></description>
			<content:encoded><![CDATA[<p>คือมี case ที่ต้องทำ transparent proxy ครับ  แต่ว่าเวลา proxy มีปัญหา ผมอยากให้ทำการ ปลด proxy ออกเอง  ผมเลยเขียน shell script  มาเพื่อทำการ ตรวจสอบว่า proxy ทำได้หรือเปล่า ถ้าทำงานได้ ก็จะเพิ่ม iptables  ทำการสร้าง DNAT  ไปยังเครื่อง Proxy ครับ</p>
<p><span id="more-43"></span></p>
<p>หลักกาารง่ายๆคือ  จะใช้ curl แล้ว set proxy เป็นเครื่อง Proxy ที่เรากำหนด   เสร็จแล้วก็ให้ curl ทำการ connect ไปยัง web ปลายทาง   ถ้า connect ได้ content ที่ return มาจาก curl จะมากกว่า 0    และทำให้ script เพิ่ม iptables  เข้าไปครับผม</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;">#	Check Proxy	v.10</span>
<span style="color: #666666; font-style: italic;">#	By Auttasak Wongkitta</span>
<span style="color: #666666; font-style: italic;">#	http://howtoconfig.com</span>
&nbsp;
<span style="color: #007800;">PROXY=</span><span style="color: #ff0000;">&quot;192.168.100.254:3128&quot;</span>
<span style="color: #007800;">URL=</span><span style="color: #ff0000;">&quot;http://manager.co.th&quot;</span>
<span style="color: #007800;">LINUX_IP=</span><span style="color: #ff0000;">&quot;192.168.100.254&quot;</span>
<span style="color: #007800;">LINUX_IF=</span><span style="color: #ff0000;">&quot;eth2.1&quot;</span>
&nbsp;
<span style="color: #007800;">RESULT=</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span>curl -x <span style="color: #007800;">$PROXY</span>  <span style="color: #007800;">$URL</span> <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&amp;</span>gt;<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">wc</span> -l<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">USEPROXY=</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span>iptables -t nat -L PREROUTING -n <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #007800;">$PROXY</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">wc</span> -l<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$RESULT</span> -eq <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$USEPROXY</span> -ne <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
                iptables -t nat -D PREROUTING -i <span style="color: #007800;">$LINUX_IF</span> -d <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #007800;">$LINUX_IP</span> -p tcp --dport http -j DNAT --to <span style="color: #007800;">$PROXY</span>
        <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">else</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$USEPROXY</span> -eq <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
                iptables -t nat -A PREROUTING -i <span style="color: #007800;">$LINUX_IF</span> -d <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #007800;">$LINUX_IP</span> -p tcp --dport http -j DNAT --to <span style="color: #007800;">$PROXY</span>
        <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.howtoconfig.com/os/debian/check-transparent-proxy.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>พรบ. การกระทำความผิดเกี่ยวกับคอมพิวเตอร์ - Revert Proxy Log Rotate</title>
		<link>http://www.howtoconfig.com/os/debian/revert_proxy_log_rotate.html</link>
		<comments>http://www.howtoconfig.com/os/debian/revert_proxy_log_rotate.html#comments</comments>
		<pubDate>Sat, 23 Aug 2008 19:19:50 +0000</pubDate>
		<dc:creator>อัทศักดิ์ วงศ์กิตตะ</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<category><![CDATA[Shell script]]></category>

		<category><![CDATA[debian]]></category>

		<category><![CDATA[Apache]]></category>

		<category><![CDATA[Log]]></category>

		<category><![CDATA[Proxy]]></category>

		<category><![CDATA[Revert]]></category>

		<category><![CDATA[Rotate]]></category>

		<category><![CDATA[Squid]]></category>

		<category><![CDATA[พรบ]]></category>

		<guid isPermaLink="false">http://www.howtoconfig.com/?p=39</guid>
		<description><![CDATA[ตามที่ พรบ  ได้กำหนดให้ &#8220;ผู้ให้บริการ&#8221; เก็บ log การใช้บริการ   โชคดีที่ผมมี Revert Proxy วางไว้หน้า Web Server  ทำให้สามารถเก็บ Log ได้ง่ายหน่อย   ตัว script ที่ผมเขียนนี้ จะทำการ rotate log และ compress log ไว้    ใน version ต่อไป จะทำการ ftp ไปไว้ยัง Log Server  อื่น แทนครับ 


#!/bin/sh
#
#    Howtoconfig.com
#    Squid Log Rotate v0.1
#    By Mr. Auttasak Wongkitta
&#160;
SQUID_CONF=&#34;/etc/squid/squid.conf&#34;
COMPRESS=yes
LOG=&#34;/var/log/backup_log&#34;
&#160;
###############################
DATE=$&#40;date &#34;+%Y%m%d-%H&#34;&#41;
HOSTNAME=$&#40;hostname -s&#41;
SQUID_PATH=$&#40;whereis squid &#124; awk '{print $2}'&#41;
&#160;
SQUID_LOG=$&#40;cat $SQUID_CONF &#124; [...]]]></description>
			<content:encoded><![CDATA[<p>ตามที่ พรบ  ได้กำหนดให้ &#8220;ผู้ให้บริการ&#8221; เก็บ log การใช้บริการ   โชคดีที่ผมมี Revert Proxy วางไว้หน้า Web Server  ทำให้สามารถเก็บ Log ได้ง่ายหน่อย   ตัว script ที่ผมเขียนนี้ จะทำการ rotate log และ compress log ไว้    ใน version ต่อไป จะทำการ ftp ไปไว้ยัง Log Server  อื่น แทนครับ <img src='http://www.howtoconfig.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<span id="more-39"></span></p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;">#    Howtoconfig.com</span>
<span style="color: #666666; font-style: italic;">#    Squid Log Rotate v0.1</span>
<span style="color: #666666; font-style: italic;">#    By Mr. Auttasak Wongkitta</span>
&nbsp;
<span style="color: #007800;">SQUID_CONF=</span><span style="color: #ff0000;">&quot;/etc/squid/squid.conf&quot;</span>
<span style="color: #007800;">COMPRESS=</span>yes
<span style="color: #007800;">LOG=</span><span style="color: #ff0000;">&quot;/var/log/backup_log&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">###############################</span>
<span style="color: #007800;">DATE=</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">date</span> <span style="color: #ff0000;">&quot;+%Y%m%d-%H&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">HOSTNAME=</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">hostname</span> -s<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">SQUID_PATH=</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">whereis</span> squid <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $2}'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #007800;">SQUID_LOG=</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #007800;">$SQUID_CONF</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;^access_log&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $2}'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> -z <span style="color: #007800;">$SQUID_LOG</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot; * Error : access_log not found!!!&quot;</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #007800;">SQUID_LOG_NEW=</span><span style="color: #ff0000;">&quot;$SQUID_LOG-$HOSTNAME-$DATE&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">###############################</span>
Log<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">&#123;</span>
<span style="color: #7a0874; font-weight: bold;">local</span> LogText;
<span style="color: #007800;">LogText=</span><span style="color: #ff0000;">&quot;$@&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #ff0000;">&quot;%d/%m/%y %T&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>  <span style="color: #ff0000;">&quot;   &quot;</span> <span style="color: #007800;">$LogText</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt;<span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #007800;">$LOG</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #666666; font-style: italic;">###############################</span>
<span style="color: #666666; font-style: italic;">###############################</span>
Log <span style="color: #ff0000;">&quot;&quot;</span>
Log <span style="color: #ff0000;">&quot;&quot;</span>
Log <span style="color: #ff0000;">&quot;--------------------------------------------&quot;</span>
Log <span style="color: #ff0000;">&quot;Squid log rotate - startup&quot;</span>
Log <span style="color: #ff0000;">&quot;&quot;</span>
&nbsp;
Log <span style="color: #ff0000;">&quot;Rotate Log&quot;</span>
<span style="color: #007800;">$SQUID_PATH</span> -k rotate
Log <span style="color: #ff0000;">&quot;done&quot;</span>
Log <span style="color: #ff0000;">&quot;&quot;</span>
&nbsp;
Log <span style="color: #ff0000;">&quot;Loop check $SQUID_LOG.0&quot;</span>
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> -f <span style="color: #007800;">$SQUID_LOG</span>.<span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">do</span>
<span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">1</span>;
<span style="color: #000000; font-weight: bold;">done</span>
Log <span style="color: #ff0000;">&quot;done&quot;</span>
Log <span style="color: #ff0000;">&quot;&quot;</span>
&nbsp;
Log <span style="color: #ff0000;">&quot;Move $SQUID_LOG.0 $SQUID_LOG_NEW&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #007800;">$SQUID_LOG</span>.<span style="color: #000000;">0</span> <span style="color: #007800;">$SQUID_LOG_NEW</span>
Log <span style="color: #ff0000;">&quot;done&quot;</span>
Log <span style="color: #ff0000;">&quot;&quot;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> -f <span style="color: #007800;">$SQUID_LOG_NEW</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
Log <span style="color: #ff0000;">&quot;MD5 Sum : $SQUID_LOG_NEW&quot;</span>
<span style="color: #007800;">SQUID_MD5=</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span>md5sum <span style="color: #007800;">$SQUID_LOG_NEW</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $1}'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
Log <span style="color: #ff0000;">&quot;Checksum : $SQUID_MD5&quot;</span>
Log <span style="color: #ff0000;">&quot;done&quot;</span>
Log <span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$COMPRESS</span>==<span style="color: #ff0000;">'yes'</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
Log <span style="color: #ff0000;">&quot;Compress log $SQUID_LOG_NEW&quot;</span>
<span style="color: #007800;">SIZE_OLD=</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">ls</span> -sh <span style="color: #007800;">$SQUID_LOG_NEW</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $1}'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #c20cb9; font-weight: bold;">tar</span> jpcf <span style="color: #007800;">$SQUID_LOG_NEW</span>.<span style="color: #c20cb9; font-weight: bold;">tar</span>.bz2 <span style="color: #007800;">$SQUID_LOG_NEW</span> <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&amp;</span>gt;<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null
<span style="color: #007800;">SIZE_NEW=</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">ls</span> -sh <span style="color: #007800;">$SQUID_LOG_NEW</span>.<span style="color: #c20cb9; font-weight: bold;">tar</span>.bz2 <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $1}'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
Log <span style="color: #ff0000;">&quot;Compress from $SIZE_OLD -&amp;gt; $SIZE_NEW&quot;</span>
Log <span style="color: #ff0000;">&quot;done&quot;</span>
Log <span style="color: #ff0000;">&quot;&quot;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> -f <span style="color: #007800;">$SQUID_LOG_NEW</span>.<span style="color: #c20cb9; font-weight: bold;">tar</span>.bz2 <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
Log <span style="color: #ff0000;">&quot;Remove file : $SQUID_LOG_NEW&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #007800;">$SQUID_LOG_NEW</span>
Log <span style="color: #ff0000;">&quot;done&quot;</span>
Log <span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
Log <span style="color: #ff0000;">&quot;&quot;</span>
Log <span style="color: #ff0000;">&quot;End&quot;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.howtoconfig.com/os/debian/revert_proxy_log_rotate.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>Apache 2.0 - Name Base VHost</title>
		<link>http://www.howtoconfig.com/os/freebsd/apache-20-name-base-vhost.html</link>
		<comments>http://www.howtoconfig.com/os/freebsd/apache-20-name-base-vhost.html#comments</comments>
		<pubDate>Mon, 21 Jul 2008 19:06:14 +0000</pubDate>
		<dc:creator>อัทศักดิ์ วงศ์กิตตะ</dc:creator>
		
		<category><![CDATA[FreeBSD]]></category>

		<category><![CDATA[Apache]]></category>

		<category><![CDATA[IP Base Vhost]]></category>

		<category><![CDATA[Name Base Vhost]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Vhost]]></category>

		<guid isPermaLink="false">http://www.howtoconfig.com/?p=34</guid>
		<description><![CDATA[พอไปอ่านกระทู้ใน thaibsd.com  เลยกะต่อยอดเล็กน้อย  หลังจากที่ติดตั้ง &#8220;Apache2.0 + PHP5 on FreeBSD&#8221;  ก็ถึงครามาทำ Name Base Vhost  ในรูปแบบของผม  พูดถึงเรื่อง Vhosts  มันทำได้หลายแบบ  แต่ที่เราทำกันบ่อยๆก็  Name Base Host และ IP Base VHost
อะไรคือ &#8220;Name Base Vhost&#8221;    ขอกล่าวถึง HTTP Protocol  ละกันครับ  เวลาที่ IE, Firefox ในเครื่องเ้้ราซึ่งเค้าเรียกรวมกันว่า  Browser   เข้าไปเว็บๆหนึ่ง เช่น [...]]]></description>
			<content:encoded><![CDATA[<p>พอไปอ่านกระทู้ใน thaibsd.com  เลยกะต่อยอดเล็กน้อย  หลังจากที่ติดตั้ง &#8220;<a href="http://www.howtoconfig.com/os/freebsd/apache20-php5-on-freebsd.html">Apache2.0 + PHP5 on FreeBSD</a>&#8221;  ก็ถึงครามาทำ Name Base Vhost  ในรูปแบบของผม  พูดถึงเรื่อง Vhosts  มันทำได้หลายแบบ  แต่ที่เราทำกันบ่อยๆก็  Name Base Host และ IP Base VHost</p>
<p>อะไรคือ &#8220;Name Base Vhost&#8221;    ขอกล่าวถึง HTTP Protocol  ละกันครับ  เวลาที่ IE, Firefox ในเครื่องเ้้ราซึ่งเค้าเรียกรวมกันว่า  Browser   เข้าไปเว็บๆหนึ่ง เช่น   เข้าไปที่  http://howtoconfig.com/index.php    Browser ของเราก็จะสร้าง tcp connect ไปยัง IP ปลายทาง  port 80  และส่ง<br />
<span id="more-34"></span></p>
<address style="padding-left: 30px;">GET /index.php HTTP/1.0</address>
<address style="padding-left: 30px;"> HOST: howtoconfig.com</address>
<p>ตรงนี้เค้าเรียนว่า Header   เวลา Server ได้รับ ก็จะส่ง  กลับมาว่า</p>
<address style="padding-left: 30px;">HTTP/1.1 301 Moved Permanently</address>
<address style="padding-left: 30px;"> Date: Mon, 21 Jul 2008 18:39:42 GMT</address>
<address style="padding-left: 30px;"> Server: Apache/2.2.3 (CentOS)</address>
<address style="padding-left: 30px;"> X-Powered-By: PHP/5.1.6</address>
<address style="padding-left: 30px;"> X-Pingback: http://www.howtoconfig.com/xmlrpc.php</address>
<address style="padding-left: 30px;"> Location: http://www.howtoconfig.com/</address>
<address style="padding-left: 30px;"> Content-Length: 0</address>
<address style="padding-left: 30px;"> Connection: close</address>
<address style="padding-left: 30px;"> Content-Type: text/html; charset=UTF-8</address>
<p>ส่วนนี้ก็ Header  ที่ Apache ตอบกลับมา   ถ้ามว่ามัน เกียวกัน ตรงไหน   ก็สังเกตุดี ที่  Browser ส่ง Request ไป จะมี HOST: howtoconfig.com  ไปด้วย  เวลา apache ได้รับ Request ก็จะไปตรวจสอบที่ httpd.conf  ว่ามีการทำ Vhost ไว้หรือไม่ ถ้ามีและชื่อ ตรงก็จะเปลี่ยน DocumetRoot ไปยัง ที่กำหนดไว้และ เอา Content ส่งไปยัง Broswer ต่อไป</p>
<p>อะไรคือ &#8220;IP Base VHost&#8221;    มันก็เหมือนกะ Name Base Vhost แหละครับ แต่ Apache จะสนใจแค่ IP ที่ Client วิ่งเข้ามา  ถ้าตรงกะ Vhost ที่ Config ไว้ระบบก็จะเปลีั่ยน DocumetRoot ไปยังที่กำหนด</p>
<p>อ่านมามาก มาสู่การทำงาน จริงๆ    ผมได้ติดตั้ง Apache2.0 + PHP5 จาก Ports  เพราะเวลาลงอะไรต่อๆไป จะได้ง่าย และสะดวกเวลา Upgrade PHP    ในเมื่อ FreeBSD ออกแบบระบบ Ports มาให้ดีแล้ว เราก็ต้องใช้มัน    เวลาผมลง จะ ไม่ยุ่งเกี่ยวกะไฟล์ httpd.conf เลยแต่จะสร้างไฟล์   /usr/local/etc/apache2/Includes/0default.conf  แทนเพราะ apache2.0 ใน FreeBSD  จะทำการ Include Includes/*.conf  มาเอง ทำให้เราแก้ไขแค่ใน  Includes/*.conf ก็พอ</p>
<p>แนะนำให้ไปอ่าน &#8220;<a href="http://www.howtoconfig.com/os/freebsd/apache20-php5-on-freebsd.html">Apache2.0 + PHP5 on FreeBSD</a>&#8221;  ก่อนนะครับ</p>
<p>การทำ Name Base Vhost   โดย Domain ชื่อ   abc.com  และเก็บเว็บไว้ที่  /home/vhosts/abc.com  เราก็ทำการสร้างไฟล์</p>

<div class="wp_syntax"><div class="code"><pre>vi /usr/local/etc/apache2/Includes/abc.com.conf</pre></div></div>


<div class="wp_syntax"><div class="code"><pre>ServerName    abc.com
ServerAlias    www.abc.com
DocumentRoot    /home/vhosts/abc.com/httpdocs
CustomLog        /home/vhosts/abc.com/logs/access_log combined
ErrorLog        /home/vhosts/abc.com/logs/error_log
&nbsp;
AllowOverride All
Options SymLinksIfOwnerMatch
Order allow,deny
Allow from all</pre></div></div>

<p>ส่วนของ IP Base Vhost ก็เหมือนกันครับแต่เราต้องทำการ สร้าง Aliase IP ก่อน ที่ไฟล์ rc.conf เช่น</p>

<div class="wp_syntax"><div class="code"><pre>vi /etc/rc.conf</pre></div></div>


<div class="wp_syntax"><div class="code"><pre>defaultrouter=&quot;192.168.1.1&quot;
hostname=&quot;kumandtong.siambox.com&quot;
ifconfig_rl0=&quot;inet 192.168.1.1  netmask 255.255.255.0&quot;
ifconfig_rl0_alias0=&quot;inet 192.168.1.2  netmask 255.255.255.255</pre></div></div>

<p>เราก็สร้างไฟล์ apache</p>

<div class="wp_syntax"><div class="code"><pre>vi /usr/local/etc/apach2/Includes/192.168.1.2.conf</pre></div></div>


<div class="wp_syntax"><div class="code"><pre>DocumentRoot    /home/vhosts/ip-2/httpdocs
CustomLog        /home/vhosts/ip-2/logs/access_log combined
ErrorLog        /home/vhosts/ip-2/logs/error_log
&nbsp;
AllowOverride All
Options SymLinksIfOwnerMatch
Order allow,deny
Allow from all</pre></div></div>

<p>ง่ายปะครับ  ไอ้คนที่เคยทำบ่อยๆอย่างผม ก็พูดได้ว่าง่ายๆ  แต่คนที่ไม่ค่อยได้ setup นี้สิ   ไงก็ลองเอาวิธี setup ของผมไปละกันนะครับ  น่าจะช่วยเพื่อนๆได้ <img src='http://www.howtoconfig.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.howtoconfig.com/os/freebsd/apache-20-name-base-vhost.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>วิธีติดตั้ง Reverse Proxy ด้วย Squid</title>
		<link>http://www.howtoconfig.com/os/ubuntu/how-to-implement-squid-reverse-proxy.html</link>
		<comments>http://www.howtoconfig.com/os/ubuntu/how-to-implement-squid-reverse-proxy.html#comments</comments>
		<pubDate>Fri, 11 Jul 2008 12:25:40 +0000</pubDate>
		<dc:creator>กวิน ชัยเลิศ</dc:creator>
		
		<category><![CDATA[CentOS]]></category>

		<category><![CDATA[FreeBSD]]></category>

		<category><![CDATA[debian]]></category>

		<category><![CDATA[ubuntu]]></category>

		<category><![CDATA[centos]]></category>

		<category><![CDATA[HTTP traffic]]></category>

		<category><![CDATA[httpd-accelerator]]></category>

		<category><![CDATA[Implement]]></category>

		<category><![CDATA[Proxy]]></category>

		<category><![CDATA[Reverse Proxy]]></category>

		<category><![CDATA[Squid]]></category>

		<category><![CDATA[transparent cache]]></category>

		<guid isPermaLink="false">http://www.howtoconfig.com/?p=32</guid>
		<description><![CDATA[ในเบื่องต้นผมขอแนะนำให้รู้จัก Squid กันก่อนครับ
Squid เป็น Open Source Software ที่ให้บริการ Proxy caches ซึ่ง Squid สามารถติดตั้งให้ทำงานใน 3 รูปแบบหลักดังนี้
1. Standard Proxy Cache
ใช้สำหรับเก็บ cache ของ static web pages จำพวก html และรูปภาพ โดยทั่วไปมักจะถูกใช้งานใน network ภายในองค์กร โดยที่ web pages ต่างๆ ที่ถูกเรียกผ่าน local network เป็นครั้งที่สอง web browser จะแสดงผล web pages นั้นผ่าน proxy cache แทนที่ไปดึงข้อมูลจาก web server มาแสดงผล (ประหยัด bandwidth และเพิ่มความเร็วในการแสดงผล)
2. Transparent Cache
ความสามารถหลักๆ เหมือนกับการติดตั้งแบบ [...]]]></description>
			<content:encoded><![CDATA[<p>ในเบื่องต้นผมขอแนะนำให้รู้จัก Squid กันก่อนครับ</p>
<p>Squid เป็น Open Source Software ที่ให้บริการ Proxy caches ซึ่ง Squid สามารถติดตั้งให้ทำงานใน 3 รูปแบบหลักดังนี้</p>
<p><strong>1. Standard Proxy Cache</strong><br />
ใช้สำหรับเก็บ cache ของ static web pages จำพวก html และรูปภาพ โดยทั่วไปมักจะถูกใช้งานใน network ภายในองค์กร โดยที่ web pages ต่างๆ ที่ถูกเรียกผ่าน local network เป็นครั้งที่สอง web browser จะแสดงผล web pages นั้นผ่าน proxy cache แทนที่ไปดึงข้อมูลจาก web server มาแสดงผล (ประหยัด bandwidth และเพิ่มความเร็วในการแสดงผล)</p>
<p><strong>2. Transparent Cache</strong><br />
ความสามารถหลักๆ เหมือนกับการติดตั้งแบบ standard proxy cache จะแตกต่างกันที่การติดตั้งแบบ transparent cache ไม่จำเป็นต้องปรับแต่ง web browser ให้สามารถใช้งาน proxy cache โดยที่ transparent cache จะทำหน้าที่คอยกรอง HTTP traffic (on port 80) แล้วตรวจสอบว่า request นั้นมีอยู่ใน cahce หรือไม่ ถ้าไม่มีก็จะทำการส่งต่อไปยัง web server ของ web pages นั้น (สำหรับ Linux การใช้งาน transparent cache จะใช้ควบคู่ไปกับ iptables ในการกรอง HTTP traffic)</p>
<p><strong>3. Reverse Proxy Cache</strong><br />
สำหรับ reverse proxy cache จะทำหน้าที่แตกต่างกับ standard และ transparent caches โดยที่ reverse proxy cache จะทำหน้าที่ลดภาระของ web server แทนที่การลด network bandwidth ของฝั่ง client กล่าวคือ reverse proxy cache ถูกติดตั้งอยู่หน้า web server (ระหว่าง internet และ web server) คอยจัดการ traffic ที่เกิดขึ้นทั้งหมดก่อนจะถึง web server ป้องกัน traffic ที่เพิ่มขึ้นโดยไม่พีงประสงค์ (ซึ่งอาจจะโดนโจมตีจาก hacker เป็นต้น) อีกทั้งยังลดภาระของ web server อีกทางนึง<br />
<img class="alignnone size-full image-33" title="reverse-proxy" src="http://www.howtoconfig.com/content/uploads/2008/07/reverse-proxy.gif" alt="" width="436" height="451" /><br />
<span id="more-32"></span><br />
สำหรับวิธีการติดตั้ง Reverse Proxy ด้วย Squid สามารถทำตามขั้นตอนต่อไปนี้ได้เลยครับ<br />
(ทำการติดตั้งบน CentOS 4.6)</p>
<p>ตรวจสอบว่าได้ติดตั้ง squid แล้วหรือยัง</p>

<div class="wp_syntax"><div class="code"><pre class="bash">rpm -qa<span style="color: #000000; font-weight: bold;">|</span>grep squid</pre></div></div>

<p>ถ้าได้ทำการติดตั้ง squid ไว้แล้วจะแสดงผลของคำสั้งตามตัวอย่างครับ</p>

<div class="wp_syntax"><div class="code"><pre class="text">[root@reverse ~]# rpm -qa|grep squid
squid-2.5.STABLE14-1.4E.el4_6.2
[root@reverse ~]#</pre></div></div>

<p>กรณียังไม่ได้ติดตั้งให้ใช้คำสั่ง yum install squid ได้เลยครับ</p>

<div class="wp_syntax"><div class="code"><pre class="bash">yum <span style="color: #c20cb9; font-weight: bold;">install</span> squid</pre></div></div>

<p>หลังจากทำการติดตั้ง squid เรียบร้อยแล้วให้ทำการปรับแต่งไฟล์ /etc/squid/squid.conf โดยแก้ไขเพิ่มเติม options เหล่านี้</p>

<div class="wp_syntax"><div class="code"><pre class="text">http_port 80 #Port ของ Squid
httpd_accel_host 192.168.0.2 #IP address ของ Web Server (แทนที่ public ip 203.101.102.1 ด้วย private ip 192.168.0.2)
httpd_accel_port 80 #Port ของ Web Server
httpd_accel_single_host on #Option on ใช้ในกรณีที่ต้องการติดตั้ง Reverse Proxy ไว้หน้า Web Server เดี่ยวๆ
httpd_accel_with_proxy on
httpd_accel_uses_host_header off</pre></div></div>

<p>เพียงเท่านี้ก็สามารถใช้งาน Reverse Proxy ได้แล้ว รับรองว่าสามารถลดภาระการทำงานของ Web Server แน่นอน<br />
หากเพื่อนๆ มีข้อสงสัยหรือข้อเสนอแนะ &#8230; ก็ comment ไว้ด้วยนะครับ</p>
]]></content:encoded>
			<wfw:commentRss>http://www.howtoconfig.com/os/ubuntu/how-to-implement-squid-reverse-proxy.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>แก้ปัญหาลืมรหัสผ่านของ FreeBSD</title>
		<link>http://www.howtoconfig.com/os/how-to-recovery-freebsd-root-password.html</link>
		<comments>http://www.howtoconfig.com/os/how-to-recovery-freebsd-root-password.html#comments</comments>
		<pubDate>Tue, 08 Jul 2008 05:05:19 +0000</pubDate>
		<dc:creator>กวิน ชัยเลิศ</dc:creator>
		
		<category><![CDATA[FreeBSD]]></category>

		<category><![CDATA[Operating System]]></category>

		<category><![CDATA[forgot password]]></category>

		<category><![CDATA[password]]></category>

		<category><![CDATA[พาสเวิร์ด]]></category>

		<category><![CDATA[รหัสผ่าน]]></category>

		<category><![CDATA[ลืมพาสเวิร์ด]]></category>

		<category><![CDATA[ลืมรหัสผ่าน]]></category>

		<guid isPermaLink="false">http://www.howtoconfig.com/?p=31</guid>
		<description><![CDATA[แก้ปัญหาลืมรหัสผ่านของ root บน FreeBSD ง่ายๆ ตามนี้ครับ
1. Restart FreeBSD (Ctrl+Alt+Delete หรือ กดปุ่ม Reset T_T)
2. พิมพ์ boot -s ที่ Boot: prompt (เพื่อเข้า Single User Mode)
3. Enter (ตอนมีคำถามให้เลือก Shell)
4. ใช้คำสั่ง mount -urw / เพื่อให้สามารถอ่าน/เขียน ไฟล์ได้

mount -urw /

5. ใช้คำสั่ง mount -a (remount ระบบไฟล์ทั้งหมด)

mount -a

6. ใช้คำสั่ง passwd root เพื่อเปลี่ยนรหัสผ่านของ root

passwd root

เพียงเท่านี้ก็สามารถกลับมาใช้ root ได้ตามปกติครับ
]]></description>
			<content:encoded><![CDATA[<p>แก้ปัญหาลืมรหัสผ่านของ root บน FreeBSD ง่ายๆ ตามนี้ครับ</p>
<p>1. Restart FreeBSD (Ctrl+Alt+Delete หรือ กดปุ่ม Reset T_T)<br />
2. พิมพ์ boot -s ที่ Boot: prompt (เพื่อเข้า Single User Mode)<br />
3. Enter (ตอนมีคำถามให้เลือก Shell)<br />
4. ใช้คำสั่ง mount -urw / เพื่อให้สามารถอ่าน/เขียน ไฟล์ได้</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span style="color: #c20cb9; font-weight: bold;">mount</span> -urw <span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>5. ใช้คำสั่ง mount -a (remount ระบบไฟล์ทั้งหมด)</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span style="color: #c20cb9; font-weight: bold;">mount</span> -a</pre></div></div>

<p>6. ใช้คำสั่ง passwd root เพื่อเปลี่ยนรหัสผ่านของ root</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span style="color: #c20cb9; font-weight: bold;">passwd</span> root</pre></div></div>

<p>เพียงเท่านี้ก็สามารถกลับมาใช้ root ได้ตามปกติครับ</p>
]]></content:encoded>
			<wfw:commentRss>http://www.howtoconfig.com/os/how-to-recovery-freebsd-root-password.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>ยกเลิก Blank Screen บน Linux Console</title>
		<link>http://www.howtoconfig.com/os/ubuntu/disable-screen-blanking-screen-going-blank-on-linux.html</link>
		<comments>http://www.howtoconfig.com/os/ubuntu/disable-screen-blanking-screen-going-blank-on-linux.html#comments</comments>
		<pubDate>Thu, 03 Jul 2008 05:39:18 +0000</pubDate>
		<dc:creator>กวิน ชัยเลิศ</dc:creator>
		
		<category><![CDATA[CentOS]]></category>

		<category><![CDATA[Operating System]]></category>

		<category><![CDATA[debian]]></category>

		<category><![CDATA[ubuntu]]></category>

		<category><![CDATA[blank screen]]></category>

		<category><![CDATA[centos]]></category>

		<category><![CDATA[concole]]></category>

		<category><![CDATA[linux console]]></category>

		<category><![CDATA[setterm]]></category>

		<category><![CDATA[X window]]></category>

		<guid isPermaLink="false">http://www.howtoconfig.com/?p=30</guid>
		<description><![CDATA[ไม่ยากใช่ไหมครับหากต้องการยกเลิก screen saver บน X window แต่สำหรับ text mode (linux console) ผมคิดว่าหลายๆ คนยังไม่เคยยกเลิก blank screen หรือกำลังหาทางยกเลิกมันอยู่ สำหรับผมแล้วการยกเลิก blank screen บน linux console นั้นมีประโยชน์มากครับ ยกตัวอย่างเช่น เราสามารถทำงานไปพร้อมๆ กันกับการ monitor ดู error หรือ log จากอีกจอนึง (กรณีมีจอ monitor มากกว่าหนึ่งจอ) โดยที่ไม่ต้องคอยกดคีย์บอร์ดหรือเลื่อนเมาส์เพื่อให้ linux console แสดงผลอยู่ตลอดเวลา
สำหรับวิธีการนั้นก็ไม่ได้ยุ่งยากเลยครับ แค่ใช้คำสั่ง setterm เท่านั้น

setterm -blank 0 -powersave off -powerdown 0 &#60; /dev/console &#62; /dev/console 2&#62;&#38;1

หากต้องการยกเลิก blank screen [...]]]></description>
			<content:encoded><![CDATA[<p>ไม่ยากใช่ไหมครับหากต้องการยกเลิก screen saver บน X window แต่สำหรับ text mode (linux console) ผมคิดว่าหลายๆ คนยังไม่เคยยกเลิก blank screen หรือกำลังหาทางยกเลิกมันอยู่ สำหรับผมแล้วการยกเลิก blank screen บน linux console นั้นมีประโยชน์มากครับ ยกตัวอย่างเช่น เราสามารถทำงานไปพร้อมๆ กันกับการ monitor ดู error หรือ log จากอีกจอนึง (กรณีมีจอ monitor มากกว่าหนึ่งจอ) โดยที่ไม่ต้องคอยกดคีย์บอร์ดหรือเลื่อนเมาส์เพื่อให้ linux console แสดงผลอยู่ตลอดเวลา</p>
<p>สำหรับวิธีการนั้นก็ไม่ได้ยุ่งยากเลยครับ แค่ใช้คำสั่ง setterm เท่านั้น</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span style="color: #c20cb9; font-weight: bold;">setterm</span> -blank <span style="color: #000000;">0</span> -powersave off -powerdown <span style="color: #000000;">0</span> <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>console <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>console <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span></pre></div></div>

<p>หากต้องการยกเลิก blank screen ทุกครั้งหลังจาก start linux ให้ทำการเพิ่มคำสั่งดังกล่าวในไฟล์ /etc/rc.local เพียงเท่านี้ก็ไม่ต้องคอยกดคีย์บอร์ดหรือเลื่อนเมาส์ทุกๆ 5 นาทีแล้วครับ</p>
]]></content:encoded>
			<wfw:commentRss>http://www.howtoconfig.com/os/ubuntu/disable-screen-blanking-screen-going-blank-on-linux.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>inittab หายไปไหนใน ubuntu 8.04</title>
		<link>http://www.howtoconfig.com/os/ubuntu/whereis-inittab-on-ubuntu-804.html</link>
		<comments>http://www.howtoconfig.com/os/ubuntu/whereis-inittab-on-ubuntu-804.html#comments</comments>
		<pubDate>Wed, 02 Jul 2008 09:25:19 +0000</pubDate>
		<dc:creator>กวิน ชัยเลิศ</dc:creator>
		
		<category><![CDATA[Operating System]]></category>

		<category><![CDATA[ubuntu]]></category>

		<category><![CDATA[inittab]]></category>

		<category><![CDATA[ubuntu 8.04]]></category>

		<category><![CDATA[upstart]]></category>

		<guid isPermaLink="false">http://www.howtoconfig.com/?p=29</guid>
		<description><![CDATA[หลายๆ คนอาจจะสงสัยว่าทำไมไม่มีไฟล์ /etc/inittab อยู่บน ubuntu 8.04 (ที่จริงมันหายไปตั้งแต่ ubuntu 6.10 แล้วละครับ) บางคนอาจจะคิดว่าติดตั้งผิดหรือเผลอลบไปตอนไหน อันที่จริงแล้ว /etc/inittab ไม่ได้หายไปหรอกครับเพียงแต่ ubuntu เปลี่ยนการใช้งาน /sbin/init daemon (System-V init) ไปเป็น Upstart แทน สำหรับผมแล้วรู่สึกว่าการใช้งาน System-V init มันง่ายกว่ากันเยอะเลย &#8230; ผมใช้งาน Upstart คล่องเมื่อไหร่จะมาเขียนให้เพื่อนๆ ได้อ่านกันอีกครั้ง
]]></description>
			<content:encoded><![CDATA[<p>หลายๆ คนอาจจะสงสัยว่าทำไมไม่มีไฟล์ /etc/inittab อยู่บน ubuntu 8.04 (ที่จริงมันหายไปตั้งแต่ ubuntu 6.10 แล้วละครับ) บางคนอาจจะคิดว่าติดตั้งผิดหรือเผลอลบไปตอนไหน อันที่จริงแล้ว /etc/inittab ไม่ได้หายไปหรอกครับเพียงแต่ ubuntu เปลี่ยนการใช้งาน /sbin/init daemon (System-V init) ไปเป็น <a href="http://upstart.ubuntu.com/">Upstart </a>แทน สำหรับผมแล้วรู่สึกว่าการใช้งาน System-V init มันง่ายกว่ากันเยอะเลย &#8230; ผมใช้งาน Upstart คล่องเมื่อไหร่จะมาเขียนให้เพื่อนๆ ได้อ่านกันอีกครั้ง</p>
]]></content:encoded>
			<wfw:commentRss>http://www.howtoconfig.com/os/ubuntu/whereis-inittab-on-ubuntu-804.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>จัดเก็บ Logs ของ ADSL Router ด้วย syslog บน CentOS</title>
		<link>http://www.howtoconfig.com/os/centos-syslog-zyxel-p660hw-t1.html</link>
		<comments>http://www.howtoconfig.com/os/centos-syslog-zyxel-p660hw-t1.html#comments</comments>
		<pubDate>Wed, 25 Jun 2008 09:36:31 +0000</pubDate>
		<dc:creator>กวิน ชัยเลิศ</dc:creator>
		
		<category><![CDATA[CentOS]]></category>

		<category><![CDATA[Networking]]></category>

		<category><![CDATA[Operating System]]></category>

		<category><![CDATA[adsl]]></category>

		<category><![CDATA[centos]]></category>

		<category><![CDATA[logs]]></category>

		<category><![CDATA[p660hw-t1]]></category>

		<category><![CDATA[router]]></category>

		<category><![CDATA[syslog]]></category>

		<category><![CDATA[zyxel]]></category>

		<category><![CDATA[zyxel p660hw-t1]]></category>

		<guid isPermaLink="false">http://www.howtoconfig.com/?p=27</guid>
		<description><![CDATA[แค่ออกแรงปรับแต่ง ADSL Router (ZyXel P660HW-T1) กับ syslog บน CentOS เพิ่มเติมอีกนิดก็จะสามารถจัดเก็บ Logs ของ ADSL Router ได้แล้วครับ
ขั้นแรกทำการแก้ไข file &#8220;/etc/sysconfig/syslog&#8221; โดยเพิ่ม -r เข้าไปที่ SYSLOGD_OPTIONS ซึ่งเดิมๆ จะเป็นตามนี้ครับ

SYSLOGD_OPTIONS=&#34;-m 0&#34;

หลังจากทำการแก้ไข

SYSLOGD_OPTIONS=&#34;-r -m 0&#34;

เพิ่ม -r เข้าไปยัง SYSLOGD_OPTIONS เพื่อจะบอกให้ syslog daemon ยอมรับ logs จากเครื่องหรืออุปกรณ์อื่นๆ
จากนั้นเพิ่ม config เข้าไปใน file &#8220;/etc/syslog.conf&#8221; ตามนี้ครับ

local2.*                [...]]]></description>
			<content:encoded><![CDATA[<p>แค่ออกแรงปรับแต่ง ADSL Router (ZyXel P660HW-T1) กับ syslog บน CentOS เพิ่มเติมอีกนิดก็จะสามารถจัดเก็บ Logs ของ ADSL Router ได้แล้วครับ</p>
<p>ขั้นแรกทำการแก้ไข file &#8220;/etc/sysconfig/syslog&#8221; โดยเพิ่ม -r เข้าไปที่ SYSLOGD_OPTIONS ซึ่งเดิมๆ จะเป็นตามนี้ครับ</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span style="color: #007800;">SYSLOGD_OPTIONS=</span><span style="color: #ff0000;">&quot;-m 0&quot;</span></pre></div></div>

<p>หลังจากทำการแก้ไข</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span style="color: #007800;">SYSLOGD_OPTIONS=</span><span style="color: #ff0000;">&quot;-r -m 0&quot;</span></pre></div></div>

<p><span style="color: #ff0000;">เพิ่ม -r เข้าไปยัง SYSLOGD_OPTIONS เพื่อจะบอกให้ syslog daemon ยอมรับ logs จากเครื่องหรืออุปกรณ์อื่นๆ</span></p>
<p><span id="more-27"></span>จากนั้นเพิ่ม config เข้าไปใน file &#8220;/etc/syslog.conf&#8221; ตามนี้ครับ</p>

<div class="wp_syntax"><div class="code"><pre class="bash">local2.<span style="color: #000000; font-weight: bold;">*</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>zyxel-p660hw.log</pre></div></div>

<p>คราวนี้ย้ายจาก CentOS มาจัดการกับ ZyXEL P660HW-T1 กันครับ</p>

<div class="wp_syntax"><div class="code"><pre class="text">1. telnet ZyXel-IP-Address
2. Select Number 24 -&amp;gt; 3 -&amp;gt; 2 (24.System Maintenance, 3.Log ans Trace, 2.Unix Syslog)
UNIX Syslog:
Active= Yes
Syslog IP Address= ZyXel-IP-Address
Log Facility= Local 2</pre></div></div>

<p><span style="color: #ff0000;">Log Facility ต้องมีค่าเท่ากันกับ config ที่ได้เพิ่มเข้าไปในfile &#8220;/etc/syslog.conf&#8221; ที่ผ่านไปเมื่อครู่นี้ครับ โดยปกติจะมีค่าอยู่ระหว่าง Local 1 - Local 7</span></p>
<p>เพียงเท่านี้ก็สามารถจัดเก็บ Logs ของ ADSL Router ด้วย syslog บน CentOS ได้แล้วครับ <em>(อย่าลืม restart syslog ด้วยนะครับ)</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.howtoconfig.com/os/centos-syslog-zyxel-p660hw-t1.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>เปลี่ยน default editor บน ubuntu</title>
		<link>http://www.howtoconfig.com/os/ubuntu/change-default-editor-on-ubuntu.html</link>
		<comments>http://www.howtoconfig.com/os/ubuntu/change-default-editor-on-ubuntu.html#comments</comments>
		<pubDate>Tue, 24 Jun 2008 10:32:48 +0000</pubDate>
		<dc:creator>กวิน ชัยเลิศ</dc:creator>
		
		<category><![CDATA[Operating System]]></category>

		<category><![CDATA[ubuntu]]></category>

		<category><![CDATA[debian]]></category>

		<category><![CDATA[default editor]]></category>

		<category><![CDATA[hardy]]></category>

		<category><![CDATA[nano]]></category>

		<category><![CDATA[pine]]></category>

		<category><![CDATA[sysadmin]]></category>

		<category><![CDATA[system administrator]]></category>

		<category><![CDATA[ubuntu 8.04 hardy]]></category>

		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://www.howtoconfig.com/?p=25</guid>
		<description><![CDATA[จากประสบการณ์ที่ผ่านมา default editor บน linux และ *bsd มักจะเป็น vi ซึ่งตามปกติแล้ว system administrator (sysadmin) จำเป็นต้องใช้ default editor ของ os ในหลายๆ เหตุการณ์ เช่น ใช้ในคำสั่ง crontab เป็นต้น
หลังจากที่ติดตั้ง Ubuntu 8.04 hardy ก็พบว่า default editor ไม่ใช่ vi ที่ผมคุ้นเคย กลับกลายเป็น nano editor หน้าตาเหมือนกับ pineapple สมัยที่ linux ยังไม่เฟื่องฟู (pine e-mail client) ไม่รู้ว่าคนแก่แถวๆ นี้มีใครนิยมกิน pine บ้างครับ &#8230; เพื่อไม่ให้ยืดเยื้อไปกว่านี้ เรามาเปลี่ยน default editor บน ubuntu [...]]]></description>
			<content:encoded><![CDATA[<p>จากประสบการณ์ที่ผ่านมา default editor บน linux และ *bsd มักจะเป็น vi ซึ่งตามปกติแล้ว system administrator (sysadmin) จำเป็นต้องใช้ default editor ของ os ในหลายๆ เหตุการณ์ เช่น ใช้ในคำสั่ง crontab เป็นต้น</p>
<p>หลังจากที่ติดตั้ง Ubuntu 8.04 hardy ก็พบว่า default editor ไม่ใช่ vi ที่ผมคุ้นเคย กลับกลายเป็น nano editor หน้าตาเหมือนกับ pineapple สมัยที่ linux ยังไม่เฟื่องฟู (pine e-mail client) ไม่รู้ว่าคนแก่แถวๆ นี้มีใครนิยมกิน pine บ้างครับ &#8230; เพื่อไม่ให้ยืดเยื้อไปกว่านี้ เรามาเปลี่ยน default editor บน ubuntu กันดีกว่าครับ</p>
<p><span id="more-25"></span><br />
แปลงร่างเป็น root หรือใครถนัดใช้ sudo ก็ข้ามไปใช้ sudo ตามสะดวกครับ</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span style="color: #c20cb9; font-weight: bold;">su</span> -</pre></div></div>

<p>ทีนี้ก็เปลี่ยน default editor ตามนี้ครับ</p>

<div class="wp_syntax"><div class="code"><pre class="bash">update-alternatives --config editor</pre></div></div>

<blockquote><p>
There are 4 alternatives which provide `editor&#8217;.</p>
<p>  Selection    Alternative<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
          1    /usr/bin/vim.tiny<br />
          2    /bin/ed<br />
 +        3    /bin/nano<br />
*         4    /usr/bin/vim.basic</p>
<p>Press enter to keep the default[*], or type selection number:
</p></blockquote>
<p>แฟนพันธุ์ vi ก็ต้องเลือกหมายเลข 4 อยู่แล้ว &#8230; เพื่อนๆ เลือกหมายเลขอะไรกันครับ</p>
]]></content:encoded>
			<wfw:commentRss>http://www.howtoconfig.com/os/ubuntu/change-default-editor-on-ubuntu.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>ติดตั้ง Linux ผ่าน Network ด้วย PXE Server</title>
		<link>http://www.howtoconfig.com/os/ubuntu/network-install-via-pxe-server.html</link>
		<comments>http://www.howtoconfig.com/os/ubuntu/network-install-via-pxe-server.html#comments</comments>
		<pubDate>Fri, 20 Jun 2008 17:41:01 +0000</pubDate>
		<dc:creator>กวิน ชัยเลิศ</dc:creator>
		
		<category><![CDATA[CentOS]]></category>

		<category><![CDATA[Operating System]]></category>

		<category><![CDATA[debian]]></category>

		<category><![CDATA[ubuntu]]></category>

		<category><![CDATA[centos]]></category>

		<category><![CDATA[dhcp]]></category>

		<category><![CDATA[httpd]]></category>

		<category><![CDATA[install]]></category>

		<category><![CDATA[intel]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[network booting]]></category>

		<category><![CDATA[network install]]></category>

		<category><![CDATA[open standard]]></category>

		<category><![CDATA[PXE]]></category>

		<category><![CDATA[syslinux]]></category>

		<category><![CDATA[tftp-server]]></category>

		<guid isPermaLink="false">http://www.howtoconfig.com/?p=24</guid>
		<description><![CDATA[มาทำความรู้รักกับ PXE กันก่อนครับ
PXE หรือ Preboot eXecution Environment เป็น Open Standard ที่พัฒนาขึ้นโดย Intel ซึ่ง PXE นี้จะยอมให้ Computer ต่างๆ (Server, PC, Laptop, Notebook ที่ BIOS ลองรับ PXE Booting) สามารถ boot ผ่าน network ได้ไม่ต้องง้อ floppy, cd หรือ dvd กันเลยทีเดียว (มันสุดยอดจริงๆ ครับ)
มาลุยกันเลยครับ
Server : CentOS 5.1 + dhcp + tftp-server + httpd + syslinux
Client : Ubuntu 8.04
เอาเป็นว่าทุกๆ ท่านติดตั้ง CentOS ไว้เป็นที่เรียบร้อย [...]]]></description>
			<content:encoded><![CDATA[<p><strong>มาทำความรู้รักกับ PXE กันก่อนครับ</strong><br />
<span style="color: #0000ff;">PXE</span> หรือ <span style="color: #0000ff;">P</span>reboot e<span style="color: #0000ff;">X</span>ecution <span style="color: #0000ff;">E</span>nvironment เป็น Open Standard ที่พัฒนาขึ้นโดย Intel ซึ่ง PXE นี้จะยอมให้ Computer ต่างๆ (Server, PC, Laptop, Notebook ที่ BIOS ลองรับ PXE Booting) สามารถ boot ผ่าน network ได้ไม่ต้องง้อ floppy, cd หรือ dvd กันเลยทีเดียว (มันสุดยอดจริงๆ ครับ)</p>
<p>มาลุยกันเลยครับ<br />
Server : CentOS 5.1 + dhcp + tftp-server + httpd + syslinux<br />
Client : Ubuntu 8.04</p>
<p>เอาเป็นว่าทุกๆ ท่านติดตั้ง CentOS ไว้เป็นที่เรียบร้อย ทีนี้ก็เป็นขั้นตอนการติดตั้ง PXE Server ละครับ</p>
<p>แปลงร่างเป็น root</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span style="color: #c20cb9; font-weight: bold;">su</span> -</pre></div></div>

<p>ติดตั้ง dhcp, tftp-server, httpd และ syslinux</p>

<div class="wp_syntax"><div class="code"><pre class="bash">yum <span style="color: #c20cb9; font-weight: bold;">install</span> dhcp tftp-server httpd syslinux</pre></div></div>

<p>เตรียม install files (ผมเลือกติดตั้ง Ubuntu 8.04)<br />
<a href="http://www.howtoconfig.com/linux/how-to-mount-iso-image-under-linux.html">>>วิธี mount iso image บน linux</a></p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span><span style="color: #c20cb9; font-weight: bold;">ftp</span>.science.nus.edu.sg<span style="color: #000000; font-weight: bold;">/</span>linux<span style="color: #000000; font-weight: bold;">/</span>ubuntu-ISO<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">8.04</span><span style="color: #000000; font-weight: bold;">/</span>ubuntu<span style="color: #000000;">-8.04</span>-server-i386.iso
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> -p <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>html<span style="color: #000000; font-weight: bold;">/</span>mirror<span style="color: #000000; font-weight: bold;">/</span>ubuntu<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">8.04</span>
<span style="color: #c20cb9; font-weight: bold;">mount</span> -o loop ubuntu<span style="color: #000000;">-8.04</span>-server-i386.iso <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>html<span style="color: #000000; font-weight: bold;">/</span>mirror<span style="color: #000000; font-weight: bold;">/</span>ubuntu<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">8.04</span>
<span style="color: #c20cb9; font-weight: bold;">cp</span> -fr <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>html<span style="color: #000000; font-weight: bold;">/</span>mirror<span style="color: #000000; font-weight: bold;">/</span>ubuntu<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">8.04</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">install</span><span style="color: #000000; font-weight: bold;">/</span>netboot<span style="color: #000000; font-weight: bold;">/*</span> <span style="color: #000000; font-weight: bold;">/</span>tftpboot</pre></div></div>

<p><span id="more-24"></span><br />
Config tftp-server<br />
โดย default CentOS จะ disable tftp ที่ start ผ่าน xinetd ให้ทำการ configuration file &#8220;/etc/xinetd.d/tftp&#8221; ใหม่ด้วยการเปลี่ยน &#8220;disable = yes&#8221; ให้เป็น &#8220;disable = no&#8221; หรือใช้ sed ทำการแก้ไขก็ได้ครับ</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span style="color: #c20cb9; font-weight: bold;">sed</span> -e <span style="color: #ff0000;">'/disable/ s/yes/no/'</span> -i <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>xinetd.d<span style="color: #000000; font-weight: bold;">/</span>tftp
<span style="color: #666666; font-style: italic;">#restart xinetd</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>xinetd restart</pre></div></div>

<p>Config dhcpd<br />
โดย default CentOS จะให้ copy configuration file มาจาก &#8220;/usr/share/doc/dhcp*/dhcpd.conf.sample&#8221; ส่วนตัวแล้วผมใช้เพียง configuration และ parameters บางตัวเท่านั้น ตามตัวอย่างนี้ครับ</p>

<div class="wp_syntax"><div class="code"><pre class="scheme"># dhcpd configuration file for pxe boot by kawin@chailerd.com
# <span style="color: #66cc66;">/</span>etc<span style="color: #66cc66;">/</span>dhcpd.conf
# CentOS <span style="color: #cc66cc;">5.1</span>
ddns<span style="color: #66cc66;">-</span>update<span style="color: #66cc66;">-</span>style none<span style="color: #808080; font-style: italic;">;</span>
default<span style="color: #66cc66;">-</span>lease<span style="color: #66cc66;">-</span>time <span style="color: #cc66cc;">600</span><span style="color: #808080; font-style: italic;">;</span>
max<span style="color: #66cc66;">-</span>lease<span style="color: #66cc66;">-</span>time <span style="color: #cc66cc;">7200</span><span style="color: #808080; font-style: italic;">;</span>
log<span style="color: #66cc66;">-</span>facility local7<span style="color: #808080; font-style: italic;">;</span>
&nbsp;
subnet <span style="color: #cc66cc;">192.168</span><span style="color: #cc66cc;">.1</span><span style="color: #cc66cc;">.0</span> netmask <span style="color: #cc66cc;">255.255</span><span style="color: #cc66cc;">.255</span><span style="color: #cc66cc;">.0</span> <span style="color: #66cc66;">&#123;</span>
  range <span style="color: #cc66cc;">192.168</span><span style="color: #cc66cc;">.1</span><span style="color: #cc66cc;">.10</span> <span style="color: #cc66cc;">192.168</span><span style="color: #cc66cc;">.1</span><span style="color: #cc66cc;">.20</span><span style="color: #808080; font-style: italic;">;</span>
  filename <span style="color: #ff0000;">&quot;pxelinux.0&quot;</span><span style="color: #808080; font-style: italic;">;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>หลังจากทำการแก้ไข configuration file &#8220;/etc/dhcpd.conf&#8221; ก็ Start dhcpd ได้เลยครับ</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>dhcpd start</pre></div></div>

<p><span style="color: #ff0000;">Note : สามารถกำหนดได้ว่าจะให้ dhcpd ใช้ Interface ใดๆ โดย config ที่ file &#8220;/etc/sysconfig/dhcpd&#8221; ทำการเปลี่ยนค่าของ Interface DHCPDARGS=<em>ethX</em></span></p>
<p>เท่านี้ก็สามารถ Install Ubuntu ผ่าน Network โดย PXE Server บน CentOS ได้แล้วครับ<br />
หากเพื่อนๆ มีข้อสงสัยก็ถามมาได้เลยนะครับ webmaster@howtoconfig.com</p>
]]></content:encoded>
			<wfw:commentRss>http://www.howtoconfig.com/os/ubuntu/network-install-via-pxe-server.html/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
