<?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>憂藍夢境‧部落格 &#187; Server</title>
	<atom:link href="http://blog.linym.net/archives/tag/server/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.linym.net</link>
	<description>我的學習心得、筆記</description>
	<lastBuildDate>Fri, 09 Dec 2011 12:33:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Windows PPPoE 自動重撥 Script</title>
		<link>http://blog.linym.net/archives/522</link>
		<comments>http://blog.linym.net/archives/522#comments</comments>
		<pubDate>Sat, 25 Jul 2009 10:51:09 +0000</pubDate>
		<dc:creator>lym520</dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[程式筆記]]></category>
		<category><![CDATA[系統筆記]]></category>
		<category><![CDATA[adsl]]></category>
		<category><![CDATA[pppoe]]></category>
		<category><![CDATA[WSH]]></category>
		<category><![CDATA[自動連線]]></category>

		<guid isPermaLink="false">http://blog.linym.net/?p=522</guid>
		<description><![CDATA[隨著 ADSL 及經濟型光纖網路的普及，有許多人都會在自家架設 server 主機，但如果沒有用分享器而是直接透過 PPPoE 撥接上網的，就很怕網路突然斷線(如忘記繳錢被停掉)，雖然說 Windows 內建的連線程式有一個「斷線後重新撥號」的選項，但其實並不好用。比較保險的作法是系統定期檢查對外連線的狀況(ping)，一旦發現斷線就自動重新連線。 在網路上可以找到很多這種作法的 Linux 版本，如「Debian Linux: ADSL PPPoE 自動重撥 Script」，但相對 Windows 的討論卻很少，所以就自己寫了一個重撥的 WSH(Windows Script Host)，搭配工作排程就可以達到目的。 ※ 本方法適用於 XP 以後之 Windows。 Step 1：將下列程式存為 repppoe.vbs，修改連線資訊並放置在安全的地方 DIALNAME = &#34;寬頻連線&#34; &#039;連線名稱 DIALUSER = &#34;12345678@ip.hinet.net&#34; &#039;連線帳號 DIALPASS = &#34;xxxxxxxx&#34; &#039;連線密碼 Set WshShell = CreateObject(&#34;WScript.Shell&#34;) RetCode = WshShell.Run(&#34;ping www.hinet.net&#34;, 0, true) If RetCode &#60;&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>隨著 ADSL 及經濟型光纖網路的普及，有許多人都會在自家架設 server 主機，但如果沒有用分享器而是直接透過 PPPoE 撥接上網的，就很怕網路突然斷線(如忘記繳錢被停掉)，雖然說 Windows 內建的連線程式有一個「斷線後重新撥號」的選項，但其實並不好用。比較保險的作法是系統定期檢查對外連線的狀況(ping)，一旦發現斷線就自動重新連線。</p>
<p>在網路上可以找到很多這種作法的 Linux 版本，如「<a href="http://plog.longwin.com.tw/programming/2007/08/24/adsl_repppoe_script_2007" target="_blank">Debian Linux: ADSL PPPoE 自動重撥 Script</a>」，但相對 Windows 的討論卻很少，所以就自己寫了一個重撥的 WSH(Windows Script Host)，搭配工作排程就可以達到目的。<br />
<span style="color:red">※ 本方法適用於 XP 以後之 Windows。</span></p>
<p><strong>Step 1：將下列程式存為 <span style="color:blue">repppoe.vbs</span>，修改連線資訊並放置在安全的地方</strong></p>
<pre title="code" class="vb">

DIALNAME = &quot;寬頻連線&quot;              &#039;連線名稱
DIALUSER = &quot;12345678@ip.hinet.net&quot; &#039;連線帳號
DIALPASS = &quot;xxxxxxxx&quot;              &#039;連線密碼

Set WshShell = CreateObject(&quot;WScript.Shell&quot;)
RetCode = WshShell.Run(&quot;ping www.hinet.net&quot;, 0, true)
If RetCode &lt;&gt; 0 Then
	WshShell.Run &quot;rasdial &quot; &amp; DIALNAME &amp; &quot; /DISCONNECT&quot;, 0, true
	WScript.Sleep(3000)
	WshShell.Run &quot;rasdial &quot; &amp; DIALNAME &amp; &quot; &quot; &amp; DIALUSER &amp; &quot; &quot; &amp; DIALPASS, 0
End If
</pre>
<p><strong>Step 2：設定 Windows 工作排程。</strong>(控制台->排定的工作->新增排定的工作)</p>
<p><a href="http://blog.linym.net/wp-content/uploads/2009/07/1.JPG"><img src="http://blog.linym.net/wp-content/uploads/2009/07/1.JPG" alt="1" title="1" width="522" height="326" class="alignnone size-full wp-image-535" /></a><br />
‧選擇步驟 1 的 repppoe.vbs 檔案</p>
<p><a href="http://blog.linym.net/wp-content/uploads/2009/07/2.JPG"><img src="http://blog.linym.net/wp-content/uploads/2009/07/2.JPG" alt="2" title="2" width="522" height="326" class="alignnone size-full wp-image-538" /></a></p>
<p><a href="http://blog.linym.net/wp-content/uploads/2009/07/3.JPG"><img src="http://blog.linym.net/wp-content/uploads/2009/07/3.JPG" alt="3" title="3" width="522" height="326" class="alignnone size-full wp-image-539" /></a></p>
<p><a href="http://blog.linym.net/wp-content/uploads/2009/07/4.JPG"><img src="http://blog.linym.net/wp-content/uploads/2009/07/4.JPG" alt="4" title="4" width="522" height="326" class="alignnone size-full wp-image-541" /></a><br />
‧輸入具有 Administrator 權限的使用者及密碼</p>
<p><a href="http://blog.linym.net/wp-content/uploads/2009/07/5.JPG"><img src="http://blog.linym.net/wp-content/uploads/2009/07/5.JPG" alt="5" title="5" width="522" height="326" class="alignnone size-full wp-image-542" /></a></p>
<p><a href="http://blog.linym.net/wp-content/uploads/2009/07/6.JPG"><img src="http://blog.linym.net/wp-content/uploads/2009/07/6.JPG" alt="6" title="6" width="406" height="416" class="alignnone size-full wp-image-543" /></a></p>
<p><a href="http://blog.linym.net/wp-content/uploads/2009/07/7.JPG"><img src="http://blog.linym.net/wp-content/uploads/2009/07/7.JPG" alt="7" title="7" width="368" height="252" class="alignnone size-full wp-image-544" /></a><br />
‧表示每 30 分鐘檢查一次連線狀況，可依需求修改，然後收工。</p>
<p>※ 備註：<br />
之所以選擇 ping www.hinet.net 而不用 IP 是因為經實驗結果，若網卡有設定 Default gateway，則可能會因為 gateway response 影響連線判斷。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.linym.net/archives/522/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>IE 下載 Office 2007 檔案變成 zip</title>
		<link>http://blog.linym.net/archives/221</link>
		<comments>http://blog.linym.net/archives/221#comments</comments>
		<pubDate>Tue, 17 Jun 2008 16:33:50 +0000</pubDate>
		<dc:creator>lym520</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[系統筆記]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[教學]]></category>

		<guid isPermaLink="false">http://blog.linym.net/?p=221</guid>
		<description><![CDATA[如果您的 Web Server 是採用 Apache，那有可能使用 Internet Explorer 下載 Office 2007(docx、ppts、xlsx...) 檔案的時候，會發現副檔名自動變成 .zip，有以下解決方法(擇一即可)： 一、修改 mime.types 檔案 加入： application/vnd.openxmlformats docx pptx xlsx 二、修改 httpd.conf 檔案 加入： AddType application/vnd.openxmlformats .docx .pptx .xlsx 三、使用 .htaccess 加入： AddType application/vnd.openxmlformats .docx .pptx .xlsx 參考文章：Office 2007 MIME types for Apache]]></description>
			<content:encoded><![CDATA[<p>如果您的 Web Server 是採用 Apache，那有可能使用 Internet Explorer 下載 Office 2007(docx、ppts、xlsx...) 檔案的時候，會發現副檔名自動變成 .zip，有以下解決方法(擇一即可)：</p>
<p><strong>一、修改 mime.types 檔案</strong><br />
加入：</p>
<pre>application/vnd.openxmlformats    docx pptx xlsx</pre>
<p><strong>二、修改 httpd.conf 檔案</strong><br />
加入：</p>
<pre>AddType  application/vnd.openxmlformats  .docx .pptx .xlsx</pre>
<p><strong>三、使用 .htaccess</strong><br />
加入：</p>
<pre>AddType  application/vnd.openxmlformats  .docx .pptx .xlsx</pre>
<p>參考文章：<a href="http://www.vladville.com/2007/04/office-2007-mime-types-for-apache.html">Office 2007 MIME types for Apache </a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.linym.net/archives/221/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在嵌入式 Linux 架設 Boa Webserver</title>
		<link>http://blog.linym.net/archives/180</link>
		<comments>http://blog.linym.net/archives/180#comments</comments>
		<pubDate>Tue, 18 Sep 2007 10:16:13 +0000</pubDate>
		<dc:creator>lym520</dc:creator>
				<category><![CDATA[Embedded]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[boa]]></category>

		<guid isPermaLink="false">http://blog.linym.net/archives/180</guid>
		<description><![CDATA[Boa 是一套小型的網頁伺服器，很適合應用在 Embedded System 上，並且內建就可以直接支援以 C 寫的 CGI 網頁，這篇是移植 Boa 到 ARM9 S3C2410 平台的過程，Linux 版本為 2.6.17.4，使用 arm-linux toolchain 3.4.1 編譯。 1. 產生 Makefile 下載 Source code 並解壓縮進到 src 目錄。 # ./configure --host=arm-linux 2. 修改 Makefile 使用跨平台編譯 CC = arm-linux-gcc CPP = arm-linux-gcc -E # make (如果編譯或執行時有錯誤請看Q&#038;A) # arm-linux-strip boa 3. 配置 Boa 可以在源碼目錄找到這個設定檔，放到 /etc/boa 裡面，有修改的部份如下： [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.boa.org/" target="_blank">Boa</a> 是一套小型的網頁伺服器，很適合應用在 Embedded System 上，並且內建就可以直接支援以 C 寫的 CGI 網頁，這篇是移植 Boa 到 ARM9 S3C2410 平台的過程，Linux 版本為 2.6.17.4，使用 arm-linux toolchain 3.4.1 編譯。</p>
<p><strong>1. 產生 Makefile</strong><br />
下載 Source code 並解壓縮進到 src 目錄。<br />
# ./configure --host=arm-linux</p>
<p><strong>2. 修改 Makefile 使用跨平台編譯</strong><br />
CC = <span style="color:blue">arm-linux-</span>gcc<br />
CPP = <span style="color:blue">arm-linux-</span>gcc -E<br />
# make (如果編譯或執行時有錯誤請看Q&#038;A)<br />
# arm-linux-strip boa</p>
<p><strong>3. 配置 Boa</strong><br />
可以在源碼目錄找到這個設定檔，放到 /etc/boa 裡面，有修改的部份如下：<br />
User 0<br />
Group 0<br />
#DirectoryMaker /usr/lib/boa/boa_indexer<br />
CGIPath /bin:/usr/bin:/var/www/cgi-bin<br />
ScriptAlias /cgi-bin/ /var/www/cgi-bin/</p>
<p>然後需要放一個 <a href='http://blog.linym.net/wp-content/uploads/2007/09/mime.zip' title='mime.zip'>mime.types</a> 檔案在 /etc，我是直接複製 ubuntu 裡的檔案。</p>
<p><strong>4. 加入 boa 執行檔</strong><br />
將編譯好的 boa 執行檔加入檔案系統 /bin，要啟動 server 只要輸入 boa 即可，可到 /var/log/boa 查看 log。</p>
<p><strong>問題 Q&#038;A：</strong><br />
<span id="more-180"></span><br />
<strong>Q：使用 toolchain 3.4.1 編譯出現錯誤</strong><br />
arm-linux-gcc  -g -O2 -pipe -Wall -I.   -c -o util.o util.c<br />
util.c:100:1: pasting &quot;t&quot; and &quot;->&quot; does not give a valid preprocessing token<br />
make: *** [util.o] Error 1<br />
A：修改 src/compat.h<br />
找到<br />
#define TIMEZONE_OFFSET(foo) foo##->tm_gmtoff<br />
修改成<br />
#define TIMEZONE_OFFSET(foo) (foo)->tm_gmtoff</p>
<p><strong>Q：執行 boa 出現 &quot;gethostbyname::No such file or directory&quot;</strong><br />
A：需將 boa.conf 裡的 ServerName 開頭註解拿掉</p>
<p><strong>Q：無法啟動 Boa，error log 顯示 &quot;boa.c:266.icky Linux kernel bug!:No such file&quot;</strong><br />
A：修改 src/boa.c，將底下判斷式註解掉：<br />
/*if (setuid(0) != -1) {<br />
    DIE(&quot;icky Linux kernel bug!&quot;);<br />
}*/<br />
重新編譯</p>
<p><strong>Q：無法啟動 Boa，error log 顯示 &quot;boa.c:211 - getpwuid....略&quot;</strong><br />
A：修改 src/boa.c，將底下兩個判斷式註解掉：<br />
/*if (passwdbuf == NULL) {<br />
    DIE(&quot;getpwuid&quot;);<br />
}<br />
if (initgroups(passwdbuf->pw_name, passwdbuf->pw_gid) == -1) {<br />
    DIE(&quot;initgroups&quot;);<br />
}*/<br />
重新編譯</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.linym.net/archives/180/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>線上製作 .htaccess 檔案</title>
		<link>http://blog.linym.net/archives/174</link>
		<comments>http://blog.linym.net/archives/174#comments</comments>
		<pubDate>Sun, 02 Sep 2007 02:41:58 +0000</pubDate>
		<dc:creator>lym520</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[好書好站]]></category>
		<category><![CDATA[Apache]]></category>

		<guid isPermaLink="false">http://blog.linym.net/archives/174</guid>
		<description><![CDATA[.htaccess 檔案是 Apache 伺服器裡的一項功能，可以提供管理者在目錄層級自定義一些瀏覽規則，一般常用的功能有：密碼保護、網頁重導向、存取限制、錯誤頁面等，不過 .htaccess 的語法實在是記不太起來，每次使用都要先去翻手冊或是找範例來參考。 「.htaccess Editor」這個網站可以線上幫您製作 .htaccess 檔案，而且還有正體中文語系，有了它就可以快速幫您產生一些常用的基本功能囉！ 怎麼使用？只要將產生的內容存成 .htaccess，放入要作用的網頁目錄即可。如果沒效果就是 Apache 設定為不允許使用 .htaccess，請參考手冊 AllowOverride 項目來修改。]]></description>
			<content:encoded><![CDATA[<p><a href="http://zh.wikipedia.org/w/index.php?title=.htaccess&#038;variant=zh-tw">.htaccess</a> 檔案是 Apache 伺服器裡的一項功能，可以提供管理者在目錄層級自定義一些瀏覽規則，一般常用的功能有：密碼保護、網頁重導向、<a href="http://blog.linym.net/archives/92">存取限制</a>、錯誤頁面等，不過 .htaccess 的語法實在是記不太起來，每次使用都要先去翻手冊或是找範例來參考。</p>
<p>「<a href="http://www.htaccesseditor.com/tc.shtml" target="_blank">.htaccess Editor</a>」這個網站可以線上幫您製作 .htaccess 檔案，而且還有正體中文語系，有了它就可以快速幫您產生一些常用的基本功能囉！</p>
<p>怎麼使用？只要將產生的內容存成 .htaccess，放入要作用的網頁目錄即可。如果沒效果就是 Apache 設定為不允許使用 .htaccess，請參考手冊 <a href="http://httpd.apache.org/docs/2.0/mod/core.html#allowoverride">AllowOverride</a> 項目來修改。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.linym.net/archives/174/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>可攜式 APM 網頁伺服器</title>
		<link>http://blog.linym.net/archives/127</link>
		<comments>http://blog.linym.net/archives/127#comments</comments>
		<pubDate>Sun, 03 Jun 2007 02:21:57 +0000</pubDate>
		<dc:creator>lym520</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[系統筆記]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Portable]]></category>
		<category><![CDATA[伺服器]]></category>

		<guid isPermaLink="false">http://lym.fyman.idv.tw/blog/archives/127</guid>
		<description><![CDATA[本文已移至新分頁：http://blog.linym.net/portableapm]]></description>
			<content:encoded><![CDATA[<p>本文已移至新分頁：<a href="http://blog.linym.net/portableapm">http://blog.linym.net/portableapm</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.linym.net/archives/127/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>MySQL 遠端連線設定</title>
		<link>http://blog.linym.net/archives/96</link>
		<comments>http://blog.linym.net/archives/96#comments</comments>
		<pubDate>Sat, 13 May 2006 03:27:58 +0000</pubDate>
		<dc:creator>lym520</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[系統筆記]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://lym.fyman.idv.tw/blog/archives/96</guid>
		<description><![CDATA[有些主機空間不開放使用 MySQL，這時就可以自己架一台 MySQL Server 並設定允許外部連線，讓沒有 MySQL 的主機也能使用。 方法很簡單，只要兩個關鍵步驟即可： 1) 開啟 TCP 3306 (預設 MySQL Port)。 2) 新增一個 User，主機(Host) 為允許連線的網域或 IP，如果不限制可以用「%」表任何主機。 如果不行請檢查 mysql 設定檔 (my.ini 或 my.cnf)，註解下面文字 skip-networking bind-address=127.0.0.1]]></description>
			<content:encoded><![CDATA[<p>有些主機空間不開放使用 MySQL，這時就可以自己架一台 MySQL Server 並設定允許外部連線，讓沒有 MySQL 的主機也能使用。<br />
方法很簡單，只要兩個關鍵步驟即可：</p>
<blockquote><p>1) 開啟 TCP 3306 (預設 MySQL Port)。<br />
2) 新增一個 User，主機(Host) 為允許連線的網域或 IP，如果不限制可以用「%」表任何主機。</p></blockquote>
<p>如果不行請檢查 mysql 設定檔 (my.ini 或 my.cnf)，註解下面文字<br />
skip-networking<br />
bind-address=127.0.0.1</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.linym.net/archives/96/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

