<?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>{finalbug} &#187; FreeBSD</title>
	<atom:link href="http://finalbug.org/tag/freebsd/feed/" rel="self" type="application/rss+xml" />
	<link>http://finalbug.org</link>
	<description>Keep it simple &#38; stupid</description>
	<lastBuildDate>Sun, 05 Feb 2012 13:27:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>xfce4记录</title>
		<link>http://finalbug.org/2008/10/xfce4%e8%ae%b0%e5%bd%951-2/</link>
		<comments>http://finalbug.org/2008/10/xfce4%e8%ae%b0%e5%bd%951-2/#comments</comments>
		<pubDate>Sun, 12 Oct 2008 09:18:04 +0000</pubDate>
		<dc:creator>Tang Bin</dc:creator>
				<category><![CDATA[学习笔记]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Xfce]]></category>

		<guid isPermaLink="false">http://www.finalbug.com/?p=322</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>昨天重新在虚拟机中的FreeBSD上安装了xfce4。稍做记录。</p>
<p><span id="more-2832"></span></p>
<p>安装FireFox直接使用package安装即可，不一定需要通过ports，上次通过ports安装FF，用了差不多三个多小时。</p>
<p>安装SCIM需要先安装SCIM程序，这个只是输入法的支持，但是并不是输入法。SCIM可以通过package安装：</p>
<p><code>pkg_add -r SCIM</code></p>
<p>然后需要根据需要安装输入法。我只用拼音输入法，因此我只需要安装scim-pinyin即可。如果安装scim-stable，会安装很多的输入法，但是基本上是我不需要的。安装scim-pinyin我是用的ports，地址在chinese/scim-pinyin。下载和安装的速度都非常的快。</p>
<p>通过修改/etc/passwd文件可以修改使用的shell类型。root默认的是csh，但是在安装的时候创建的账户使用的是sh。我将其改为csh，但是我感觉不出来。其实目前来说，我只能简单的分别bash和sh而已。</p>
<p>在网上看到说要设置XMODIFIERS，如下：</p>
<p><code>csh/tcsh：setenv XMODIFIERS @im=SCIM<br />
sh/bash：export XMODIFIERS='@im=SCIM'</code></p>
<p>这是输入法环境变量，实际上是指定X的输入法。我没有设置这个东西，不清楚其具体的效果到底是什么样。不过现在，我依旧只能将终端和Editor（记事本）里面使用SCIM输入中文，FF里面无法启动中文输入。而且中文的显示一塌糊涂，字体的大小参差不齐。不知道如何修改。</p>
<p>在用户根目录下有一个xinitrc文件，是用启动X时的配置，安装完成xfce4以后，将xfce4的启动路径写在这里，使用startx启动X的时候就能启动xfce4。不过我加入了一些其他的东西，比如上面的setenv，貌似没有什么效果，不知道是为什么，下次google。</p>
]]></content:encoded>
			<wfw:commentRss>http://finalbug.org/2008/10/xfce4%e8%ae%b0%e5%bd%951-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>成功使用gnome</title>
		<link>http://finalbug.org/2008/08/%e6%88%90%e5%8a%9f%e4%bd%bf%e7%94%a8gnome/</link>
		<comments>http://finalbug.org/2008/08/%e6%88%90%e5%8a%9f%e4%bd%bf%e7%94%a8gnome/#comments</comments>
		<pubDate>Sun, 24 Aug 2008 12:47:29 +0000</pubDate>
		<dc:creator>Tang Bin</dc:creator>
				<category><![CDATA[学习笔记]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Gnome]]></category>

		<guid isPermaLink="false">http://www.finalbug.com/?p=285</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>今天成功解决USB鼠标问题，使用gnome。。</p>
<p><span id="more-285"></span></p>
<p>我一直以为是因为使用了KVM switch，所以在X -config的时候总是会出现UMS1 busy的信息。KVM switch在外接端虽然有鼠标和键盘两个USB口，但是链接到PC上的只有一个USB线，所以我一直在怀疑是FreeBSD无法辨识KVM switch。但是后来在shell里面，UBS mouse运行良好，只有在启动gnome以后才出现这个问题，我想应该算是mouse本身的问题了。后来在网上搜索了不少内容，也尝试了一些方法，找到原因。原来要在gnome里面使用USB鼠标，需要禁掉moused。</p>
<p>关于moused的说明，摘录如下：</p>
<p><code>The moused utility and the console driver work together to support mouse operation in the text console and user programs.  They virtualize the mouse and provide user programs with mouse data in the standard format(see sysmouse(4)).</code></p>
<p>不知道是什么原因，gnome是不使用moused的，因此需要禁止掉。首先是修改/etc/rc.conf，将MOUSED_ENABLED设置为NO，然后修改/etc/devd.conf，找到里面关于启动时使用moused的部分，然后全部注释掉。我不懂devd.conf里面的代码是什么意思，但是根据里面的描述，我估计是启动X的时候需要使用的内容吧。然后重启。虽然网上有说可以通过shutdown now + exit来不重启就应用rc.conf等配置，但是貌似对我的无效，所以还是直接reboot一下。。</p>
<p>再之后，gnome就运行正常了！gnome带了FireFox2，支持中文，但是因为没有字体，所以中文显示明显的参差不齐。</p>
<p><img class="alignnone size-full wp-image-286" title="11" src="http://www.finalbug.com/wp-content/uploads/2008/08/11.jpg" alt="" width="560" height="448" /></p>
<p>然后我通过portupgrade升级FireFox，以及安装OpenOffice。</p>
<p><img class="alignnone size-full wp-image-287" title="21" src="http://www.finalbug.com/wp-content/uploads/2008/08/21.jpg" alt="" width="560" height="522" /></p>
<p>结果耗时4个小时也没有搞定。后来我就直接^C了。。</p>
<p>这台老的Dell PC的配置都还挺标准，因此除了声卡以外其他都是默认的就被驱动了。但是因为速度不够快，gnome运行起来也不是那么的流畅，不过还是比XP稍微好一点，毕竟东西不多。接下来我可能会玩玩KDE和XFce，然后再回到shell里面，毕竟使用X并不是用FreeBSD的目的，我只是按照handbook的步骤在一步一步的学习而已。</p>
]]></content:encoded>
			<wfw:commentRss>http://finalbug.org/2008/08/%e6%88%90%e5%8a%9f%e4%bd%bf%e7%94%a8gnome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>关于FB 随图</title>
		<link>http://finalbug.org/2008/08/%e5%85%b3%e4%ba%8efb-%e9%9a%8f%e5%9b%be-2/</link>
		<comments>http://finalbug.org/2008/08/%e5%85%b3%e4%ba%8efb-%e9%9a%8f%e5%9b%be-2/#comments</comments>
		<pubDate>Fri, 22 Aug 2008 04:46:30 +0000</pubDate>
		<dc:creator>Tang Bin</dc:creator>
				<category><![CDATA[学习笔记]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[照片]]></category>

		<guid isPermaLink="false">http://www.finalbug.com/?p=283</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>KVM已经开始使用了，后来买了80个卷线的带子，把桌子后面的线都全部整理了一下，要好看多了~~</p>
<p><span id="more-2830"></span></p>
<p><img class="alignnone size-full wp-image-279" title="1" src="http://www.finalbug.com/wp-content/uploads/2008/08/1.jpg" alt="" width="560" height="209" /></p>
<p>后来证明，使用KVM，USB鼠标和键盘在FreeBSD下面都是可以被找到和使用的。键盘用起来没有问题，但是鼠标死活用不出来。开始的时候鼠标也不能用，后来修改了rc.conf，貌似也就没什么问题了，但是只能在命令行下面使用。进入gnome以后鼠标一动不懂。无论我怎么修改xorg.conf，无论是使用ums0还是别的什么，就是运行不起来。很奇怪。。</p>
<p>下面几个图是命令行下面使用links浏览网页的内容。hehe，很有意思~~</p>
<p>看出来这个是哪个网站了么？hehe。没错，是51job.com。<br />
<img class="alignnone size-full wp-image-280" title="2" src="http://www.finalbug.com/wp-content/uploads/2008/08/2.jpg" alt="" width="560" height="420" /></p>
<p>51job.com首页上的那些广告图片，在这里显示的就是一排一排的[img]。。。<br />
<img class="alignnone size-full wp-image-281" title="3" src="http://www.finalbug.com/wp-content/uploads/2008/08/3.jpg" alt="" width="560" height="421" /></p>
<p>然后打开finalbug.com看看，图片当然是不可能有的，中文支持也没有，因此除了英文的内容，其他都看不到，但是英文的内容显示还是非常好的。所以说，技术文档，还是需要用英文来保留的，通用性很强。<br />
<img class="alignnone size-full wp-image-282" title="4" src="http://www.finalbug.com/wp-content/uploads/2008/08/4.jpg" alt="" width="560" height="420" /></p>
<p>玩了会links，发现google的界面是最好用的。而且在links中还保留了原有的界面布局。。。gmail都能正常登陆。不过中文的显示不出来而已。..</p>
]]></content:encoded>
			<wfw:commentRss>http://finalbug.org/2008/08/%e5%85%b3%e4%ba%8efb-%e9%9a%8f%e5%9b%be-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2008/08/13记 为FB的准备</title>
		<link>http://finalbug.org/2008/08/20080813%e8%ae%b0/</link>
		<comments>http://finalbug.org/2008/08/20080813%e8%ae%b0/#comments</comments>
		<pubDate>Wed, 13 Aug 2008 00:35:13 +0000</pubDate>
		<dc:creator>Tang Bin</dc:creator>
				<category><![CDATA[生活]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[照片]]></category>

		<guid isPermaLink="false">http://www.finalbug.com/?p=266</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>经过反复的思考，我发现我犯了一个意识上的错误，从今天开始我应该逐步的改正这个错误。最近一直为转向FreeBSD上的开发做准备。对我来说FreeBSD是一个全新的东西，需要一步一步的来做。。</p>
<p><span id="more-266"></span></p>
<p>0810——<br />
上周日在家里等着KVM switch的到来，结果一直没来，也许应该怪这个不太友好的天气，颇有山雨欲来风满楼的气势。其实当天的雨很小。不过气温却是降下了不少。<br />
<img class="alignnone size-full wp-image-263" title="img_0009" src="http://www.finalbug.com/wp-content/uploads/2008/08/img_0009.jpg" alt="" width="630" height="472" /></p>
<p>0811——<br />
我的KVM switch到家了！这个小玩意儿花了我390RMB，真觉得有些不值。<br />
<img class="alignnone size-full wp-image-264" title="img_0012" src="http://www.finalbug.com/wp-content/uploads/2008/08/img_0012.jpg" alt="" width="630" height="472" /></p>
<p>晚上要去打球，拆了封还没试试。这是一个VGA+USB的switch，分别外接键盘和鼠标，但是链接到主机上的只有一个USB口。看来我的理解也许有一些错误，这个不应该只是机械直连的转换。我很担心在FreeBSD上是否能用。</p>
<p>0812——<br />
我一直后悔书桌组合没有买好，我的机器几乎没有可以放的地方，如果放下又会在地板上产生死角，很麻烦。把KVM switch装上以后，桌下的线路乱成一团。。<br />
<img class="alignnone size-full wp-image-265" title="img_0014" src="http://www.finalbug.com/wp-content/uploads/2008/08/img_0014.jpg" alt="" width="630" height="472" /></p>
<p>我担心的事情果然还是发生了，KVM switch是作为一个USB hub设备被电脑辨识的，因此在vista下面运行良好，不过每次启动都弹出找到新硬件，真是麻烦。<br />
FreeBSD上就没有那么幸运了，只有VGA信号能转换到显示器上，鼠标和键盘根本就不给供电，指示灯都点不亮。在进入login状态时，无法输入。于是我拔掉了KVswitch链接到FreeBSD主机上的USB口，居然报出设备I/O错误。看来问题在于FreeBSD不能驱动这个设备，而不是找不到。看KVM switch的说明书上有Linux驱动，我想也许可以想办法让其运行在FreeBSD上。</p>
<p>关于FreeBSD的启动磁盘的问题，摘录两段文字。</p>
<p>摘自《FreeBSD使用手册》</p>
<p><code>在PC架构，BIOS 有能力改变正常的磁盘顺序， 然后这些操作系统会跟着 BIOS 做改变。这让使用者不一定非要有所谓的 “primary master” 硬盘开机。许多人发现最简单而便宜备份系统的方式就是再去买一块一模一样的硬盘，然后定期将数据从第一块硬盘复制到第二个硬盘，使用 Ghost® 或 XCOPY。所以，当第一个硬盘死了， 或者是被病毒破坏，或者有坏轨道，他们可以调整 BIOS 中的开机顺序而直接用第二块硬盘开机。就像交换硬盘的数据线，但是无需打开机箱。</p>
<p>习惯于使用这种方式的使用者可能会感到惊讶， 因为在 FreeBSD 中并非如此。FreeBSD 不会参考 BIOS， 而且也不知道所谓的 “BIOS 逻辑磁盘对应” 是怎么回事。这会让人感觉很疑惑，明明就是一样的硬盘而且资料也完全从另一块复制过来的， 结果却没办法像以前那样用。</p>
<p>当使用 FreeBSD 以前，请将 BIOS 中的硬盘开机顺序调回正常的顺序，并且以后不要再改变。 如果一定要交换硬盘顺序， 那请用硬件的方式， 打开机箱并调整调线。</code></p>
<p>搜索自Google：<br />
<code><br />
主板一般拥有两个IDE接口，可分别连接两条IDE数据线。而每条IDE数据线上有两个IDE接口，可分别连接两个IDE设备，这两个IDE接口，就分别是“Master“（主盘）接口和“Slave“（从盘）接口。</p>
<p>顾名思义，“Master“（主盘）就是系统启动首先读取并引导的盘，对于装有操作系统的硬盘来说，最好将它设置为“Master“（主盘），这样系统才能被正确引导。</p>
<p>同时，需要指出的是，在一条IDE线上，仅能同时拥有一个主盘，一个从盘。在同条IDE线上接两个主盘，或两个从盘的做法都是不可取的，应通过更改硬盘 跳线的方式纠正过来。通过跳线设置主盘和从盘的方法，每个厂家都有各自的标准，大家可以在IDE设备的盘面上，找到相关的图注或标志。一般情况 下，“Master“的简写是“MA“, “Slave“的简写是“SLA“，在IDE设备电源接口旁边，找到MA或SLA的标注，将其下方的两根跳线针用跳线帽接通，就算开启了相应的模式。</code></p>
<p>虽然在我的Dell PC上没有遇到这个问题，但是因为反复的调整和以前随意的设置，我想其中的BIOS设置和硬盘的接线和跳线都是乱七八糟的，需要好好调整一下。可能很多人会讨厌FreeBSD这种“不友好”的方式，但这也是我喜欢FreeBSD的地方，我喜欢这种顽固的死板。那句话怎么说的？XXX用多了，人都会变笨的！</p>
]]></content:encoded>
			<wfw:commentRss>http://finalbug.org/2008/08/20080813%e8%ae%b0/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>FreeBSD on Ubuntu</title>
		<link>http://finalbug.org/2008/07/freebsd-on-ubuntu/</link>
		<comments>http://finalbug.org/2008/07/freebsd-on-ubuntu/#comments</comments>
		<pubDate>Tue, 29 Jul 2008 14:11:37 +0000</pubDate>
		<dc:creator>Tang Bin</dc:creator>
				<category><![CDATA[学习笔记]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.finalbug.com/?p=234</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>although i have a 320GB hard disk, i dont want to install 3 OSs in it, one windows, one linux and one UNIX, so i install my FreeBSD in a virtual mechine on ubuntu.</p>
<p><span id="more-234"></span></p>
<p>first, i install vbox(Sun xVM VirtualBox) by using apt-get, it is OSE(open source edition) and it seems cannot work on my computer. so i removed it and download a binary version from <a href="http://www.virtualbox.org/wiki/downloads">http://www.virtualbox.org/wiki/downloads</a>. it works well after i remove KVM. i dont know what is KVM for but vbox asked me to disable it, so i remove it.</p>
<p>btw, why i dont try to install freebsd in vmware on windows? or why i dont use vmware for linux? beacuse i dont have enough money to pay it after i bought a DV last mouth <img src='http://finalbug.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>err&#8230; freebsd is working well on my ubuntu now and it is doing cvsup during i input these words. some problems almost make me to give it up, and i will write it next time.</p>
<p>2 things are important</p>
<ol>
<li><strong>vbox or KVM, make a choise.</strong></li>
<li><strong>Dont use OSE vbox.</strong></li>
</ol>
<p>it is horrible for me to write in english. i hate english&#8230;but i must use it! dont ask me why!</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
following words are written by me at next day:</p>
<p>i remeber what is KVM now, i read a topic named “KVM is much faster than other virtual machines” (i am not sure the topic name, but it is the author&#8217;s major point) last weekend, so i searched and installed KVM by using apt-get, but i put it away when i found i dont know how to use it after install successful and throw it out of my mind. that&#8217;s why there is a KVM in my ubuntu i think..</p>
<p>install freebsd in vbox is fast! i think it owe to my new intel E8400 CPU and 2G memory. i spend about 20mins to install freebsd in vmware on window XP at my office, but install it on my personal desktop, it only costs me one or two mins.</p>
<p>i try to connect to internet in freebsd, i dont know how to use bridge connection in vbox, so i use NAT again. it is working well on my wire card, i think i need to try to use wireless card later.</p>
<p>after that, i did following steps:</p>
<ol>
<li> copy ports-supfile from example dir to my home dir, renamed it to billy-supfile.</li>
<li> open billy-supfile by ee, change site address to cvsup.cn.freebsd.org.</li>
<li> use csup and billy-supfile to upgrade ports collection. and it works!</li>
</ol>
<p>that&#8217;s what i did upto now, and it is my first time to use ports collection, i will try to install apache later, and my wireless card..</p>
]]></content:encoded>
			<wfw:commentRss>http://finalbug.org/2008/07/freebsd-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>big hit</title>
		<link>http://finalbug.org/2008/07/big-hit/</link>
		<comments>http://finalbug.org/2008/07/big-hit/#comments</comments>
		<pubDate>Mon, 28 Jul 2008 11:18:46 +0000</pubDate>
		<dc:creator>Tang Bin</dc:creator>
				<category><![CDATA[学习笔记]]></category>
		<category><![CDATA[FreeBSD]]></category>

		<guid isPermaLink="false">http://www.finalbug.com/?p=230</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>i installed FreeBSD on <em>webops</em> server nearby my desk, of cause it is running on vmware whit NAT network. i tried to cvsup for serveral times last week but no effects. i thought it must some wrong with my network settings in vmware, so i changed some of them and try again today but, still not work. i use setenv to set http and ftp proxy, and connect to cvsup.cn.freebsd.org to upgrade, it cannot connect to server. iam crazy&#8230;</p>
<p><span id="more-230"></span></p>
<p>from google, i found this:</p>
<p><code>You can run cvsup through NAT traversal, if you have an unroutable<br />
IP, but your network must allow port 5999/tcp to pass through. If<br />
you only have HTTP access via a proxy server, your network has<br />
admirable security, but you will not be able to use cvsup. </code></p>
<p>somebody meets the same problem as mine, but unfortunately, my corp&#8217;s proxy only enable HTTP proxy at port 80. so&#8230;damn it!</p>
<p>but the comment is posted about 3years ago, maybe there is a way to solve my question..maybe not. iam not sure, and google dont know either&#8230;if i cannot use cvsup vir HTTP proxy at port 80, i am afraid i must say goodbye to FreeBSD at corp..</p>
<p>on the same way, ubuntu do it much better than freebsd, apt-get is so cool!!</p>
]]></content:encoded>
			<wfw:commentRss>http://finalbug.org/2008/07/big-hit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>怀念一下FreeBSD</title>
		<link>http://finalbug.org/2007/12/%e6%80%80%e5%bf%b5%e4%b8%80%e4%b8%8bfreebsd/</link>
		<comments>http://finalbug.org/2007/12/%e6%80%80%e5%bf%b5%e4%b8%80%e4%b8%8bfreebsd/#comments</comments>
		<pubDate>Mon, 17 Dec 2007 05:31:55 +0000</pubDate>
		<dc:creator>Tang Bin</dc:creator>
				<category><![CDATA[学习笔记]]></category>
		<category><![CDATA[FreeBSD]]></category>

		<guid isPermaLink="false">http://finalbug.cn/?p=118</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>使用FreeBSD的计划没想到这么快就夭折了。因为服务器的内存出了问题，拿到IT部去修理。结果被IT换成了windows 2003企业版，而且眼看AIS项目就要开工了，也没有再多的时间去搞服务器，看来只能先继续用着了。</p>
<p>现在刚算FreeBSD上手就没有没可用了，的确很遗憾哎。不过反正我对FreeBSD也不是很熟悉，如果真要实际应用，还有一些差距。加之网络的原因，ports都无法使用，用FreeBSD还是比较痛苦的。至少最近学习服务器而做出的努力也不算白费。等有时机成熟的时候再回来吧！</p>
]]></content:encoded>
			<wfw:commentRss>http://finalbug.org/2007/12/%e6%80%80%e5%bf%b5%e4%b8%80%e4%b8%8bfreebsd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FreeBSD学习</title>
		<link>http://finalbug.org/2007/11/freebsd%e5%ad%a6%e4%b9%a0-2/</link>
		<comments>http://finalbug.org/2007/11/freebsd%e5%ad%a6%e4%b9%a0-2/#comments</comments>
		<pubDate>Thu, 22 Nov 2007 08:08:32 +0000</pubDate>
		<dc:creator>Tang Bin</dc:creator>
				<category><![CDATA[学习笔记]]></category>
		<category><![CDATA[FreeBSD]]></category>

		<guid isPermaLink="false">http://finalbug.cn/?p=113</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>今天早上到公司以后，习惯性的SVN，突然发现SVN服务器连接不上，打开服务器的显示器，发现了下面的代码：</p>
<p>[code]<br />
kernel trap 12 with interrupts disabled</p>
<p>Fatal trap 12: page fault while in kernel mode<br />
cpuid = 0; apic id = 00<br />
fault virtual address = 0x48<br />
fault code                = supervisor read, page not present<br />
instruction pointer   = 0x20:0xc0686e83<br />
stack pointer         = 0x28:0xe5738ce4<br />
frame pointer         = 0x28:0xe5738d00<br />
code segment          = base 0x0, limit 0xfffff, type 0x1b<br />
= DPL 0, pres 1, def32 1, gran 1<br />
processor eflags      = resume, IOPL = 0<br />
current process       = 45 (schedcpu)<br />
trap number           = 12<br />
panic: page fault<br />
cupid = 0<br />
Uptime: 1m27s<br />
Cannot dump. No dump device defined.<br />
Automatic reboot in 15 seconds - press a key on the console to abort<br />
Rebooting...<br />
cup_reset: Stopping other CUPs<br />
[/code]</p>
<p>这东西着实很让我郁闷，因为我根本不知道是怎么回事。在google了无数次＋论坛求助以后，基本确定是硬件出问题了。后来根据论坛上的帮助，我将BIOS全部恢复成默认以后，就没有问题了～奇怪～</p>
<p>虽然最终还是没有弄明白这个是怎么回事，不过好歹没问题了。把报错信息保留下来，也许某一天我回来看的时候都全明白了。</p>
<p>另外，今天发现两个很有用的地址，一个是最新的FreeBSD6.2的handbook：</p>
<p><a href="http://cnsnap.cn.freebsd.org/doc/zh_CN.GB2312/books/handbook/">http://cnsnap.cn.freebsd.org/doc/zh_CN.GB2312/books/handbook/</a></p>
<p>另外一个是关于port和package的安装QF：</p>
<p><a href="http://www.freebsdchina.org/forum/viewtopic.php?t=14435">http://www.freebsdchina.org/forum/viewtopic.php?t=14435</a></p>
]]></content:encoded>
			<wfw:commentRss>http://finalbug.org/2007/11/freebsd%e5%ad%a6%e4%b9%a0-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New FinalBug.CN 1</title>
		<link>http://finalbug.org/2007/11/new-finalbugcn-1/</link>
		<comments>http://finalbug.org/2007/11/new-finalbugcn-1/#comments</comments>
		<pubDate>Tue, 20 Nov 2007 08:43:14 +0000</pubDate>
		<dc:creator>Tang Bin</dc:creator>
				<category><![CDATA[学习笔记]]></category>
		<category><![CDATA[FreeBSD]]></category>

		<guid isPermaLink="false">http://finalbug.cn/?p=108</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>在考虑和准备了不少时间以后，终于打算改版我的个人站了。</p>
<p>一直都有考虑要做一个RIA综合站点，但是总是在计划的时候就夭折了。虽说网站没有动工，技术和经验还是积累起来了。装修完成了，家也搬过来了，调试服务器也到手了，虽然最终的部署服务器还是个大问题，但是至少在这个问题出现之前，我可以开始动手了。</p>
<p>从上大学之前就开始学习计算机和软件技术，虽然没有大成，但是也杂七杂八的学了不少的东西。也许是个机会，把我学过的 、相关的技术全都用进来，顺便学学更多的技术。</p>
<p>这次的改版开发时间计划是6个月，client和server全手动开发，client使用AS3为主，服务器使用C编写socket服务器（真是一个大考验，C我已经忘光了），FreeBSD系统，加油！</p>
<p>2009年4月23日记：这个计划只执行了不到一个星期就完全被放弃了。。。</p>
]]></content:encoded>
			<wfw:commentRss>http://finalbug.org/2007/11/new-finalbugcn-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>学习FreeBSD － 初次探索</title>
		<link>http://finalbug.org/2007/11/%e5%ad%a6%e4%b9%a0freebsd-%ef%bc%8d-%e5%88%9d%e6%ac%a1%e6%8e%a2%e7%b4%a2-2/</link>
		<comments>http://finalbug.org/2007/11/%e5%ad%a6%e4%b9%a0freebsd-%ef%bc%8d-%e5%88%9d%e6%ac%a1%e6%8e%a2%e7%b4%a2-2/#comments</comments>
		<pubDate>Fri, 09 Nov 2007 08:23:00 +0000</pubDate>
		<dc:creator>Tang Bin</dc:creator>
				<category><![CDATA[学习笔记]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[SVN]]></category>

		<guid isPermaLink="false">http://finalbug.cn/?p=101</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>一直都很想尝试将RIA的服务器移到FreeBSD上，因为工作原因，我现在有一个独立控制的服务器，除了不能从互联网上下载以外，其他都可以自由控制。于是我就有了一个尝试和学习FreeBSD的机会。</p>
<p>我安装的是6.2版本，虽然以前有一点点Liunx的经验，但是FreeBSD的上手还是费了我不少时间。在安装了3次系统以后，终于基本上算是上手了。。</p>
<p>现在我需要这个服务器需要提供SVN，apache＋PHP，FTP，mysql的服务。在此记录我的安装过程。<span id="more-2824"></span></p>
<p>1，SVN</p>
<p>其实FreeBSD6.2是自带SNV1.4.0版的服务器的。所以SVN就不需要安装了。</p>
<p>但是我遇到一个问题，使用svnserve启动了SVN以后，从别的机子一直都无法连接SVN，每次的错误都是“服务器积极拒绝”，在windows上安装SVN服务器的时候没有遇到这样的问题。但是在svnserve启动的时候加入&#8211;listen-host要求监听服务器的IP后，一切都正常了。奇怪，难道SVN默认监听localhost所以当在其他电脑上连接的时候会被拒绝？不清楚。但是问题是解决了。</p>
<p>另外一个问题，我没找到关闭SVN的方法，所以每次关闭SVN，我需要通过“ps x”命令罗列出所有进程和UID，然后找到svnserve的UID，使用kill -r UID来强制的关闭进程。不知道是不是应该有其他的方法呢？</p>
<p>2，mysql</p>
<p>mysql让我郁闷了很久，明明在安装系统的时候提到mysql应用的，为什么我就找到mysql被安装到哪儿了呢？后来才发现，FreeBSD系统带的是mysql应用，是client端的，而mysqld服务器，是要自己另外安装的。</p>
<p>因为没有办法通过port下载，所以我直接下载了mysql的package。我使用的是mysql5.0.45。</p>
<p>使用了无数次google以后，我在mysql的官网上找到了最直接的安装步骤：</p>
<p>shell&gt; <strong>pw groupadd mysql</strong><br />
shell&gt; <strong>pw useradd -g mysql mysql</strong><br />
shell&gt; <strong>cd /usr/local</strong><br />
shell&gt; <strong>gunzip &lt; /path/to/mysql-VERSION-OS.tar.gz | tar xvf -</strong><br />
shell&gt; <strong>ln -s full-path-to-mysql-VERSION-OS mysql</strong><br />
shell&gt; <strong>cd mysql</strong><br />
shell&gt; <strong>chown -R mysql .</strong><br />
shell&gt; <strong>chgrp -R mysql .</strong><br />
shell&gt; <strong>scripts/mysql_install_db &#8211;user=mysql</strong><br />
shell&gt; <strong>chown -R root .</strong><br />
shell&gt; <strong>chown -R mysql data</strong><br />
shell&gt; <strong>bin/mysqld_safe &#8211;user=mysql &amp;</strong></p>
<p>关于这个步骤的说明，现在大概已经比较清楚了， 有空的时候再来一一记下。</p>
<p>3，FTP</p>
<p>FreeBSD也自带了一个ftpd工具。虽然功能非常非常非常的弱，但是基本上能满足我内部使用的要求，所以暂时就不安装其他的了。ftpd有两个文件是用来设定权限的，一个是/etc/fptusers，里面罗列了所有不能通过ftp访问系统的用户名。另外一个是/etc/ftpchroot，里面罗列了所有将被锁定在根目录的用户名。ftpchroot文件默认是不存在的，因此需要自己手动建立一个。</p>
<p>这个自带的ftpd系统的目的是为了通过ftp协议方便系统的用户访问系统的文件。因此，每个新建的用户都有默认的ftp权限，可以其根目录是/home下的用户根目录，或者是其他设置的目录。</p>
<p>4，apache+php</p>
<p>Apache和PHP的安装我在网上找到了一个不错的教程，我完全按照这个教程操作，没有任何问题的安装并整合了apache和php。转贴教程如下：</p>
<blockquote><p>安装Apache要简单点,我这里安装的Apache版本是 httpd-2.0.50,去下载压缩包：<br />
<code></p>
<p>http://httpd.apache.org/download.cgi</p>
<p></code><br />
下载回来的包叫做 httpd-2.0.50.tar.gz 我们放在 /usr/local/src目录下。<br />
首先进入目录后解压缩：<br />
<code><br />
# cd /usr/local/src<br />
# tar -zxvf httpd-2.0.50.tar.gz<br />
</code><br />
然后就会得到 httpd-2.0.50目录,我们进入目录<br />
<code><br />
# cd httpd-2.0.50<br />
</code><br />
首先配置:<br />
<code><br />
# ./configure<br />
? --prefix=/usr/local/apache   #我们要把Apache安装在那个目录,我们这里装在 /usr/local/apache下<br />
? --enable-shared=max<br />
? --enable-module=rewrite<br />
? --enable-module=so<br />
</code><br />
执行上面的命令,如果没有错误信息,证明配置成功,然后进行编译:<br />
<code><br />
# make<br />
</code><br />
一两分钟就编译完了,然后进行安装:<br />
<code><br />
# make install<br />
</code><br />
安装完成后,Apache就存放在 /usr/local/apache目录下了, bin是执行文件的目录,conf是配置文件目录,htdocs是网页的主目录,logs是日志目录。<br />
Apache通过 bin/apachectl或者bin/httpd来控制启动或者停止.<br />
<code><br />
# /usr/local/apache/bin/httpd -k start #启动apache<br />
# /usr/local/apache/bin/httpd -k stop #停止apache<br />
# /usr/local/apache/bin/httpd -k restart #重启apache<br />
</code><br />
然后你可以通过 http://localhost 来测试apache是否安装成功,如果出现apache的页面则安装成功,否则请检查上面的步骤.</p>
<p><strong>安装PHP</strong></p>
<p>我们使用的PHP版本是4.3.8,先去下载: http://www.php.net/downloads.php, 下回来的包叫做 php-4.3.8.tar.gz, 放到/usr/local/src目录下.<br />
首先进入该目录后解压缩:<br />
<code><br />
# cd /usr/local/src<br />
# tar -zxvf php-4.3.8.tar.gz<br />
</code><br />
解压后进入目录:<br />
<code><br />
# cd php-4.3.8<br />
</code><br />
进行配置,这一步比较关键,一定要设置好,特别是要考虑到你要支持什么,比如GD库,xml,mysql等等,如果想知道详细的配置,执行 ./configure &#8211;help来获得:<br />
<code><br />
# ./configure<br />
? --with-apxs2=/usr/local/apache/bin/apxs<br />
? --disable-debug  #关闭php内部调试<br />
? --enable-safe-mode  #打开php的安全模式<br />
? --enable-trans-sid<br />
? --with-xml  #支持xml<br />
? --with-mysql  #支持mysql<br />
? --enable-short-tags  #支持PHP的短标记<br />
? --with-gd  #支持GD库<br />
? --with-zlib  #支持zlib<br />
? --with-jpeg<br />
? --with-png<br />
? --enable-memory-limit<br />
? --disable-posix<br />
? --with-config-file-path=/usr/local/lib<br />
</code><br />
如果上面的配置没有错误的话,那么应该最后会显示感谢使用PHP等字样,那么证明配置成功,如果上面的配置选项不支持的话,会提示错误.<br />
比如你没有安装mysql,那么&#8211;with-mysql就无法使用,所以一定要注意对应选项系统是否能够支持,如果出现错误,那么就先安装对应的程序,或</p>
<p>者去掉相关选项.<br />
配置之后就进行编译:<br />
<code><br />
# make<br />
</code><br />
编译成功后出现”Build complete.”字样,那么就可以进行安装了:<br />
<code><br />
# make install<br />
</code><br />
安装完成后把/usr/local/src/php-4.3.8/php.ini-dist复制到/usr/local/lib/，并重命名为php.ini<br />
<code><br />
# cp /usr/local/src/php-4.3.8/php.ini-dist /usr/local/lib/php.ini<br />
</code><br />
基本到这里PHP就安装成功了,如果中间出现错误,除了在配置的时候没有选对选项之后一般都不出现错误.</p>
<p><strong>整合Apache+PHP</strong></p>
<p>为了让Apache能够直接解析php,我们还要进行一些配置.<br />
首先进入apache的配置文件目录:<br />
<code><br />
# cd /usr/local/apache/conf<br />
</code><br />
然后用vi打开配置文件httpd.conf:<br />
<code><br />
# vi httpd.conf<br />
</code><br />
在httpd.conf文件中，添加<br />
<code><br />
AddType application/x-httpd-php .php<br />
AddType application/x-httpd-php-source .phps<br />
</code><br />
应该将以上两句添加在其他AddType之后。</p>
<p>确保文件中有以下一句话，没有就自己添加在所有LoadModule之后。<br />
<code><br />
LoadModule php4_module  modules/libphp4.so<br />
</code><br />
好了,在vi中使用”:wq”保存httpd.conf文件，退出vi。启动apache server:<br />
<code><br />
# /usr/local/apache/bin/httpd start<br />
</code></p>
<p>现在apache就能够运行php了,写个文件测试一下,在/usr/local/apache/htdocs目录下，新建一个phpinfo.php文件，<br />
文件中只有一行代码:<br />
<code><br />
&lt;? phpinfo(); ?&gt;;<br />
</code><br />
保存此文件, 在你的浏览器中输入http://localhost/phpinfo.php，你应该看到PHP的系统信息。<br />
如果出现错误,比如提示你下灾phpinfo.php,那么apache就是还无法解析php文件,那么请仔细检查以上的操作是否正确.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://finalbug.org/2007/11/%e5%ad%a6%e4%b9%a0freebsd-%ef%bc%8d-%e5%88%9d%e6%ac%a1%e6%8e%a2%e7%b4%a2-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

