<?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>聚沙成塔</title>
	<atom:link href="http://www.arule.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.arule.net</link>
	<description>養貓的陌生人筆記本</description>
	<lastBuildDate>Tue, 09 Nov 2010 17:11:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Windows 2003 DHCP 快速鎖定大量 Mac Address</title>
		<link>http://www.arule.net/2009/08/26/windows-2003-dhcp-%e5%bf%ab%e9%80%9f%e9%8e%96%e5%ae%9a%e5%a4%a7%e9%87%8f-mac-address/</link>
		<comments>http://www.arule.net/2009/08/26/windows-2003-dhcp-%e5%bf%ab%e9%80%9f%e9%8e%96%e5%ae%9a%e5%a4%a7%e9%87%8f-mac-address/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 16:47:00 +0000</pubDate>
		<dc:creator>chaokenyuan</dc:creator>
				<category><![CDATA[Operating System]]></category>
		<category><![CDATA[Win32]]></category>

		<guid isPermaLink="false">http://www.arule.net/2009/08/26/windows-2003-dhcp-%e9%8e%96%e5%ae%9amac-address/</guid>
		<description><![CDATA[以往要綁定 DHCP 總是要一筆一筆輸入    公司電腦又一天比一天多，實在麻煩了，&#124;     因此想快速完成這件事。     以下是我起心動念之後開始的步驟：     
1. 先利用2003本身的管理介面，導出現有的 DHCP 列表，把第一行中文字給刪除。
2. 將這個文件用 awk 重新整理一下

cat DHCP.txt &#124;awk -F\t '{print $1,$5,$2}'

會得出一個這樣的結果：    
 192.168.x.101 001xx09689f0 mis 

3. 查詢一下 netsh 的指令，得知綁定 DHCP 的完整命令為

 netsh dhcp server 192.168.x.1 scope 192.168.x.0 add reservedip 192.168.x.101 [...]]]></description>
			<content:encoded><![CDATA[<p>以往要綁定 DHCP 總是要一筆一筆輸入    <br />公司電腦又一天比一天多，實在麻煩了，|     <br />因此想快速完成這件事。     <br />以下是我起心動念之後開始的步驟：     </p>
<p>1. 先利用2003本身的管理介面，導出現有的 DHCP 列表，把第一行中文字給刪除。</p>
<p>2. 將這個文件用 awk 重新整理一下</p>
<p>
<pre class="brush: plain;">cat DHCP.txt |awk -F\t '{print $1,$5,$2}'</pre>
</p>
<p>會得出一個這樣的結果：    
<pre class="brush: plain;"> 192.168.x.101 001xx09689f0 mis </pre>
</p>
<p>3. 查詢一下 netsh 的指令，得知綁定 DHCP 的完整命令為</p>
<p>
<pre class="brush: plain;"> netsh dhcp server 192.168.x.1 scope 192.168.x.0 add reservedip 192.168.x.101 001xx09689f0 mis </pre>
</p>
<p>因此再使用 awk 整理一次，重導向到另一個檔案中</p>
<p> <strong><br />
<table border="1" cellspacing="0" cellpadding="2" width="500" bordercolor="#000000" bgcolor="#000000">
<tbody>
<tr>
<td valign="top" width="492"><strong><font color="#FFFF00">cat DHCP.txt |awk -F\t &#8216;{print netsh &#8220;dhcp server 192.168.x.1 scope 192.168.x.0 add reservedip&#8221;,$1,$5,$2}&#8217; > DHCP.bat</font></strong> </td>
</tr>
</tbody>
</table>
<p></strong>
<p>如此便誕生了一個快速綁定 DHCP 的 bat 檔案，只需要放到Server上執行，   <br />就能快速的完成任務了。</p>
<p>附錄：</p>
<p>備份 DHCP 設定的方法    
<pre class="brush: plain;">netsh dhcp server export c:\dhcp.txt all</pre>
</p>
<p>導入 DHCP 設定的方法    
<pre class="brush: plain;"> netsh dhcp server import c:\dhcp.txt all </pre></p>
]]></content:encoded>
			<wfw:commentRss>http://www.arule.net/2009/08/26/windows-2003-dhcp-%e5%bf%ab%e9%80%9f%e9%8e%96%e5%ae%9a%e5%a4%a7%e9%87%8f-mac-address/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cron.d 資料夾</title>
		<link>http://www.arule.net/2009/08/25/cron-d-%e8%b3%87%e6%96%99%e5%a4%be/</link>
		<comments>http://www.arule.net/2009/08/25/cron-d-%e8%b3%87%e6%96%99%e5%a4%be/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 17:04:00 +0000</pubDate>
		<dc:creator>chaokenyuan</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Operating System]]></category>

		<guid isPermaLink="false">http://www.arule.net/2009/08/25/cron-d-%e8%b3%87%e6%96%99%e5%a4%be/</guid>
		<description><![CDATA[為了讓系統能夠更自動化，   我發現了CentOS /etc 目錄下，    分別有 cron.daily cron.horly 等資料夾，    分別是作業系統預設一定會去找的工作，    然後又發現了一個叫cron.d的資料夾，    底下可以設定一個檔案自動排程的時間，    這樣的話就可以自訂時間而不需使用 crontab -e 來編輯排程了.
然而卻碰到了問題，時間到了卻沒有執行&#8230;   查看log發現了這樣的訊息：
(*system*) BAD FILE MODE   經過查詢需要更改權限&#8230;    chmod 0600 /etc/cron.d/*
改了權限後，錯誤訊息沒有了，但仍然不會執行，   參考/etc/crontab 文件後，    增加一個使用者身份如下，就成功了。
00 [...]]]></description>
			<content:encoded><![CDATA[<p>為了讓系統能夠更自動化，   <br />我發現了CentOS /etc 目錄下，    <br />分別有 cron.daily cron.horly 等資料夾，    <br />分別是作業系統預設一定會去找的工作，    <br />然後又發現了一個叫cron.d的資料夾，    <br />底下可以設定一個檔案自動排程的時間，    <br />這樣的話就可以自訂時間而不需使用 crontab -e 來編輯排程了.</p>
<p>然而卻碰到了問題，時間到了卻沒有執行&#8230;   <br />查看log發現了這樣的訊息：</p>
<p>(*system*) BAD FILE MODE   <br />經過查詢需要更改權限&#8230;    <br /><strong>chmod 0600 /etc/cron.d/*</strong></p>
<p>改了權限後，錯誤訊息沒有了，但仍然不會執行，   <br />參考/etc/crontab 文件後，    <br />增加一個使用者身份如下，就成功了。</p>
<p><strong>00 16 * * * root /path/to/scripts</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.arule.net/2009/08/25/cron-d-%e8%b3%87%e6%96%99%e5%a4%be/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Could not load all ISAPI filters for site/service</title>
		<link>http://www.arule.net/2009/05/13/could-not-load-all-isapi-filters-for-siteservice/</link>
		<comments>http://www.arule.net/2009/05/13/could-not-load-all-isapi-filters-for-siteservice/#comments</comments>
		<pubDate>Tue, 12 May 2009 17:05:00 +0000</pubDate>
		<dc:creator>chaokenyuan</dc:creator>
				<category><![CDATA[Operating System]]></category>

		<guid isPermaLink="false">http://www.arule.net/2009/05/13/could-not-load-all-isapi-filters-for-siteservice/</guid>
		<description><![CDATA[事發原因都是因為 Vista 64 的印表機驅動有問題。
原本用公司配給我的 PC 灌 Windows 2008&#160; x64 來分享一台 HP1505n，   沒想到會出現部份檔案可以印，部份檔案不能印的問題，    於是就想用另一台 Sever 2003 WSUS x64 來分享看看，
裝好印表機之後，很遺憾實驗失敗了，情況沒改善而且 WSUS 也掛了&#8230;   看事件檢視器真是一片狼藉啊&#8230;
&#160;&#160;&#160; Could not load all ISAPI filters for site/service
&#160;&#160;&#160; Application pool &#8216;DefaultAppPool&#8217; is being automatically disabled due to a series of failures in the process(es) serving that application [...]]]></description>
			<content:encoded><![CDATA[<p>事發原因都是因為 Vista 64 的印表機驅動有問題。</p>
<p>原本用公司配給我的 PC 灌 Windows 2008&#160; x64 來分享一台 HP1505n，   <br />沒想到會出現部份檔案可以印，部份檔案不能印的問題，    <br />於是就想用另一台 Sever 2003 WSUS x64 來分享看看，</p>
<p>裝好印表機之後，很遺憾實驗失敗了，情況沒改善而且 WSUS 也掛了&#8230;   <br />看事件檢視器真是一片狼藉啊&#8230;</p>
<p>&#160;&#160;&#160; Could not load all ISAPI filters for site/service</p>
<p>&#160;&#160;&#160; Application pool &#8216;DefaultAppPool&#8217; is being automatically disabled due to a series of failures in the process(es) serving that application pool.</p>
<p>&#160;&#160;&#160; A process serving application pool &#8216;DefaultAppPool&#8217; reported a failure. The process id was &#8216;2252&#8242;.&#160; The data field contains the error number.</p>
<p>還有一大堆不贅述，總之我找到解法了：</p>
<p>1. 移除 HP 印表機驅動程式雞婆幫忙裝的 .Net Framework 1.1</p>
<p>2. 取消32位元相容模式，跑以下指令：   <br />cscript C:\inetpub\adminscripts\adsutil.vbs SET    <br />W3SVC/AppPools/Enable32bitAppOnWin64 0</p>
<p>3. 把 IIS 註冊給&#160; .Net Framework 2.0，跑以下指令：   <br />C:\Windows\Microsoft.NET\Framework64\v2.0.50727&gt;    <br />aspnet_regiis.exe -i</p>
]]></content:encoded>
			<wfw:commentRss>http://www.arule.net/2009/05/13/could-not-load-all-isapi-filters-for-siteservice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FreeBSD nss_ldap v.s OpenSSL</title>
		<link>http://www.arule.net/2009/05/11/freebsd-nss_ldap-v-s-openssl/</link>
		<comments>http://www.arule.net/2009/05/11/freebsd-nss_ldap-v-s-openssl/#comments</comments>
		<pubDate>Sun, 10 May 2009 17:07:00 +0000</pubDate>
		<dc:creator>chaokenyuan</dc:creator>
				<category><![CDATA[BSD]]></category>
		<category><![CDATA[Operating System]]></category>

		<guid isPermaLink="false">http://www.arule.net/2009/05/11/freebsd-nss_ldap-v-s-openssl/</guid>
		<description><![CDATA[哈哈，終於找到 FreeBSD 裝不順利的原因了，   原來是 OpenSSL 這個東西在亂搞鬼，    FreeBSD 原本都有內建一版 OpenSSL    但是更新 Ports Tree 之後再安裝 OpenSSL 則會更新到 0.9.8k    由於已經試驗過所有版本的 FreeBSD (x64,x86,7.1,6.4,6.3)    所以可以輕易推論出目前不能使用 Ports Tree 上的 OpenSSL 最新版，    否則會造成 LDAP, nss_ldap, apache    以及其他所有跟 OpenSSL 有關係的服務不匹配。    [...]]]></description>
			<content:encoded><![CDATA[<p>哈哈，終於找到 FreeBSD 裝不順利的原因了，   <br />原來是 OpenSSL 這個東西在亂搞鬼，    <br />FreeBSD 原本都有內建一版 OpenSSL    <br />但是更新 Ports Tree 之後再安裝 OpenSSL 則會更新到 0.9.8k    <br />由於已經試驗過所有版本的 FreeBSD (x64,x86,7.1,6.4,6.3)    <br />所以可以輕易推論出目前不能使用 Ports Tree 上的 OpenSSL 最新版，    <br />否則會造成 LDAP, nss_ldap, apache    <br />以及其他所有跟 OpenSSL 有關係的服務不匹配。    </p>
<p>呼&#8230;.問題終於解決了~~爽。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.arule.net/2009/05/11/freebsd-nss_ldap-v-s-openssl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在 AIX 5.2 上安裝 bind8</title>
		<link>http://www.arule.net/2008/10/02/%e5%9c%a8-aix-52-%e4%b8%8a%e5%ae%89%e8%a3%9d-bind8/</link>
		<comments>http://www.arule.net/2008/10/02/%e5%9c%a8-aix-52-%e4%b8%8a%e5%ae%89%e8%a3%9d-bind8/#comments</comments>
		<pubDate>Thu, 02 Oct 2008 06:33:00 +0000</pubDate>
		<dc:creator>chaokenyuan</dc:creator>
				<category><![CDATA[AIX]]></category>
		<category><![CDATA[Operating System]]></category>

		<guid isPermaLink="false">http://blog.arule.net/2008/10/90/</guid>
		<description><![CDATA[ 
aix

其實在 aix 5.2 上面裝 bind 跟一般並沒有什麼不同， 但是實做最大&#8230;你沒裝過你敢說之前的做法一定成功嗎？XD 故在此紀錄一下步驟&#8230;
 
/etc/named.conf 內容




options { directory &#8220;/data/dns&#8221;; #設定工作目錄。 allow-transfer { none; }; }; logging { channel syslog_query { file &#8220;/var/bindquery.log&#8221;; severity debug; }; 
channel syslog_info { file &#8220;/var/bindall.log&#8221; versions 20 size 2m; print-category yes; print-time yes; severity notice; }; category default { lame-servers { null; }; syslog_info; }; [...]]]></description>
			<content:encoded><![CDATA[<p><!-- #BeginTags --> <br/></p>
<p class="tags"><a href="http://www.technorati.com/tag/aix" rel="tag">aix</a></p>
<p><!-- #EndTags --></p>
<p>其實在 aix 5.2 上面裝 bind 跟一般並沒有什麼不同， <br/>但是實做最大&#8230;你沒裝過你敢說之前的做法一定成功嗎？XD <br/>故在此紀錄一下步驟&#8230;</p>
<p> <span id="more-90"></span>
<p>/etc/named.conf 內容</p>
<table width="570" border="1" bgcolor="#666666">
<tbody>
<tr valign="top">
<td width="560" align="default" valign="top">
<p><span style="COLOR: #ffffff">options { <br/>directory &#8220;/data/dns&#8221;; #設定工作目錄。 <br/>allow-transfer { none; }; <br/>}; <br/><br/>logging { <br/>channel syslog_query { <br/>file &#8220;/var/bindquery.log&#8221;; <br/>severity debug; <br/>}; <br/></span></p>
<p><span style="COLOR: #ffffff">channel syslog_info { <br/>file &#8220;/var/bindall.log&#8221; versions 20 size 2m; <br/>print-category yes; <br/>print-time yes; <br/>severity notice; <br/>}; <br/><br/>category default { <br/>lame-servers { null; }; <br/>syslog_info; <br/>}; <br/><br/>}; <br/><br/>zone &#8220;.&#8221; { <br/>type hint; <br/>file &#8220;named.ca&#8221;; #根 <br/>}; <br/></span></p>
<p><span style="COLOR: #ffffff">zone &#8220;0.0.127.in-addr.arpa&#8221; { <br/>type master; <br/>file &#8220;0.0.127.in-addr.arpa&#8221;; #反解文件。 <br/>};</span></p>
<p><span style="COLOR: #ffffff">zone &#8220;localhost&#8221; { <br/>type master; <br/>file &#8220;localhost&#8221;; #正解文件 <br/>};</span></p>
<p><span style="COLOR: #ffffff">zone &#8220;0.168.192.in-addr.arpa&#8221; { <br/>type master; <br/>file &#8220;0.168.192.in-addr.arpa&#8221;; #domain name的反解文件 <br/>};</span></p>
</td>
</tr>
</tbody>
</table>
<p>移除之前的 link (可能為更舊版所以要先移除)</p>
<table width="570" border="1" bgcolor="#666666">
<tbody>
<tr valign="top">
<td width="560" align="default" valign="top"><span style="COLOR: #ffffff"># rm /usr/sbin/named /usr/sbin/named-xfer</span></td>
</tr>
</tbody>
</table>
<p>重新 link 新版</p>
<table width="570" border="1" bgcolor="#666666">
<tbody>
<tr valign="top">
<td width="560" align="default" valign="top"><span style="COLOR: #ffffff">#ln -s /usr/sbin/named8 /usr/sbin/named <br/>#ln -s /usr/sbin/named8-xfer /usr/sbin/named-xfer</span></td>
</tr>
</tbody>
</table>
<p>並確認為 bind 8</p>
<table width="570" border="1" bgcolor="#666666">
<tbody>
<tr valign="top">
<td width="560" align="default" valign="top"><span style="COLOR: #ffffff"># named -v <br/>named 8.3.3+Fix_for_CERT_till_07_15_04 Thu Dec 30 07:36:16 CST 2004 <br/>build@builder12.austin.ibm.com:/52L/obj/power/tcpip/usr/sbin/named8</span></td>
</tr>
</tbody>
</table>
<p>啟動服務 <br/>startsrc -s named <br/>停止服務 <br/>stopsrc -s named <br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.arule.net/2008/10/02/%e5%9c%a8-aix-52-%e4%b8%8a%e5%ae%89%e8%a3%9d-bind8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>使用 telnet 連上 IRC Server</title>
		<link>http://www.arule.net/2008/10/02/%e4%bd%bf%e7%94%a8-telnet-%e9%80%a3%e4%b8%8a-irc-server/</link>
		<comments>http://www.arule.net/2008/10/02/%e4%bd%bf%e7%94%a8-telnet-%e9%80%a3%e4%b8%8a-irc-server/#comments</comments>
		<pubDate>Thu, 02 Oct 2008 05:55:00 +0000</pubDate>
		<dc:creator>chaokenyuan</dc:creator>
				<category><![CDATA[others]]></category>

		<guid isPermaLink="false">http://blog.arule.net/2008/10/88/</guid>
		<description><![CDATA[IRC 是一個聊天型的服務，不過是明碼的，
以下示範如何用 telnet 指令就登入 IRC Server


telnet  irc.server.domain  6667

NICK [your name]

USER [your name]  irc.server.domain blah germaN

join #[ch-name]

PRIVMSG  #[ch-name]  : TSET





telnet irc.server.domain 6667
NICK [your name]
USER [your name] irc.server.domain blah germaN
join #[ch-name]
PRIVMSG #[ch-name] : TSET



]]></description>
			<content:encoded><![CDATA[<p>IRC 是一個聊天型的服務，不過是明碼的，<br />
以下示範如何用 telnet 指令就登入 IRC Server</p>
<pre class="brush: plain;">

telnet  irc.server.domain  6667

NICK [your name]

USER [your name]  irc.server.domain blah germaN

join #[ch-name]

PRIVMSG  #[ch-name]  : TSET
</pre>
<p><span id="more-88"></span></p>
<table style="height: 150px;" border="1" width="300" bgcolor="#666666">
<tbody>
<tr valign="top">
<td width="290" valign="top"><span style="color: #ffffff;">telnet <span style="color: #ffff00;">irc.server.domain 6667</span></p>
<p>NICK <span style="color: #ffff00;">[your name]</span></p>
<p>USER <span style="color: #ffff00;">[your name] irc.server.domain</span> blah germaN</p>
<p>join #<span style="color: #ffff00;">[ch-name]</span></p>
<p>PRIVMSG #<span style="color: #ffff00;">[ch-name]</span> : TSET</span></td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.arule.net/2008/10/02/%e4%bd%bf%e7%94%a8-telnet-%e9%80%a3%e4%b8%8a-irc-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>使用反向代理 squid 保護 apache</title>
		<link>http://www.arule.net/2008/10/02/%e4%bd%bf%e7%94%a8%e5%8f%8d%e5%90%91%e4%bb%a3%e7%90%86-squid-%e4%bf%9d%e8%ad%b7-apache/</link>
		<comments>http://www.arule.net/2008/10/02/%e4%bd%bf%e7%94%a8%e5%8f%8d%e5%90%91%e4%bb%a3%e7%90%86-squid-%e4%bf%9d%e8%ad%b7-apache/#comments</comments>
		<pubDate>Thu, 02 Oct 2008 05:54:00 +0000</pubDate>
		<dc:creator>chaokenyuan</dc:creator>
				<category><![CDATA[others]]></category>

		<guid isPermaLink="false">http://blog.arule.net/2008/10/87/</guid>
		<description><![CDATA[
squid

squid 的功能我就不贅述了，除了當作 httpd-proxy server 之外，還能保護後端的網站，
減少該網站 I/O 的效能消耗。
以下為 squid.conf 的組態設定，#部份是 FreeBSD 的路徑




########## Base control ##########
cache_mgr webmaster
cache_effective_user squid
cache_effective_group squid
visible_hostname cache.arule.net
http_port 80
icp_port 0
#cache_dir ufs /usr/cache 300 16 256
cache_dir ufs /var/spool/squid 300 16 256
#cache_access_log /var/log/squid-cache-access.log
#cache_log /var/log/cache.log
#cache_store_log /var/log/cache_store.log
#error_directory /s/squid/etc/squid/errors/English
error_directory /usr/share/squid/errors/English
#icon_directory /s/squid/etc/squid/icons
icon_directory /usr/share/squid/icons
#mime_table /s/squid/etc/squid/mime.conf
mime_table /etc/squid/mime.conf
#coredump_dir /s/squid/squid/cache
coredump_dir /var/spool/squid
#pid_filename /s/squid/squid/logs/squid.pid
pid_filename /var/run/squid.pid
hosts_file /data/squidhosts
#unlinkd_program /s/squid/libexec/squid/unlinkd
unlinkd_program /usr/lib/squid/unlinkd
########## Performance control ##########
cache_mem 256 MB
cache_swap_low 90
cache_swap_high 95
maximum_object_size 4096 KB
minimum_object_size [...]]]></description>
			<content:encoded><![CDATA[<p><!-- #BeginTags --></p>
<p class="tags"><a rel="tag" href="http://www.technorati.com/tag/squid">squid</a></p>
<p><!-- #EndTags --></p>
<p>squid 的功能我就不贅述了，除了當作 httpd-proxy server 之外，還能保護後端的網站，<br />
減少該網站 I/O 的效能消耗。<br />
以下為 squid.conf 的組態設定，#部份是 FreeBSD 的路徑</p>
<p><span id="more-87"></span></p>
<table border="1" width="570" bgcolor="#666666">
<tbody>
<tr valign="top">
<td width="560" valign="top"><span style="color: #ffffff;">########## Base control ##########<br />
cache_mgr webmaster<br />
cache_effective_user squid<br />
cache_effective_group squid<br />
visible_hostname cache.arule.net<br />
http_port 80<br />
icp_port 0</p>
<p>#cache_dir ufs /usr/cache 300 16 256<br />
cache_dir ufs /var/spool/squid 300 16 256<br />
#cache_access_log /var/log/squid-cache-access.log<br />
#cache_log /var/log/cache.log<br />
#cache_store_log /var/log/cache_store.log<br />
#error_directory /s/squid/etc/squid/errors/English<br />
error_directory /usr/share/squid/errors/English<br />
#icon_directory /s/squid/etc/squid/icons<br />
icon_directory /usr/share/squid/icons<br />
#mime_table /s/squid/etc/squid/mime.conf<br />
mime_table /etc/squid/mime.conf<br />
#coredump_dir /s/squid/squid/cache<br />
coredump_dir /var/spool/squid<br />
#pid_filename /s/squid/squid/logs/squid.pid<br />
pid_filename /var/run/squid.pid<br />
<span style="color: #ffff00;">hosts_file /data/squidhosts</span><br />
#unlinkd_program /s/squid/libexec/squid/unlinkd<br />
unlinkd_program /usr/lib/squid/unlinkd</p>
<p>########## Performance control ##########</p>
<p>cache_mem 256 MB<br />
cache_swap_low 90<br />
cache_swap_high 95<br />
maximum_object_size 4096 KB<br />
minimum_object_size 0 KB<br />
maximum_object_size_in_memory 8 KB<br />
ipcache_size 1024<br />
ipcache_low 90<br />
ipcache_high 95<br />
fqdncache_size 1024<br />
cache_replacement_policy lru<br />
memory_replacement_policy lru<br />
emulate_httpd_log on<br />
log_ip_on_direct on<br />
log_mime_hdrs off<br />
dns_timeout 2 minutes<br />
request_header_max_size 10 KB</span></p>
<p><span style="color: #ffffff;">#不快取動態網頁與禁止快取 https協定<br />
acl QUERY urlpath_regex -i cgi-bin /? /.asp /.php /.jsp /.cgi /.js<br />
</span><span style="color: #ffffff;">no_cache deny QUERY</span> <span style="color: #ffffff;"><br />
acl DENYSSL urlpath_regex -i ^https://<br />
</span><span style="color: #ffffff;">cache deny DENYSSL</span></p>
<p><span style="color: #ffffff;">#支援 http svn 的動作 (LOCK 與 UNLOCK是暫不支援)<br />
extension_methods REPORT MERGE MKACTIVITY CHECKOUT PROPFIND#LOCK UNLOCK<br />
</span></td>
</tr>
</tbody>
</table>
<p>黃字部份比照 /etc/hosts 設定即可，有在此檔案內的 hosts 皆可被反向代理。<br />
更改此檔內容需要重新啟動 squid 才會被重新讀取。</p>
<p>常與 squid 搭配的是 apache mod_mem 模組：</p>
<table border="1" width="570" bgcolor="#666666">
<tbody>
<tr valign="top">
<td width="560" valign="top"><span style="color: #ffffff;">CacheForceCompletion 100<br />
CacheDefaultExpire 3600<br />
CacheMaxExpire 86400<br />
CacheLastModifiedFactor 0.1</p>
<p>CacheEnable disk /<br />
CacheRoot /data/<br />
CacheSize 327680<br />
CacheDirLength 4<br />
CacheDirLevels 5<br />
CacheGcInterval 4</p>
<p>CacheEnable mem /<br />
MCacheSize 8192<br />
MCacheMaxObjectCount 10000<br />
MCacheMinObjectSize 1<br />
MCacheMaxObjectSize 51200</span></td>
</tr>
</tbody>
</table>
<p>設定好之後，有兩個缺點：</p>
<p>1. apache的access log 全部都 log 到 Linux 的區域網路 ip.<br />
這個目前不知道怎麼解&#8230;</p>
<p>2. squid 的模擬 apache log 不完整<br />
這個缺點看網頁上是說可以用 patch 的方式讓 squid 支援 apache combined log.</p>
<p>兩個都麻煩，因此暫時按兵不動&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.arule.net/2008/10/02/%e4%bd%bf%e7%94%a8%e5%8f%8d%e5%90%91%e4%bb%a3%e7%90%86-squid-%e4%bf%9d%e8%ad%b7-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>控制搜尋引擎蜘蛛</title>
		<link>http://www.arule.net/2008/10/01/%e6%8e%a7%e5%88%b6%e6%90%9c%e5%b0%8b%e5%bc%95%e6%93%8e%e8%9c%98%e8%9b%9b/</link>
		<comments>http://www.arule.net/2008/10/01/%e6%8e%a7%e5%88%b6%e6%90%9c%e5%b0%8b%e5%bc%95%e6%93%8e%e8%9c%98%e8%9b%9b/#comments</comments>
		<pubDate>Wed, 01 Oct 2008 03:59:00 +0000</pubDate>
		<dc:creator>chaokenyuan</dc:creator>
				<category><![CDATA[others]]></category>

		<guid isPermaLink="false">http://blog.arule.net/2008/10/86/</guid>
		<description><![CDATA[網站流量節節升高，
所以必須節流的時候到了！
開啟一個空白檔案 叫做 robots.txt 在網站根目錄下，
內容為：




User-agent: *
Disallow: /*.PDF$
Disallow: /*.swf$
Disallow: /*.jpg$
Disallow: /*.gif$
Disallow: /*.png$
Disallow: /*.pl$
Disallow: /*.zip$
Disallow: /*.rar$
Disallow: /*.css$
Disallow: /*.js$
Disallow: /*.xml$
Crawl-delay: 14400



為何要如此？因為搜尋引擎去抓資料時也會消耗頻寬！
 
]]></description>
			<content:encoded><![CDATA[<p>網站流量節節升高，<br />
所以必須節流的時候到了！<br />
開啟一個空白檔案 叫做 robots.txt 在網站根目錄下，<br />
內容為：</p>
<p><span id="more-86"></span></p>
<table border="1" width="300" bgcolor="#666666">
<tbody>
<tr valign="top">
<td width="290" valign="top"><span style="color: #ffffff;">User-agent: *<br />
Disallow: /*.PDF$<br />
Disallow: /*.swf$<br />
Disallow: /*.jpg$<br />
Disallow: /*.gif$<br />
Disallow: /*.png$<br />
Disallow: /*.pl$<br />
Disallow: /*.zip$<br />
Disallow: /*.rar$<br />
Disallow: /*.css$<br />
Disallow: /*.js$<br />
Disallow: /*.xml$<br />
Crawl-delay: 14400</span></td>
</tr>
</tbody>
</table>
<p>為何要如此？因為搜尋引擎去抓資料時也會消耗頻寬！</p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.arule.net/2008/10/01/%e6%8e%a7%e5%88%b6%e6%90%9c%e5%b0%8b%e5%bc%95%e6%93%8e%e8%9c%98%e8%9b%9b/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NetBSD 3 基本上網設定</title>
		<link>http://www.arule.net/2008/10/01/netbsd-3-%e5%9f%ba%e6%9c%ac%e4%b8%8a%e7%b6%b2%e8%a8%ad%e5%ae%9a/</link>
		<comments>http://www.arule.net/2008/10/01/netbsd-3-%e5%9f%ba%e6%9c%ac%e4%b8%8a%e7%b6%b2%e8%a8%ad%e5%ae%9a/#comments</comments>
		<pubDate>Wed, 01 Oct 2008 03:59:00 +0000</pubDate>
		<dc:creator>chaokenyuan</dc:creator>
				<category><![CDATA[BSD]]></category>
		<category><![CDATA[Operating System]]></category>

		<guid isPermaLink="false">http://blog.arule.net/2008/10/85/</guid>
		<description><![CDATA[ 
netbsd

以下為 NetBSD 3 基本網路設定
安裝也是照畫面指示即可，
網路配置
 
先輸入 ifconfig -a 觀看網路介面名稱， 假如看到的名字為 pcn0
那就建立一個檔叫做：
/etc/ifconfig.pcn0
內容為：
inet 192.168.xxx.xxx netmask 255.255.255.0
然後在 /etc/rc.conf 以下加入這行：
auto_ifconfig=YES
新增 /etc/mygate 裡面打入 gateway 名字 新增 /etc/myname 裡面輸入你決定的名字 新增 /etc/resolv.conf 裡面輸入你要的 DNS 手動更改 IP 其實可以直接打指令
ifconfig pcn0 inet 192.168.1.4 netmask 255.255.255.0
就可以生效。 接著可以以 traceroute www.hinet.net 來測試網路是否通了。

]]></description>
			<content:encoded><![CDATA[<p><!-- #BeginTags --> <br/></p>
<p class="tags"><a href="http://www.technorati.com/tag/netbsd" rel="tag">netbsd</a></p>
<p><!-- #EndTags --></p>
<p>以下為 NetBSD 3 基本網路設定</p>
<p>安裝也是照畫面指示即可，</p>
<p>網路配置</p>
<p> <span id="more-85"></span>
<p>先輸入 ifconfig -a 觀看網路介面名稱， <br/>假如看到的名字為 pcn0</p>
<p>那就建立一個檔叫做：</p>
<p>/etc/ifconfig.<span style="COLOR: #ff0000">pcn0</span></p>
<p>內容為：</p>
<p>inet 192.168.xxx.xxx netmask 255.255.255.0</p>
<p>然後在 /etc/rc.conf 以下加入這行：</p>
<p>auto_ifconfig=YES</p>
<p>新增 /etc/mygate 裡面打入 gateway 名字 <br/>新增 /etc/myname 裡面輸入你決定的名字 <br/>新增 /etc/resolv.conf 裡面輸入你要的 DNS <br/><br/>手動更改 IP 其實可以直接打指令</p>
<p>ifconfig pcn0 inet 192.168.1.4 netmask 255.255.255.0</p>
<p>就可以生效。 <br/><br/>接著可以以 traceroute <a href="http://www.hinet.net/">www.hinet.net</a> 來測試網路是否通了。</p>
<p><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.arule.net/2008/10/01/netbsd-3-%e5%9f%ba%e6%9c%ac%e4%b8%8a%e7%b6%b2%e8%a8%ad%e5%ae%9a/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>打開 rcp</title>
		<link>http://www.arule.net/2008/10/01/%e6%89%93%e9%96%8b-rcp/</link>
		<comments>http://www.arule.net/2008/10/01/%e6%89%93%e9%96%8b-rcp/#comments</comments>
		<pubDate>Wed, 01 Oct 2008 03:58:00 +0000</pubDate>
		<dc:creator>chaokenyuan</dc:creator>
				<category><![CDATA[AIX]]></category>
		<category><![CDATA[BSD]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Operating System]]></category>

		<guid isPermaLink="false">http://blog.arule.net/2008/10/84/</guid>
		<description><![CDATA[打開簡單的 rcp 權限
今日老闆突然要打開 rcp 的語法權限，
是 AIX 與 Solaris&#8230;
 
查了一下，如果是 root 只要編輯一個叫做 /.rhosts 的檔案裡面如下：



BG78 root



BG78 是電腦名稱，必需要在 /etc/hosts 裡面有 IP
這樣就可以允許rcp 指令傳送檔案了
如果是一般 User 如 cat 這個 User 好了
那必須是 $HOME/.rhosts



BG78 cat



這樣才行。
.rhosts 檔案最好為 600 增加安全性。

]]></description>
			<content:encoded><![CDATA[<p>打開簡單的 rcp 權限</p>
<p>今日老闆突然要打開 rcp 的語法權限，</p>
<p>是 AIX 與 Solaris&#8230;</p>
<p> <span id="more-84"></span>
<p>查了一下，如果是 root 只要編輯一個叫做 /.rhosts 的檔案裡面如下：</p>
<table width="300" border="1" bgcolor="#666666">
<tbody>
<tr valign="top">
<td width="290" align="default" valign="top"><span style="COLOR: #ffffff">BG78 root</span></td>
</tr>
</tbody>
</table>
<p>BG78 是電腦名稱，必需要在 /etc/hosts 裡面有 IP</p>
<p>這樣就可以允許rcp 指令傳送檔案了</p>
<p>如果是一般 User 如 cat 這個 User 好了</p>
<p>那必須是 $HOME/.rhosts</p>
<table width="300" border="1" bgcolor="#666666">
<tbody>
<tr valign="top">
<td width="290" align="default" valign="top"><span style="COLOR: #ffffff">BG78 cat</span></td>
</tr>
</tbody>
</table>
<p>這樣才行。</p>
<p>.rhosts 檔案最好為 600 增加安全性。</p>
<p><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.arule.net/2008/10/01/%e6%89%93%e9%96%8b-rcp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

