> 看過你的文章“使用反向代理技朮保護Web服務器”使我很受啟發,我也想建這樣一個網站,但苦于我是一個剛剛入門Linux的人,很想得到你的具體幫助。例如:我現在已經在服務器上安裝使用了squid,ipfw正在學習使用,但我不知道什么是natd?希望能得到你的幫助,謝謝!

nat是network address tranlation,網絡地址翻譯
用于轉換網絡地址和端口地址,這樣就可以將一個外部ip
轉換為不同的內部ip(服務器實際使用的ip),達到
保護內部服務器的目的。
natd是nat的一種實現方式。


> 情況是這樣的:我建立一個局域網,(因特網的測試原形),WEB服務器,接入部分,
> 當然有一台DNS服務器,在測試時,我使用撥號的形式撥到我的訪問服務器,連接正常,然后我在客戶WIN98啟動IE,輸入WEB的主域名,它找不到,如果在DNS配置中加入IP地址,可以.
>     我想現在上因特網撥號后,根本不需事先輸入DNS的IP地址的,即可瀏覽,請問這是采用什么技朮,如何實現的.
當前常用的ppp協議使用Microsoft對原始ppp的一種擴展,來將dns等設置返回給ppp的客戶端。
如果你使用ppp作為撥號服務器,可以使用accpet dns和set dns
來打開這個功能。做客戶端時為enable dns。

>     我們前台是兩台WEB服務器,用WIN2000和II5.0,后台數據庫服務器用LINUX + ORACLE,
> 后台MAIL服務器用LINUX +SENDMAIL.
>     我現在的問題是如何在WEB服務器創建MAIL用戶????
通常是使用一個cgi程序來添加用戶。一般情況下,大容量Email系統的用戶不是系統
用戶,而是虛擬用戶,保存在某種數據庫中,因此根據自己選擇的用戶數據庫使用
相應的方式添加記錄即可。


> 以后將WEB服務器也改為FREEBSD + APCHE.  ,但不知道 ,能否在FREEBSD上安裝 ORACLE????

FreeBSD上可以安裝oracle for
linux.當然需要使用linux兼容模式和安裝linux的函數庫。


>     你好,我現在的系統是windows2000 server.有三個分區,全都是NTFS格式,但我現在要安裝FreeBSD 3.1,可又不想對現有的數據有損傷,能否直接將FreeBSD直接裝在硬盤的基本分區上?
如果不想破壞數據,一般的做法是使用partition magic之類的分區工具將磁盤分區
移動和改變大小,以至于空出一塊磁盤空間,可以作為一個獨立分區,來安裝新操作系統。
不同無論如何,我建議你先進行數據備份。

>     如果不行,請講解一下如何重新安裝系統,以使 FreeBSD 和 Windows 2000 共存并雙引導。
有了空白的基本分區,就可以安裝freebsd了,然后可以使用freebsd的boot
manager或者使用NT(2000)的os loader來做多種操作系統的引導。


> I have question about php+ mysql + apache
> I install the above by /stand/sysinstall
> But it still got the error messages as follows
> 
> Fatal error: Call to unsupported or undefined function mysql_connect() in 
> /home/ann/public_html/index1.php3 on line 13

your php don't support mysql, in your configure command line,
i can not found the option for to support mysql.
let me tell you a simple way to install mysql, apache and php.
1, install mysql in ports collection( or packages collection)
such as, to install mysql, you need: ( if you have connected
with internent)
#cd /usr/port/databse/mysql-server.../
#make
#make install
that is all, very simple. if you don't connected the internet,
maybe you need download the mysql's source and put it in
/usr/ports/distfiles/
please read the relate chapter of FreeBSD handbook or
my book.
2, install apache in ports collection,
3, install mod_php in ports collection, the ports collection will
popup a menu, let you choice the configure option, you can select
the mysql support.
4. move php.ini-dist to php.ini
then, all is ok.
if you don't similar with mysql, apache and php, 
i bet it is the eastest way.



> But my hardisk is almost full
> Do you have any suggestion for me?
> I am trouble now..

It is really a problem, generally you can install
another disk, and mount it in some directory, and then
move some sub-directory to the new directory, and then
make the symlinks make it correctly.


>        使用Tcpdump前,如何配制網卡?
>        我運行Tcpdump后,有以下信息:tcpdump: /dev/bpf0: Device not configured .應如何處理?

tcpdump need bpfilter support in your kernel,
recomplie your freebsd's kernel with option "pseudo-device   bpfilter 4  "
in your kernel's config file.
then MAKEDEV bpf0 in /dev/ directory,
after you have done that, tcpdump can be run.


> 小弟是個非專業的PC FAN。畢業之后也找到了個工作。可是就是
> 喜歡電腦,而且沒有天理地想干這一行。我打算在UNIX上多用點心,
> 希望得到您地指導和鼓勵!我主要想了解以后找工作需要我需要
> 具備哪個方面的UNIX專業知識,我估計一個操作系統應該是比較復雜和
> 龐大的。

你說的對,一個操作系統是很復雜和龐大的,但是并不是每個人都需要
知道一個操作系統的全部知識,因此掌握一部分自己趕興趣的,可以用來
謀生的技能還不算難。
一般來講,Unix的工作范圍比起Windows來講,要窄一些,這是因為Unix
的用戶較少的原因,雖然這種情況隨著時間的推移,會逐步改善,但從
本質上來看,這種情況會一直延續下去,所以如果打算學習Unix,那么
可能回報不如學習Windows快,要求要高,因此需要三思。
如果你打算學習Unix了,通常來講,有兩個方向,一個為系統管理的方向,
你應該熟悉Unix上的各種命令和軟件配置,未來隨著Unix的使用范圍越來越廣,
對系統管理員的需要也會越來越多的。另一個方向為程序設計員,這個方面
很多都是比較窄的專用應用范圍,比如一些專用數據庫的開發了等等,但是
當前來看有一個方向應用范圍還是比較大的,就是Web應用程序開發,隨著
Web服務器從Windows轉向Unix,基于Unix的Web開發需求會逐漸增加,例如
對PHP程序員的需求,java程序員的需求等等。我想,這兩個方面不是截然
分開的,可能在你學習Unix的過程中,會逐漸轉到某一方向。
其他我沒有什么多說的,只要學習,總會有所收獲的。


>     你好,我在安裝完FreeBSD 3.1 release后,我運行 /stand/sysintall 進行網絡配置的時候,在網絡設備里表中只有一個并行設備和四個并行設備,但沒有我得網卡,我的網卡是 D-Link DFE-530TX 10M/100M, 支持PnP, 在windows2000下使用正常,但在BSD下就是沒有 x10 界面。
>     上述問題如何解決?
查看安裝光盤上的HARDWARE.txt,看看是否支持你的網卡,注意,
HARDWARE.txt不會列出一些兼容網卡,如果你的網卡與某種
網卡兼容,試試該種網卡的驅動。



>     freebsd,這一段時間老是運行不正常,每天會出現網絡不通多到2-4次,以前運行沒有什么問題。查看日志文件,上邊提示錯誤:
>     fxp0:device timeout
>     kernel里邊好象fxp0是網卡。出現問題的時候。在控制台上邊,機器運行正常,但是ping外部地址不通。提示說沒有緩沖區。然后造成系統不能訪問,等重新啟動了機器以后,等2-3個小時還會出現ns1 /kernel:fxp0:device time這樣的錯誤。等出現几次以后就會出現系統網絡不通的現象。這有沒有可能是拒絕服務攻擊?
>     每次死機的時候老是出現這樣的錯誤,機器重新啟動以后過一段時間就出現
> Jul 12 03:05:27 ns1 /kernel: fxp0: device timeout
>    這樣的錯誤,當出到一定多的時候就死掉了。但是在控制台上邊,別的什么都能用,就是ping外部地址的時候出錯,并不是內存和交換空間不夠,好象是網卡配置有問題。

關于你的問題,首先應該判斷是否是硬件問題, 
timeout錯誤為硬件不響應錯誤,
fxp0為Intel EEpro 100M網卡,
是不是這個網卡的問題呢?
我建議你首先使用另一個網卡,最好是不同類型的,如3Com的卡,
試一下。
另外,如果你的服務器網絡負載很重,也有可能出現類似的問題,
此時需要檢查你的mbuf的大小,通常可以使用netstat -m命令
來查看。你的內核是否重新定制過?如果定制過,maxuser和
NMBCLUSTERS的值分別設為多少。


>     你好,我看了你寫的FREEBSD使用大全后,用PICOBSD架設了路由器,但是,我一直不明白如何設置NATD,以實現外網地址到內網地址的映射,你能給我更多的解釋嗎?謝謝!
> 設置如下:
> #natd -alias_address 202.99.144.140 -redirect_address 10.13.10.8 202.99.144.158
> 為什么我ping  不通 202.99.144.158

這個問題在于,外邊的計算機不會將發向202.99.144.158的ip
packet發到你的freebsd上,除非你的freebsd代表的子網內
包括158這個地址,事實上我懷疑你的freebsd只擁有一個合法
的外網地址,即140。
那么如何讓外網上的所有計算機都將發向158的ip packet發到
這個freebsd呢,一種解決方法是,讓freebsd聲稱158也是它
自身,這就是說,為freebsd的外網網卡設置兩個ip地址,一個
為140,一個為158,這個可以通過設置ip alias來實現。
然后,我想你的實驗就能成功了。


> 1.我的modem為'內痔',聽朋友說軟貓几乎都不能上網,這是不是真的
內置modem不一定是軟貓,但一般的軟貓的確只有windows支持。
請確認你的modem是否是軟貓

> 
> 2.編譯內核以配置sio2,sio3,我將KERNEL文件中,關于sio2和sio3地方的"disable" 去掉,然后編譯好內核,啟動后用dmesg查,發現sio2與sio3處分別有"configured irq 5 not in bitmap of probed irqs" 和"configured irq 9 in bitmap os probed irqs " 錯誤,其余一切正常,請問如何正確配置端口 sio2,sio3.
這說明你的設置文件中irq5和irq9有多個設置,因此存在沖突,
要避免這種沖突錯誤,可以使用conflict的關鍵字指出,當然
這要保証這些使用同樣irq的硬件允許共享irq(允許沖突)

 
> 3. 我的網卡isa型,NE2000,IRQ=3 I/O地址=300,因sio1 要求的IRQ也為3,因此sio1挂不上,因此先用網卡隨盤附帶工具修改為中斷5,I/O地址=300,在啟動時,用'boot -c' 進入userconfig界面更改網卡設置ed0 為5,I/O地址=300,繼續啟動可找到sio1,進入系統后,編譯內核希望能保存剛才設置,但編譯好后,安裝新內核重啟,但網卡仍然在中斷3上,似乎沒有更改過來,為何.
userconfig只是臨時更改設置,如果要重新編譯內核,需要在內核配置文件中相應的ed0行中將irq3
改為5,再重新編譯內核就行了。
注意,要確認網卡的irq設置已經改為irq5。



> Here I have some question , about freebsd SMP.
> But I dont know whether I should fill in options
> options NAPIC=??
> options NINTR=??

FreeBSD support the SMP with the Intel structure,
which support 2,4 cpu or more. in most states, just set
up SMP and APIC_IO, it's ok. if you set NAPIC or other
with wrong value, maybe the kernel cannot run correctly.
yes, kenerl can detect the options, unless your
hardware with non-standard config ( i can not give a example
what non-standard config is , since i haven't meet one)



> 我在安裝過程中卻遇到了困難。隨書光盤為FreeBSD 3.2-release版。
> 當我進行到 'FreeBSD Disklabel Editor' 處時,按‘W’確認,出現以下警告:
> ================================================================================
>                                  Message
> Warning!unable to swap to/dev/wdos3b:Device not configured.This may cause the installation to fail at some point if you don't have a lot of memory!
>                                    OK
> ================================================================================
> 我選OK后,又出現:
> ================================================================================
>                                  Message
> Unable to make new root filesystem on/dev/rwdos3a!
> Command returned status!
>                                    OK
> ================================================================================
> 對了,不管我使用自動(A)或手動(C)設定交換空間都不行。只好直接按‘Q’跳到下一步。

I guess it's due to your disk is too large, it's 18G or 36G?
if so , please resolve it to split a small partition at first,
after installation, then fdisk other space.
so, in fdisk of sysinstall, don't use the "A", use the entire disk,
use the "C" ( maybe, but i cannot remmeber too clear), create the
partition for BSD, about 2GB etc, then it's OK.
After FreeBSD 4.0, no the problem.


> 很高興收到您的回信,您在信中說我的硬盤是不是太大,我想干脆將我的配置全都寫清楚比較好:


因為系統沒有安裝上,所以你是無法進入FreeBSD中的。
首先要確定系統檢測到的內存數量,在進行系統安裝的時候
使用Emerage Shell在Alt-F4上打開一個控制台,使用
dmesg看看檢測到的內存數量。
另外一個問題可能發生在你的
reeBSD分區位于8GB之外,有些BIOS對于8GB之外
的硬盤空間處理不能被Unix識別,因此會造成安裝問題。
別著急,每個人在第一次安裝系統的時候都會遇到
問題,細心些,就會解決這些問題。
注意,千萬不要在系統安裝時破壞了原有的系統。


> there's some argument need to be build in the busy website
>   maxusers  256   <-----這里似乎可以設置的大一些
>   options VM_KMEM_SIZE_MAX=0x20000000UL
>   options NMBCLUSTERS=8192  <----這個設置決定網絡界面接受數據的緩沖大小
>                                  增加這個能夠使系統同時響應更多的并發請求
>                                  對于web server很重要
> 
> If you don't set VM_KMEM_SIZE_MAX, I believe the default is 80MB,
> which is not much for a machine with >1GB of DRAM.  However, this
> would probably cause a panic rather than the behaviour you're
> seeing.



> I have upgraded my Xserver to 3.3.5 version. It can support Riva TNT2, so I can use KDE with my TNT2 VANTA video card. Recently, I want to add my SB16 sound card and internal modem card. It seems that I should reconfigure and make the kernel. Unfortunately, I can not install the source codes from the CD provided with your book. Does that mean the CD is corrupted? Where can I download the kernel source quickly? 
> 
if you haven't kernel source code, because you haven't install it.
yes, you can install it from the CD after you install FreeBSD.
please look the src/ directory in CD, you will find the install.sh,
use the correct parameter to run it in FreeBSD, you can install the
source. but you must be careful if you don't want to install the all
source,please see the shell script, it isn't complex, you can know
the correct parameter.


> freebsd, linux and nt

你好,你提的問題確實是很多人都在討論和思考的問題,染﹔而也不是
一句話能說清的問題,事實上我常常避開這些問題,因為各個系統
都有其長處,只有在一定條件下才能說好壞的問題。
我也沒有什么新觀點,在這里列出一些網址,希望對你有幫助:
1:unix vs nt, 從名字可以看出它的內容,尤其第一篇
文章,更是非常詳細的描述了unix和nt的優缺點
http://www.unix-vs-nt.org/articles.html
2:一個簡單的比較表格
http://www.cdrom.com/~rab/bsd_chart.html
3:FreeBSD與Linux的比較
http://www.futuresouth.com/~fullermd/freebsd/bsdvlin.html




>   我是一個網民,見到目前的大型網站或一些門戶網站都提供免費郵件服務。
>   如果我想深入了解這方面的內容,請問到哪能找到更多資料?

基本上,這個Web Mail系統現在已經很濫了。
這里有一個地方,對大部分Web Mail系統(Free的)
進行了統計,你能找到你所需要的內容。
http://www.cru.fr/http-mail/



>       我在重新編譯內核的時候,在make depend的時候顯示"don't know how to make depend,
> stop",不知道是怎么回事?可不可以解答。
目錄對嗎?make程序對嗎?
這個明顯是生成的Makefile不正確。也有可能是你手工
安裝了gnu make,它替換了缺省的BSD make.
編譯內核一定要用系統缺省的make程序。
如果你能確認你的config kernel和目錄都正確,
那么檢查是否你的kernel版本和你和系統版本一致,
即,你是否使用cvsup或其他方式升級過kernel代碼。



>    不好意思打擾你了,我是你的著作《FreeBSD使用大全》的讀者,我有一個問題想請你,就是在第二章快結束的時候,你在里面說的“利用NT的OS Loader引導FreeBSD,須知道FreeBSD基本分區的第一個扇區”,我不知道如何獲得“FreeBSD基本分區的第一個扇區”。
后面有使用unix的dd命令將第一個扇區寫入文件的例子。

>     還有一個問題是關于怎么“將激活分區設置為FreeBSD分區啟動FreeBSD系統”。
可以使用多種分區管理工具來完成,如FreeBSD的sysinstall,DOS下的fdisk等。

> 我在inetd.conf中設置了“finger stream tcp nowait/3/10 nobody /usr/local/libexec/tcpd fingerd -s” 
> 并且在/etc/syslog.conf中添加"auth.* /var/log/auth.log",并touch /var/log/auth.log,KILL了SYSLOGD,和INETD,甚至重新啟動,為何我finger root@192.168.0.3后沒有在 
> /var/log/auth.log記錄下來?? 

我查了一下finger的man page,
沒有發現finger進行了syslog的說明。
可能finger是不進行syslog的。


>     在新浪網上我們發現您的《FreeBSD使用大全》,覺得非常好。
> 因此冒昧問一下能否把它放在我們的網站www.bluepoint.com.cn上,
> 為一些初學FreeBSD的人提供一些方便。謝謝!
可以放到網上,但不要放到紙、CD等傳統介質中。




> ~{NRTZ4S9bG}02W0~}freebsd~{J1~},~{W\JGOTJ>~}NO CDROM FOUND!
> ~{4mNs~},~{4SDz5DJiIO5CV*9bG}R*=STZ5Z6~8v?XVFFw5DVwIh18IO~},~{6xNR5D=STZ5Z6~8v?XVFFw~}
> ~{5D4SIh18IO~},~{GkNJTuQy8DU}~}?(~{NR5D9bG}JG~}IDE~{=S?Z5D9bG}~},~{GR~}BIOS~{V'3VV1=S4S9bG}Ft6/~})

如果你第二個控制器上沒有主設備當然會有問題。
改正的方法很簡單,就是將IDE光區及硬盤的跳線
改一改,一個跳為主另一個跳為輔,就行了。

> 在<>一書中,您提到在3.1版本后可以設定啟動標志圖像("如同windows 9X的啟動標志,請問在freebsd&linux下如何設置,請賜教,多謝
這些在我的書中都有講到。
請檢查內核配置splash的有關內容。
你能使用:
man splash
來查看其手冊。


>     FREEBSD/LINUX等是用什么語言編寫的?
C和一點匯編。

>     我想在LINUX下編寫系統軟件、網絡編程等,是C好還是C++好?
看你采取什么樣的編程模型,如果你經過分析使用面向對象的
方法,那么就用C++,否則用C
>     可以告訴我他們的主要區別嗎?
這個應該是編程課中(通常是C++課中所講的,非三言兩語講的清的。
> 
> 
>     期待你的建議!
建議:先精通C,再學習C++。


> 抱歉打擾,有問題請教:ORACLE-8 FOR LINUX是否應該公布源代碼?如果我自己公司基于LINUX開發的軟件能否綁定LINUX出售?
應該是應該,但oracle的代碼當然是由oracle公司決定,別人沒辦法干涉的。
如果你的軟件涉及到Linux本身,那么根據GPL,你應該公開源代碼。
如果你的軟件不涉及linux本身,只是使用Linux做平台,當然你可以
送Linux,而不公開代碼。

> 我的局域網是用WIN2000做主域服務器,在我把FREEBSD配置了NAMED后,98機器就登陸不了局域網了,錯誤提示是“密碼不正確或被域服務器拒絕”,我查了日志,認為是FREEBSD把域服務器的位置搶過來了。現在我想停止FREEBSD的NAMED服務,更改了rc.conf和把整個/etc/named目錄改名為/etc/named/named.bak,重新啟動后,還是不行。請問為何?如何解決?
搶主域權利的軟件可能是samba,請設置你的samba,讓其等級低一些。
named應該沒有影響,除非你的win2000的名字在域名中登記沖突,那樣
你最好設置WINS做NetBIOS的名字解析。
然而最簡單的方法是保持你名字的一致性,這樣就不必使用WINS了。


>     現在我對GROUP中定義的各個組的功能、意義不是很清楚,請您指教可以嗎?
這些組在系統用于不同的目的,系統中的一些程序使用這些組的權利進行特定的操作。

> wheel
root組,用于系統管理員。

> daemon
用于系統守護進程

> kmem
用于需要訪問內核空間的程序

> sys
一些系統程序屬于該組

> tty
終端操作

> operator
可以進行控制台的一些特殊操作

> mail
郵件處理

> bin
擁有大部分文件和程序

> news
用于news系統

> man
使用手冊

> staff
缺省的一般用戶

....
如果要具體指出這些組的功能和權限,是一個冗長的過程,這些
可以在你使用系統的工程中逐步了解。


> 我想買你那本關于 FreeBSD的書,但是在市場上沒找到.
> 請問從哪兒能郵購得到或者是拿到 電子版 的?
請和機械工業出版社的讀者服務部聯系,
電子版可以從網上直接下載,http://freebsd.online.ha.cn
有很多地方都有,如新浪網
你可以選擇一個近的,例如在教育網,可以到
水木清化bbs的freebsd板精華區。



>   不好意思,又來麻煩你了。這兩天我正在調試FreeBSD,可是用那個bind老是
> 不對勁。我想用一個ip實現對應多個域名,然后在apache中用
> 虛擬域名的方式實現虛擬主機的功能。
>   我的ip設為192.168.0.1,第一個域設為
> wzy25.com(兩個域名,一個dns.wzy25.com,對應192.168.0.1,
> 另一個www.wzy25.com用cname指向dns.wzy25.com)
> 第二個域設為wzy25.net(兩個域名,一個dns.wzy25.net,對應192.168.0.1,
> 另一個www.wzy25.net用cname指向dns.wzy25.net),可是只有wzy25.com工作,
> wzy25.net怎么也不工作。后來我用cname讓dns.wzy25.net指向dns.wzy25.com
wzy25.net沒有放到虛擬主機設置中吧?
使用虛擬主機,必須對每個虛擬主機分別進行設置才行!


> 我買了您的著作(FREE BSD 大全)和配套光盤
> 安裝配套光盤的時候,過程完全正常,REBOOT后,提示:
> F1-DOS
> F3-FREEBSD/386
> 可是我按F3除了喇叭響一聲沒有其他反映,F1可以進入原來的Windows
> 我的硬件環境是:
> P3/500,128MB RAM,20G硬盤
> 硬盤在BIOS中的參數是LBA(cly:1024,hd:255,hd63)
> 分區:主分區6G,擴展分區6G,FREEBSD安裝在擴展分區之后,尺寸2G.(其余的空間unuse)
明顯的,這是由于部分BIOS的8G限制,(來源于BIOS的1024限制)
FreeBSD的Boot Manager是使用BIOS來引導FreeBSD分區上的啟動部分的。
一般情況下,請把FreeBSD安裝在8G之前,例如你可以使用Partition Magic來
移動一下你的分區位置了,比如把擴展分區向后移動,而將FreeBSD分區移到前面。
此外,還可以試試使用其他的Boot Manager來啟動系統,例如最新版本的LiLo,
或者清化BBS上某人寫的一個Boot 軟件,但這些東西我沒有試過,
如果你有興趣可以試試,正常情況下我還是建議你調整分區的位置。



> 我想要丁磊寫的那篇文章
> 來說服我的客戶和老板使用FBSD,在www.163.com
> 沒有找到,請幫忙!
here is:

PC不只是很便宜的工作站
--PC能為你做些什么? 


作者:William Ding(Netease CEO)
在很多人的心中,PC只是用于文字處理或者玩游戲的工具。但是PC能 
做的絕對不只是這些。在合適的硬件,操作系統配置下,PC所能表現的,甚至超越數十萬,數百萬的高級專業服務器。
如果你能連上網絡,那么世界上最大的FTP服務器就是一台跑著
FreeBSD的PC,配備著Pentium 
Pro 200MHZ,512G的硬盤,1G的內存, 同時可以讓3500人download的PC服務器。 
很多上網的人都知道著名的Yahoo和hotmail這兩個站點,但是你知道 
這些站點的背后是用什么服務器構成的嗎?答案令人吃驚,yahoo和 
hotmail都是在使用FreeBSD的操作系統來構成他們的服務。當然yahoo 
和hotmail這么大系統的背后一定不只是一台PC羅,目前hotmail服務 
2000萬的用戶,用了五百多台FreeBSD的服務器。 
現在有許多人在PC上運行免費的Unix-like的操作系統,或許有人已經在 
用Linux了,那究竟Linux,FreeBSD、以及其他的免費操作系統有什么不同呢?這個我們將放在下一篇中告訴你。 

從Linux到FreeBSD 
其實玩操作系統最先開始于大學畢業,當時我記得給我印象最深刻的是93
年剛出來的WIN 
NT3.1,它的多任務性讓我愛不釋手,我甚至認為NT就是未來的操作系統。但是1年后我的觀點發生了動搖,在一次偶然的機會里接觸了 
Sco Unix和Linux。Unix里面丰富的工具,穩定的性能和優秀的多任務性, 
似乎讓人真正認識什么是穩定的多任務的操作系統。 
就在我沉迷于slackware 2.0的時候,另一個免費操作系統FreeBSD正在以不可思議 
的速度四處蔓延,成為許多網站的服務器。那時候我記得yahoo的50台服務器都是 
用了FreeBSD。當然ftp.cdrom.com早已經用了。 
究竟為什么FreeBSD具有如此巨大的魅力呢?這個問題恐怕要等你親自用了FreeBSD
之后才會揭曉。 
FreeBSD的特色 
簡單的來說,FreeBSD是一個在PC上運行的免費Unix系統,FreeBSD讓你的PC變成一台先進的強大的。 

安裝容易 
FreeBSD相當容易安裝,彩色的選單式安裝畫面讓你輕松的安裝,當然你也可以通過 
FTP,NFS,CDROM來安裝了。 
完全免費 
FreeBSD不但是完全免費,而且還提供100%的完整操作系統源程序碼(source code) 
,讓你可以隨心所欲的控制已經修改你的系統,讓你避開為操作系統公司操作的命運。 
先進的多任務性 
目前網易的個人主頁服務器就是用了FreeBSD,你看看就明白了。 
優越的網絡性能 
FreeBSD非常適合擔任Internet的網絡服務器,提供完整的TCP/IP的網絡功能,包括 
SLIP,PPP,NFS,NIS以及其他的協議。
目前FreeBSD上可以穩定運行的網絡應用系統有: 
www,email,FTP,NFS,firewall,BBS,Routing,News,Proxy 
完整的32位操作系統 
FreeBSD可以根據你的CPU的特性,打造出一個合適的kernel .目前對于SMP的主機 
FreeBSD比單CPU可以提高40%的運行效率。 
系統安全性高 
FreeBSD不但擁有高度的系統安全性,還擁有特殊的登入控制和文件保護,可以保障你的系統和資料不被破壞。
此外,還有許多的高手專門研究各種安全性問題,一旦發現任何的漏洞便會立刻修復,使用者也可以利用source 
code可以更新,不需要等待新的版本。 
講了那么多,寫這片文字的目的就是想告訴你,在你計划花費數萬元去購買那些昂貴的 
服務器的時候,不防先嘗嘗這個不花費一毛錢的好東西。 
FreeBSD站點: 
http://www.freebsd.org
FreeBSD在國內應用的主要站點有: 
網易的個人主頁服務器 
163.net免費郵件系統(用了4台) 
網易的中文搜索引擎(2台) 
北京263.net的免費郵件系統 
國外的應用: 
www.hotmail.com 
www.yahoo.com 
還有其他的更多... 
FreeBSD國內下載點:
網易下載
名家談網目錄
從BBS到虛擬社區
PC不只是很便宜的工作站









> 我安裝了附盤的MySQL包和Apache+PHP3包。
> 但是,我試著做一個包含PHP3的頁面來連接數據庫。
> 結果是PHP提示:引用了未被支持的函數或非法函數mysql_connect()。
> 別的關于數據庫的函數也是同樣結果。但是其他函數可以正常通過
缺省的Apache+php中沒有對mysql的支持,
因此還需要額外配置。



> 您好,拜讀過您的大作《FreeBSD使用大全》后,對您做的
> 關于利用NATD
> 做的負載平衡很感興趣,由于我在網絡底層上編程
> 經驗的不足,很難看得懂NAT
> 的源碼,更不知道在哪加入負載平衡
> 的代碼了。
> 
>      所以,能不能您給我點提示,或者給我點
> sample的代碼看
> 看。
我的代碼可以在我的主頁上獲得。
http://freebsd.online.ha.cn


> 2。請問您寫的natd patch能否偵測到后端的web服務器的健康狀況,即有一台web server宕機,natd是否不再對它作地址轉換
it is my project,  i have put it in 1 year, maybe i continue the
project in these days.

> 3。如我打算用反向代理作防火牆及負載均衡,是否可行,難度如何,能否偵測到后端的web服務器的健康狀況及預設定負載均衡策略。
ok, but the dectetion of backend server status is the problem,
no free software do that.

> 4。如我打算支持大流量非靜態頁面的web服務,最好的gnu的解決方案是什么呢?
general, it is apache. 


>     我是《FreeBSD使用大全》的讀者,想請教一個關于打印機的問題,我把打印機連到計算機,并用root登陸后,根據啟動信息,系統已經檢測到打印機了,但用 lptest > /dev/lpt0 命令,系統沒有反應。你可以告訴我可能的原因嗎?先謝謝了!
請讓我猜一下,
你的打印機是不是HP LaserJet?
或者其他型號的Postscript打印機?
Postscript打印機只識別Postscript打印控制語言,
lptest輸出的東西對其來講,為非法語言。
這個在書中提到的。


>     今日購得你寫的書《FREEBSD使用大全》,并用隨書光盤在我的電腦(一台DEC 5/133 64M內存 3.2G硬盤)上安裝了一下,安裝過程很復雜,但還都走完了。在安裝完成后,機器啟動到一半時就停止了,停止在下列提示:
>      ie0  not found at 0x300
>      op0  bot found at 0x300
>     機器不能啟動至login登錄提示,不知為什么?能否回mail: sh_xl@email.xj.cninfo.net or jerrytom007@sina.com
應該是硬件不兼容的問題,
你可以在啟動時進入UserConfig界面,
(書中在啟動過程中提到,用boot -cv)
將你電腦中沒有的硬件屏蔽掉,特別是ie0和op0這
兩個驅動,應該就沒有問題了。


>        問題是:現在freebsd4.0 已經支持ipv6協議,如何設置Freebsd的通道功能,使得兩個支持ipv6功能的pc能夠在ipv4網絡上通信。

其實我算不上什么專家, 我想對于你的想法,理論上可以通過建立IP tunnel的方法
來實現,比如我書中提到的用ppp和ssh建立IP tunnel的
一種方法。但是如果要涉及IP v6,那么必須要求ppp也支持
IPV6,這個我還不是很確定。


>     我在用freebsd安裝一個代理服務器,
>     我是在一台pc機上安裝了兩個網卡,一個連接internet網,一個連接內部局域網, 用ping命令測試網絡已連通.
>     安裝freebsd時不選路由器,選apache,網關和squit,配置squit后總不通.我對客戶端代理配置很熟,不應該有錯誤.
>     你能告訴我更具體安裝,配置方法嗎?最好給我一個配置的具體例子.

既然你已經安裝了apache,為什么不使用apache提供的代理能力呢?
雖然apache的代理能力比起squid稍差一些,但滿足絕大多數情況。
to install apache with proxy:
1: make sure your apache support proxy,
if you install apache from packages collection of freebsd,
there is a proxy module.
if you install apache by yourself, make sure you use the
proxy module when compling.
2: config the apache to support proxy.
in httpd.conf, 
uncomment all with proxy, such as
Loadmodule .../libproxy.a ( or libproxy.so if you use share library)
Addmudule .../mod_proxy.c
ProxyRequests On
and , to setup the cache,
you can setup CacheRoot, CacheSize .... etc
and, to setup the access of proxy,
you must set 

  Order ...
  Deny ...
  Allow ...

and 
Deny form all

the apache proxy server will ok!
由于我不是squid方面的專家,不能提供squid的詳細資料
但我想只要仔細設置,應該也沒有問題的


> 問題是,現在這個系統已經出現問題,無法boot起來,是硬盤的問題。我們能否像NT那樣,先用一個NTFS Boot fl
> oppy把系統boot起來,然后再想辦法修復。

使用軟盤啟動FreeBSD是一種正常的修復方法,
在安裝光盤中的/floopy目錄下有一個軟盤鏡像fixit.flp
必須首先啟動安裝系統,再使用安裝系統中的
啟動緊急shell的選項,插入fixit軟盤,就能啟動緊急
修復系統。
或者你可以將這個硬盤直接安裝到另一個BSD計算機上,
直接mount硬盤。
啟動系統之后,如果要修改口令,可以將一個能進入系統
的BSD上的/etc/passwd, /etc/master.passwd ,/etc/pwd.db,
/etc/spwd.db全部替換到老系統中去
當然以上方法,都僅適用于正常情況下


>      我安裝FreeBSD 3.4在IBM netfinity 3500機器上,從光盤上引導后,系統提示:
> 
>     can't load kernel
>     no load kernel

或許是你的光盤映射到軟盤有點問題,或者是光盤出問題了。
用軟盤引導試試


> ~{Mu2(~},~{Dz:C~}!~{WT<:U{@mR;LW~}freebsd~{
你好,你的問題比較難于回答,因為到底要把這些東西作成什么樣子是非常關鍵的。
如果只是打算重新完成一個安裝程序,包括安裝上中文化界面,或許几個人
能達到目的,如果有其他要求,或許就不那么簡單了


> 向高手請教以下問題:我在安裝FREEBSD 3.1的時候,通過USERCONFIG把我的
> NE2000網卡的參數設到io=0x300,irq=3(我在WIN和LINUX里都可以用這組參數正
> 常工作),在按Q鍵保存配置完成安裝系統重啟時,內核啟動仍然在io=0x280上檢
> 查ED0(NE2000的設備名)設備,而導致當機。為什么我的配置不能保存下來呢?
是這樣的,雖然你在安裝時使用了UserConfig來進行設置,
但在第一次啟動的時候,仍然需要使用UserConfig來設置一次,
此后就不需要設置了。
這是因為,UserConfig將設置保存在文件系統中,但是安裝程序的文件系統
為內存文件系統,而磁盤此時還沒有分區等等。因此還需要再重新設置
一次,才能保存好設置。

> 對我想起來了,在用光盤啟動時其實是虛擬了一個2.88M的軟盤而已,想來正好
> 和你說的安裝程序文件系統為內存文件系統的說法相合的。那這樣的話我怎么再
> 次使用USERCONFIG來設置呢?因為現在用硬盤來啟動是不會成功的,是不是用三
> 次軟盤中的哪一張啟動后來做呢?還請在這點上教教我。
在啟動過程中,有一個9秒的倒計時,此時可以按空格,進入boot loader的界面,
然后使用boot -cv進入UserConfig
這些在我的書中有介紹。

> 另外還想問一下,FREEBSD對中文的支持如何?我的意思是不一定要提供漢化或
> 者中文平台什么的,只是內核或者文件系統要支持,比如WIN工作站可以通過
> SAMBA建立自己的中文目錄或以中文為文件名。
沒問題,只不過缺省的ls不支持中文,需要安裝gnuls


>     能否給我一個FreeBSD安裝程序,我想學一學!
FreeBSD系統大概有一張光盤大小,如果你有高速專線連接可以從網上下載
否則還是買光盤划算。
正式的FreeBSD光盤國內是沒有出版的,當然你可以讓網友代刻寫,


> 1、SCSI磁帶機的設備名叫什么?
/dev/rsa0  , nrsa0 ( no auto rewind ).... etc
> 2、如果要給大樓用戶(300用戶,最多同時上網人數為120人,一般為30-40人)
>    建立一個www代理,用FreeBSD+squid ,256K專線
>    請問硬件的配置(推荐)和squid.conf 里一些對性能影響教大的參數設置
I just know little about squid, so don't provide the
detail config about it.
for hardware, i recommand: 512MB 18GB and 1 CPU is enough
in the squid, the memory is related with the disk space
you use for cache, there is a way to caculate it in its document.
so if you use the small disk space for cache, you can use
the small memory to get the good performace. anyway,
i don't think the disk cache is less than 1 GB.
> 
> 3、FreeBSD 的一些缺省deamon在哪設置?如cron、syslogd等。
as same as other Unix. 
please read the man pages, you can get it.
> 
> 4、用ipnat -l列當前的用戶連接,發現很多連接一直沒斷開,而用戶其實早已關閉程序,為什么?
there is a timeout for any TCP connection. don't change it(by
sysctl) unless necesery.
> 
> 5、FreeBSD下怎么樣才能讓磁盤性能達到最優?
for single disk, use the softupdate in kernel,
for multi disk, use the vinum and set RAID-0,5,
ofcourse you can buy a RAID card which supported by FreeBSD.
> 
> 6、FreeBSD下怎么樣才能讓網絡性能達到最優?
it depend your server's load, if your server don't crash,
don't change anything, it is the very perfect performace.
if server crash, you need increase some options value
in kernel config, it is NMBCLUSTERS


> 1. 您書中說若要多系統并存, 必須把整個擴展分區分給FREEBSD, 那我的硬盤就只能分兩個區嗎? 是否有其它選擇?
No, but you must keep one free space for BSD.
OK, let me explain it to you.
IN DOS/Windows, you can fdisk primary partition and extend parition,
and then it can fdisk the logical disk in extend partition.
So, in one disk, there is primary partition and extend partition,
and the C, D, E, F is the disk token for logical disk.
if you have only one disk, the C: is primary partition,
and D: E: F:... is the logical disk in extend partition,
D: E: F: is not a primary partition, they are the part of
extend partition or you can call them extend partition if you like.
so you can not install FreeBSD in extend partition,
you must install FreeBSD in a primary partition. So , 
you must find a free disk space to freebsd's primary partition.
So you need to do:
1, free the disk space out of extend partition, since your F:
isn't a free disk space, it is a free extend partition space.
you can delete the extend partition and re fdisk it by a small
size, so you will lost the data.
if you don't want to lost the data in D: E: F:... etc,
you can use the PartitionMagic or others tools.
2, install FreeBSD, in its Fdisk, you can create a primary
partition for FreeBSD in the free disk space.



> wangb> 在啟動過程中,有一個9秒的倒計時,此時可以按空格,進入boot loader的界面,
> wangb> 然后使用boot -cv進入UserConfig
> -cv還不那么順當(可能和我裝了最小系統有關吧),不過在boot:提示下輸入
> /kernel -c可以再次進入配置界面,設定好了可以登錄進入系統,在/下產生一名為
> kernel.config的文件,用cat觀察其中有ed0的相應配置,如po 0x300 ir 3等,
> 不過重新啟動后又用io=0x280來測了,并且還是老樣子當機,為什么我的配置就
> 是沒法啟用呢?那個kernel.config是作什么用的?會不會我的那張光盤有問題
> 的,我估計這個可能性不大吧,因為每次啟動進入配置后還是可以登錄的,真是
> 怪了,希望你再次開示。
to see the /boot directory , to see the loader.rc and its' include
file , if there is a line as:
 load -t userconfig_script /boot/kernel.conf          
it is the auto load the kernel.conf 's command
> wangb> 沒問題,只不過缺省的ls不支持中文,需要安裝gnuls
> 一般的源盤里帶嗎?還是要上什么地方去當的?
should, it is in package collections


 
> There is one more thing which I am no sure: You told me to resize my
> extended partition so as to make free disk space for FreeBSD. Can I
> just delete F: (one of the original logical partition of my HD) so as
> to make free disk space for FreeBSD?
it's the key. even you delete F:, there isn't the free disk space, just
the free extend partition space, since the F: is a part of extend
partition. 
so you must delete F:, the resize the extend partition, so the disk space
is freeed!



> According to your advice to install FreeBSD in a free space of the HD, I have finished the installation smoothly, but I can't login! Every time I input my ID and password, I was informed that "login incorret", I am sure the ID and password are right.( When I typed the password, the curser didn't move at all.Is it normal) Can this problem be due to incorrect setup of the "add user" step? Can I reset my ID and password without reinstalling the system? How. 
> You can imagine how greatful I am for your guide, without your help I can do nothing with respect to this OS, a tough one for freshmen.

OK, if you install the OS correctly, it shouldn't happen it.
did you add a new user? 
did you change the root's passwd in installition?
change the root's passwd is not related with the adding new user.
if you really forget the root's passwd, the normal way is : enter
the single user mode, and change it. yes, key in "boot -s"
in boot loader's prompt.( enter it when system boot ),
you can enter the single user mode, then "mount -rw /" to 
remount the root file system, then "passwd root" to change
it.
another easier way: reinstall system, for a new system, it's
also a good choice.


> >   在SMB協議中,有多個不同的認証方式,包括簡單的共享級認証和用戶級認証。
> > Unix為多用戶操作系統,缺省就使用用戶級認証方式。當使用用戶級認証的時候
> > ,Samba服務器使用Unix操作系統的用戶和口令(來自/etc/passwd )對用戶進
> > 行認証,這是一種獨立的認証方式。而有時候希望所有的服務器使用同一個認証
> > 數據庫進行統一認証,因此就導致出現了基于域的統一認証模式。在一個域中,
> > 用戶只需要通過域控制器進行認証即可,域中其他SMB服務器就將認可域控制器
> > 的認証。
> >   在Windows NT 4及Windows 98之后,客戶和服務器之間進行認証時,口令不再以
> > 明文的方式在網絡中傳輸了。為了支持加密口令傳輸,需要設置encrypt
> > passwords選項。同樣,這也需要其他復雜的設置。
> 當我設好需要加密口令后,為什么就不能用/etc/passwd對系統用戶進入認証了
因為MS的認証方式與標准Unix不同。
> ?是不是用加密口令后需要在/etc/有一個smbpasswd的文件?如果沒有怎么生成
有一個smbpasswd文件,但它不一定在/etc目錄下,也可能在/usr/local/etc等
目錄下,這依賴于你如何安裝samba。
> ?我能不能用cat /etc/passwd | convert_smbpasswd > /etc/smbpasswd創建這
> 個smbpasswd文件,還是要用其它方法?請你指點。
不能,因為passwd文件中實際并沒有口令信息。當然也有方法實現創建這個
文件。但最好還是使用swat,以免出錯。


> After logging in the system, I encounter more problems, and have to turn to you for help again.
> 1. Can I install/uninstall software under KDE? How?
First, I must say the KDE is a great software, although it's not FreeBSD.
but They are ALL FREEware.
install/uninstall isn't the task of KDE, it's belong to OS.
but it's very regret there isn't a packages manager software
with X ( in another word, KDE ) interface in FreeBSD, you can
use the command pkg_add or pkg_delete, OR you can use the
/stand/sysinstall, which has a package manager function with
chartarter window.
> 2. How to defrag the HD space used by FreeBSD?
in any Unix , no need to defrag HD, because the Unix use i-node to
search file , not FAT, it means defrag is little meaning in Unix.
> 3. Is there any software like Office under windows, is it included in the compact disk attached to the tutorial book written by you?
some software , such as : Koffice ( a part of KDE project, but not
included in default KDE ), StarOffice ( the staroffice can run in FreeBSD
in its Linux Mode ), etc. but all of them isn't concerned in my book,
my book is attented to Server Application, not Desktop Application.
> 4. When I try to shut down by typing: shutdown -h now, my computer doesn't shutdown, but display: press any key to reboot. Is it normal?
It's normal, because the APM function isn't support in your set. 
if you want the OS close the power automatily, you must re-complie
the kernel with APM support. but, i must say, i haven't try it, and
maybe the function isn't well support in FreeBSD.
> 5. HOW CAN I USE MY CDROM AND FLOPPY DRIVE? I did what you said in the book, but I still fail to find my cdrom and floppy drive under KDE.
generlly, you should use "mount ... " command in a terminal window of
KDE. if you have done, you will find the content in file-manager of KDE.
> 6. More importantly, is there any books teaching how to use KDE or other related Xwindow? It seems impossible for me to have a general idea about the Xwindow system in a short time without any guidance.
I must say, Even KDE is very very good, it's just a GUI, if you want to
learn Unix, you must know more about Command. it's different in Windows,
you can do everything in Windows With GUI, but you can not do everything
in Unix with GUI. so how to use KDE is easy, the diffculty is how to use
Unix.
> 7. Why can't I launch the cd player, every time I launce it, it appears for a second and disappears again.
anyway i can say it's the bug of KDE. i cannot help you in that.
because i use KDE little.


> wangb> 因為MS的認証方式與標准Unix不同。
> 對,我知道了,如果用了加密口令,就必須由SAMBA自己維護相應的用戶口令了
> 另外問一下code page參數你研究過沒有?我看了文檔還是不太懂它的意思,只
> 怪自己英文不好啊。
generlly , the code page is useless , unless your file system isn't
support 8 bit or the application use special code page.
if you use code page, maybe you will find the filename is different
by client and by server. it is: if you create a chinese file name
in Windows Client, you will find it is strange encode under Unix( by
use gnuls -N or X window's filemanager with chinese support).
> 
> 這些天因為手頭的破盤原因出了很多怪問題,想想要考慮去買你那本書了,我們
> 蘇州又沒有BSD的正式盤賣,不知道你那個盤的版本和收集的packages有哪些?
it's 3.2 with some packages i used.

> Now that with your detailed information, I surely understand more about UNIX.  You know, as a green hand in terms of computer, I dreads command line. Anyway, I have deep conception that to have more control of the machine, more command line knowledge is needed. I will make every effort to learn more. 
I think command line is not so bad, you can see command line is a
very easy program language, i think i should learn some laanguage,
such as BASIC, C , etc, now it's time to learn a little about sh,
just a little, you will know why Unix is a program's OS, enen the
command is designed to suit programed.
> 
> I tried to translate an article concerning FreeBSD 3.4 last night and came up with some words that I can't understand and hope to seek the answer from you: 
> what is MULTICS, is it the antecedent of UNIX? 
it was designed to a very complex OS but failed, but many guy learn what
a OS like, so one of the guy designed UNIX later.
> It cost me about two hours to get it done and post it on a BBS as requested, but I don't think I've done a good job, since my relevant knowledge regarding this OS is definitely limited. Initially I wanted to redirect it to you, but finally, I decided not to do so as the work I have done is really shabby. Maybe last time, when I come up with something decent, I will show you. 
no, i like to see the article. no one know all, and anyone can learn
something from others work. why not send me a copy? or tell me which BBS
it is.

 
> but,if not use the code page,i found it was strange encode filename
> under bsd yet.it looks like:34:9a:33:3d...
oh, it's due to 'ls', the BSD's ls can not know the 8bit.
please pkg_add gunls , and use "gnuls -N" to be alias of 'ls',
you can get chinese name under a chinese teminial.
> 
> wangb> it's 3.2 with some packages i used.
> nod.what about ur 'misc' directory on the disc is?
oh, it's something i collection beyond stand packages,
including chinese support packages, which is concerned
in my book.

> but i have not this packages on my disc which had modify by another.
you can download one from ftp.freebsd.org, it is very small.
> 
> are all ur experiences on freebsd included in your book?
> i hope u go on writing...
most of it.  it is diffcult to write another book with 
newer content, because most of them will not change .
so i wish someone else can write bookes with different
view.



> I've installed FreeBSD on my computer. And I want to use it as a BBS server. Can you tell me is there a BBS package, and what is it name ? Or where can I find a open-ware BBS software ?
Which BBS you want to get?
tranditional mode for telnet?
or popular mode for web-browser?
to first mode, i just advice you to enter the BBS in university,
generally there is a board named BBSbuilder or sysop, there are
many article for build a BBS using PowerBBS, Firebird BBS or others.
the famus BBS of university is bbs.net.edu.cn, bbs.mit.edu,
bbs.ustc.edu.cn, etc. 
to second mode, the good place is "www.cgi-resources.com", you can
find many Web based BBS there. but you need to make it localized
(translate them to chinese).


> But there seems no BBS software.
where?
cgi-resources?
in Web based, BBS 's another name is "forum", "message board", etc, such
as UBBS. in cgi-resources there are many BBS in C or in Perl,
if you search BBS in PHP, you can find it in www.php.net, such as
"phorum", etc.


> Can you tell me a ftp site(or the like) where I can download the BBS software to my machine.
> And can you tell me which package should I use to chinese-localization my FreeBSD system.
in my book, i introduce a little about chinese packages, which should be
in packages/chinese sub-directory or in misc/pkgs directory in the CD with
my book.


> 一台基于freebsd的pc服務器,雙cpupiii500,256m內存如果單純做web server,它的負載能力如何,如果試用您的服務器負載均衡軟件,四台的話性能能有多少提高,是不是性線的?
in your configure, i must say the memory is not enough. 
the server can serve ~500 concurrent connecttion  for
static html(no swapping),  can serve <20 concurrent connection for 
Perl CGI(maybe swapping), if you want to more, must 
increase the memory. 
if you want to use Load Balancing, I should use DNS at first.
my progrom is not a production, it haven't tested more.
 but if you know C well, you can use my progrom. 

> I have a problem when I tried to install fwtk after downloading the source code from fwtk.org. During the make process, a mistake occurrd. Following is the words presented on the screen:
about fwtk, obviously it is something configure wrong, it define the wrong
MACRO before include header file. i don't know detail because i haven't
meet it. but i think there is a better way to solve it! Yes, use Ports
Collection! Ports Collection is the experiences of which somebody  ported
software to FreeBSD, they make their experience to a Makefile.
please cd /usr/port/security/fwtk, then make, all process will do. if you
want to know why the problem happen, check the Makefile and subdiretory
"patches", you will find the reason.
BTW, my DNS has a little wrong someday before. now it's ok.


>Subject: Re: =?gb2312?B?x+vOyrnY09qhsMq1yrGy2df3z7XNs6GxoaKhsMe2yOvKvbLZ1/fPtQ==?=
 =?gb2312?B?zbOhsbXEvt/M5bqs0uU=?=
兩種概念有交叉但不相同,
嵌入式操作系統主要是指軟件能被固化,因而可以和專用芯片一起放入具體設備中。
這個設備不是通用計算機,但也不一定要求很高,因而嵌入操作系統并不一定是實時。。
實時操作系統指的是計算機要具體按芯片的時序操作,通用計算機使用分時
技朮實現多任務,那么一個任務在一個隨機的時間片中可能不能操作正確的時序。
因此實時操作系統有特殊的要求。
路由器軟件,其原則上不要求實時,但如果涉及了低層時序(例如要操作
芯片以便進行交換,switch),就有需要實時技朮了。



> 我不慎運行了"chmod -R a-rwx /",導致系統癱瘓。請問應如何解救?
first , try to boot -s to single user mode, the chance is few, but
i think you had better try it first.

ok, now you lost the possible boot from your orignal system, you
must boot from another system, remember the fixit floopy or CD?
yes, it is their work!
now boot from installation CD(or floopy), start the emergency shell
with fixit floopy(or CD), then switch to vty4( Alt-F4), you can mount
the hard disk and chmod back.
or you can do it from picoBSD, have you know it? it is a FreeBSD in one
floopy. yes, you can make a picoBSD with "chomod" in another FreeBSD
computer, then boot the picoBSD and mount disk and change the mode back.
ok, it is terrible , but not a disaster, you can restore it, good luck!


> 1.    I boot the system with fixit floopy,and mount the harddisk,but I found                 some files lost--the files in /usr, /home. Below are some related:
> 
>             My original harddisk partations of FreeBSD:
>                 wd0s1a        /
>                 wd0s1b        swap
>                 wd0s1e        /usr
>                 wd0s1f        /usr/local
>                 wd0s1g        /home
>                 wd0s1h        /home/bbs
>                 wd0s1d        /var
> 
>             The device listing after I booted the system with fixit floppy
just because the fixit floppy has not create the device.
you can
cd /dev
sh MAKEDEV wd0s1a
etc
then you can mount them.

> 2.    Now,most of the files in my FreeBSD have the mod "rwxrwxrwx",What can I do for it?
chmod -R 755 /mnt
or
chmod -R og-w /mnt


>        There is real-time operating system version of Linux----the RT-Linux.
>        I want to know if there is real-time version of FreeBSD. What is it?
there should be the production, but i think their name isn't FreeBSD,
since the BSD license is very free, so they can call them any name
if they like.


> 1.如何安裝Creative VIBRA128 PCI聲卡.
re complie the kernel with snd0 or pcm0 support ( only one of two);

> 2.如何安裝NVIDIA TNT2 Model 64顯卡.我用XF86Setup安裝失敗,XF86config安裝成功但進入KDE或GNONE只有文本沒有邊框和小按鈕等.
yes, you have support the card, but you haven't support KDE or gnome.
if you install KDE or gnome , please setup your .xinitrc or .xsession
to get KDE or gnome run ( please see my book for detail);




>     1."picoBSD" and "linux router project" are something alike,they are all                 focused on small and embedded,but not mentioned real-time;
yes.
>     2."Trinux" is something between "linux router project" and "Linux",it focused         on easy-configurable.
i don't know the project too more.
>     3."RT-linux" ,like it's name--real-time-linux,is a real-time operating                     system.But it not mentioned embedded ,so it is very large,not fit for used         in embedded system.
yes.
>     4."embedded" and "real time" are often mentioned together,but they are not         the same thing.
yes. most real time is embeded, a few not.
>         The later focused on "quick responsing to interupt" , "quick exchange of             threads context","memory sharing","mutually exclusive",and something the         like.
any require face  to reply the hardware signal as quickly as possible.
>         The former focused on small.
>         And if we need to develop a time-sensitive embedded system ,like Cisco         router,then we need all the two.
router is not so time-sensitive, unless you want to do tag-switching or
so. 


> 有關unix在中國的發展,不知你有何看法
有發展,但目前水平還不高,應該加大專用領域的開發,桌面的發展路還遠。
> 現在出了很多的中文版uxix,你覺得呢?
大部分是Linux(基本上是),其中很多是概念性的抄作,從技朮角度上,
Turbo和Bluepoint有一套,可能Redhat也要進來,而Redflag有政府背景,
其他的,如Xteam(現在的Lidows),是市場做的好。
但要進入桌面,還需要時間。
> solaris 8開始免費了,我們公司得了一套,這可是對其他unix的一個很大沖擊啊
是這樣的,但問題不是老大,因為定位不同。也許對服務器端有沖擊,
現在還不明顯。


>
the file system is basic require of Unix system, because the Unix is not
embend OS, now it can be emebed OS since hardware become cheaper. a little
system needn't file system, file system is abstract of storage system,
of course you can use other way, but isn't the Unix way. in Unix, access 
EPROM cann't pass the OS's system-call, it can be access by direct access.
you can write a device drive like a floopy drive or so , or you can direct
access it.
picoBSD is FreeBSD, it can run all FreeBSD's program if there are enough
lib. so you can develop picoBSD in FreeBSD. no emulating need.


> 
i don't know kernel too more. and any OS book will introduce the Unix's
multi-task's principle. 
in my thought, BSD is preemptive , but priority is not so strict, you can
set 20 level priority, but it is not the OS' execute priority, OS will
dynamic adjust the really priority , from the set and the scheduling
strategy.
wangbo




> Can you tell me some good sites about load balance? I have great interesting in the issue.
oh, the newest contents about it is in Linux Virtual Server Project 's
site, just search it . i have a article about it in 中國計算機報 , it
gives some short introduce.
if i have time , i will imporve my patch to natd, maybe rewrite a new
daemon, to approach the newest idea.




> In FreeBSD(or say in UNIX),every device is accessed through a device-file(listed in /dev).
> Does this meant that the device-management-component of FreeBSD is dependent on the filesystem-component,or to say if I want to access some devices(let to say a EPROM,or a console port)in may program,then I must have the filesystem compiled in the FreeBSD kernel?
yes, file system is the basic abastraction to hardware of Unix.
or you can change it, but it's not Unix more.


> i think that two cards should be have different config,so i correct
> them to jumpless by setup utils of cards.:-)
> now i want to only konw,if kernel support two same type cards,how to implement
> it? custom kernel like ed0 and ed1,then make it?
of course kernel support two card, but you must find which resource they
occupied. jumpless is useless, because jumpless is the way which the
bios of the card automately choice hardware recource, but it is the DOS
dirver's way, dos/windows driver can detect which resource it use, FreeBSD
don't care the way, you must manually set the hardware resource the card
occupied, or you must use pnp(ISA pnp is also dirty). so if you use
jumpless, it also diffcult to know which resource the hardware
occupied( of course you can use Windows or other tools to help you find
its resources).
i advice: for PCI card, use pnp, for ISA card, disable pnp and jumpless,
use manually method to set the hard resource, if no hardware resource 
confilct, anything will be ok.



> 1. after i added device ed1 line to my kernel config,the new kernel
> did not display any infomations about detect ed1 like ed0.i mean that
> if u specify standard device ed0,kernel will detect it's resource and
> display some information.
it means the ed1 's config is not match the card's hard resource.
so system can not detect it.
because ed0 use the usually config, so the kernel config is right,
it can detect it.
but ed1 must use different resource, if ed1 use same resource as ed0,
ed1 can not work correctly, if ed1 use different resource, you must 
config kernel to match it,
that's all.
> 2. my ne2000 card has three work mode:pnp,autodetect and jumpless.u
> see,i think only jumpless mode fit this problem.
ok, so you must read the manual of the card , to know when 1st card is
used , which resource the 2th will use. if you get, config your kernel.
if you can not get it from manual, you have to try. maybe you can 
use pnp's way of the card, enter kernel config and use pnpscan command
to detect whichi resource the card use. too complex, i don't recommend
you use the way.
another way is use windows9x in same computer, the native drive of the
card in windows 9x will get the benefit from itself jumpless or
autodetect mode, then remember the resource reported by its driver in
control panel, you can config your kenel as it. 



>   有個編譯程序的問題:v22pre11是個mudos,在linux上編譯正常,在FreeBSD上出現問題。
MudOS use gnu make file , bison and more gnu tools,
the tools has a little differ with standard tools in BSD.
so you must edit the Makefile to change the set ( maybe
it is the gnumakefile, Makefile.gnu or such , i remember
build.MudOS shell script will find the gnumakeifeil at first,
not standard Makefile ).
such as : gmake -> make, bison -> yacc ... etc
you can see the comment of Makefile to detail.


> 2。make clean 提示有目錄不能cd,但目錄存在并且無權限問題。
oh, maybe current directory is not same as the make resume.

> 3.make  不能生成cc.h,手工生成cc.h也出錯。但命令行gcc -c edit_source.c不出錯。
the problem should be relative with the first problem.

> 想問問,現在FREEBSD(3。4)支持什么樣的RAID卡,并且在用FREEBSD的系統中怎樣
> 做數據的容錯。原來的軟RAID(CCD)我實驗過,但不是很好。
3.4之后可以使用vinum,效果不錯,支持RAID5,由于在3.1, 3.2時RAID 5還沒有
支持,所以在我書中沒有介紹。如果以后修訂,我會加上的。
3.4支持的RAID卡并不是太多,但4.0支持了不少的RAID卡,一般情況下沒問題。
但要注意的是,RAID卡使用OEM的形式較多,例如所謂HP NetRAID事實上是AMI
MegaRAID,但是FreeBSD的文檔中只說了MegaRAID而不會去提NetRAID,因此必須
要搞清楚RAID的真正類型。




>   以前在3.2 release上安裝cxwin和中文字體可以顯示漢字,但
> chinput沒裝成功。現在在4.0 release上cxwin不能顯示漢字,是
> 因為安裝漢字字庫后系統也無漢字庫可用。
>   chinput不成功,我感覺問題也出在字庫上。
>   請您介紹一下字庫的問題,特別是alias的規則,還有chinput安裝
> 時要注意什么。
有些漢字系統固定去找一些字體,這些字體可能存在,但可能是不同的
名字,怎么辦呢?只能使用alias使系統將一種字體映射到另一種,
如果chinput能啟動,它會報告一個“???? font"沒找到的錯誤信息,
根據這個信息,用相近的字體可以設置別名。
即,設置font目錄下的font.alias文件,然后執行makefontdir命令
就行了。
這是X的一般做法,與BSD的版本無關。




>
不好意思,你使用MS的 utf-8編碼,我這里只能讀個大概。
1, informix應該沒有BSD的正式版本,Internet上有人使用FreeBSD的Linux支持能力
來運行informix for linux,使用FreeBSD的SCO支持能力來運行informix for
SCO應該
也可以,但沒有這方面的報告。但我想這要對系統進行調整,以便適合informix和
SCO支持能力的需要。
2 FreeBSD使用/stand/sysinstall進行系統安裝和安裝后的設置調整,
但如果你和網卡等設備,現有的內核并不支持,就需要重新編譯內核。




> I have visited you homepage. I have great insteresting in the load balance. Can you please introduce some good sites which discussing this issue to me. 
very pleasure to hear from you again, i have a little busy, but ok.
load balancing is a very high-end topic, basicly it concernt paiallel-
computing, but the Web's feature make it out of that. so we talk it is
load balancing in Web server (or other similiar protocol). i just can say
"Linux Virtual Server Project" is No. 1 in free software in the field.
my natd patch is just a try , now there are so many commercial product
about it, including many layer-4 switch or device, you can read the
document in LocalDirect (cisco), it explain something. but in concept,
the production is behide the Linux virutal server. someday if i have
time, i like to open the project"BSD virtual Server Project", but i
have a little busy and lazy, and poor to support a free project.


>     我是一個LINUX和FREEBSD的愛好者,最近看了你的那篇文章和HORDE上的一篇英文的SCALABLE WEMMAIL HOWTO后對LDAP產生了極大的興趣,但苦于國內還沒有志同道合的朋友一起來進行這方面的
> 研究和討論.我現在已經在一台服務器上將系統整合成功,但在如何進行分布式處理上遇到了難題,
> 主要是LDAP的多機并行的問題,即登陸一個CYRUS服務器可以用分布在其他機器上的LDAP用戶.等一些
I think you make a mistaken here. All of LDAP server has same database,
All of user in any LDAP server is same, they are leaves of the ONE LDAP
tree.
yes, any LDAP server will return same result for a user, but the user
will stay in one of CYRUS server. that's the key of the SCALABLE mail
system.


>    1.我想知道如何在OPENLDAP中設置讓它們連起來.即在其中任意一台機器上能找到每台機器上的用戶(Ldapserach -b "dc=free,dc=net" "objectclass=*").我設置后只能找到MAIL上的用戶
> (除非指定 -h host).
Please see : The SLAPD and SLURPD Administratro's Guide, Section11,Page51
there is a PDF version which can download from internet. 
it is a little complex, i can not explain it in some sentence. in one
word: You must use Slurpd to replica the master server to slave server.
>    2.我這樣的裝法對不對? 一台機器裝POSTFIX,并配置LDAP的支持.其他的機器都裝CYRUS+LDAP
> 用戶都登陸其中的一台,如MAIL.我理解的是否正確?
wrong, every host need postfix, but just one (maybe all) postfix do
vitural email addresss convert to real email address. other ( maybe all)
postfix deliver the mail to cyrus.
>    3.或者只有一台裝CYRUS,但用戶的目錄如何建立在每個機器上呢?LDAP中有相應的設置嗎?
no, the more users , the more cyrus servers are needed. every user has
a real email address in cyrus, but they just have a virtual email address
which stored in ldap database.

>    4.POSTFIX中的MAILBOX= /VAR/SPOOL/IMAP 這個路徑能使來信隨著LDAP的機器而到相應的機器上的這個目錄中嗎?
they are different with cryus. you can use cryus to store the mail , or
you can use /var/spool/imap to store the mail, but you just can select
one. 


> 好像裝linux是不能先烤到硬盤上的說,是否?
> 沒光驅,ftp又太慢怎么辦?
這個不一定,關鍵依賴與不同的發行版本,
很早以前我使用Slackware Linux是可以從硬盤
安裝的,最近的一些版本,由于沒有使用硬盤安裝
的需要,也沒有試過。


> 請問能否告知書中所寫到的反向代理模塊mod_rproxy在哪里可以找到?
The mod is a experimatal version, 
I must say , the rproxy function has been mergered to
mod_rewrite and mod_proxy now(maybe after 1.3.9 or later).
please see http://www.apache.org/docs/misc/rewriteguide.html
for detail.
and i have seen there is another load-balance module
in apache. but i forget , please search the key word
in apache or related site.


>     。如你有空,能不能向我介紹一下FREEBSD
>     在郵件服務方面的各種性能長處?當然,如果
關于FreeBSD的性能,我已經說的很多了,
不過還是很樂意向大家介紹。基本上,
FreeBSD的優勢在于:
1,網絡性能
2,高負載能力(特別是高負載下的I/O)
3,穩定性
FreeBSD在CPU處理能力方面和其他系統類似
因此,FreeBSD在Web服務器,Mail服務器方面是
特別適合的,尤其是在高負載的時候。

另,你們做做WebMail,是自己開發,還是購買,
我這兒倒有一套,要不要看看?不過我們
不是賣軟件的,不知道頭頭樂意不樂意賣。
大概沒有問題吧,有可能,我將將它改成
open source的東西,發布出去,我這么做,
就怕被其他做這種軟件的給罵死了。
你們要買的話,source code肯定是會有的,


> I know mysql is multi-process program from the manual. When I run the program on my double-cpu machine, I find there is only one mysql process in system. But other multi-process program like apache, there would be many process. Can you please tell me what the matter. If I have not compiled properly?
mysql can use thread, so if you just see one mysqld, which must
be multi-thread. mysql is multi-thread or is multi-process, which
be decided in compile time.
for thread, there are two thread model ( in most Unix ), posix-thread
and kernel-thread, and posix thread is not perfect for multi-cpu computer,
kernel-thread is better.



anything i think you ignore: 
to use cynus, you must make postfix use "deliver" of cynus
to deliver mail, not to deliver mail to any file directory.
please see the mailbox_command ( maybe ) for detail.


> Can you please tell me how to compile mysql using multi-process?
why not use multi-process?
multi-thread is also a nice solution, better performance.
just posix thread has a little poor.
ok, if you want to use multi-process,
when you do configure use "./configure",
please give the corrent parameter, to get
the infomation, use "./configure --help"


>    我的virtual_maps掉了一個s !!!!!所以實際上virtual_map沒有定義.我加上后就OK了!!!
>    現在我就差如何知道有新郵件進來了(我是不是有點不知足? :) ).我想利用一個程序捕捉新郵件的到來---以前的biff可能
> 不能用了,因為現在沒有用系統用戶做郵件用戶.然后分析哪台機器的用戶信件比較多,收發郵件比較
搞定了就最好,我想如果你能將你的經驗共享出來,那就最好不過了,
結合Scalable Web Mail How to那篇文章,或者翻譯一下,一定會受到
大家歡迎的,你覺的呢?
另,biff的方式是不可用的,或許需要你對cyrus直接編程,
或者分析mail的日志文件。由于已經改變了郵件的存儲方式,
因此原有的程序不能使用。
如果你能寫一些有用的經驗的話,我很樂意作為第一個讀者。




>     第一個是關于DIVERT機制。在開啟IPFW功能后可以利用divert獲得IP報文,但我想知道內核分配給divert的buffer有多大,會不會出現buffer溢出的可能,若有,系統會怎樣呢。另外當開啟IPFILTER機制后,還有類似于divert的機制來獲取IP報文嗎?
divert不需要太大的cache,因為它將ip包直接轉給了相應的natd程序了,如果natd不能處理,則packet會被丟棄
ipfw ( divert) 不能和ipfilter合作(至少在3.1不行)


> I will try ipmon,(ipmon在IPFW or IPFILTER模式下都能使用嗎。)
ipmon is a part of ipfilter, not ipfw.B
> 還有一個問題想請教你,我想利用syslogd給另一主機發消息,則在syslog.conf中怎么進行設置呢。
> 我試過的是:syslog.*                            /var/log/sys.log                在syslog.conf中。
> 但收不到信息.
> 產生消息的主機中syslog.conf我也設置了.
here is a part of "man syslog.conf"

     o   A hostname (preceded by an at (``@'') sign).  Selected messages
are
         forwarded to the syslogd(8) program on the named host.



>     有幸拜讀您的《FreeBSD使用大全》一書,受益非淺。由于特殊的原因使書中的CD-ROM工作不穩定,特向您請教文件名后綴為listing文件的作用,是否影響系統的安裝和維護。
oh, .listing is a file used by wget , a downloading tool in Unix.
I use wget to download the FreeBSD installation files , so wget
produce the files, i don't delete them but hide them in Unix, don't
hide them in windows, it can help me to see which file was removed
by me from origan file tree.
.listing don't concern the installation and use.



> ~{NR8UW0AKR;?i~}NE2000~{ 就是 在FreeBsd上裝上Apache+Php,能夠和一台Oracle8的機器連接。
> 
> 關于同樣一個問題我也在cn-freebsd-list上提過,但回應寥寥。只有
> 一封信提到,用Oracle 8i for FreeBSD。我懷疑我是否看錯了。但我
> 還是和那個人聯系了。結果是沒有回應。

首先,我沒有使用過PHP + Oracle這種方式,不能給你明確的答案,
只能對你的信息進行一點分析。
1, 從這些信息中可以得知,PHP需要和oracle下的某些庫相連接,
如/opt/ora80/app/oracle/product/8.0.5/lib/libcore4.a
first,你必須保証這些庫是FreeBSD版本的,一個有用的命令
是file, 如“file /opt/ora80/app/oracle/product/8.0.5/lib/libcore4.a”
將會告訴你該libcore4.a的類型
2, 此外,如果連接不正確,那就說明是庫的連接不正確
   例如__ctype_tolower函數,在我的印象中tolower函數應該是一個標准
   C函數,應該位于libc中,你可以使用nm命令在/usr/lib下的libc.so.x
   文件中搜索相關函數,看看是否連接正確,看看在源代碼中對tolower
   的定義是否正確。等等
3, PHP 4還是在測試狀態,如果出現問題應該可以理解,可以到PHP4
的開發者使用的maillist或newsgroup中發問。或者試試php3。
4, 還是在php.net中詢問,或者在newsgroup中發問。
不能幫什么忙,一點建議希望能對你有幫助。



>    我打算在單位內局域網中基于FREE BSD做一套郵件系統。
> 客戶端是基于WEB的,類似163電子郵局那種。由于將來打算所有的二級單位都能使用這個服務,因此該郵件系統應有可擴展性。遺憾的是,書中對于電子郵件服務部分,講的還不是很細。有些具體問題我想請教一下:
關于5提供郵件服務,我建議你使用現有的系統,而不是重復開發,
例如你可以使用IMAP服務器,使用IMP作為Web Mail接口,
實際上可供選擇的免費軟件很多,基本上都使用IMAP協議來作為Web
Mail訪問Mail服務器,使用PHP或Perl作為Web Mail的編程語言,
如果你習慣使用Perl,可以使用Wing作為Web Mail接口。
當然,如果你公司有錢購買,可以買一套這樣的系統。事實上,我
很早就完成了這樣一種系統。未來,還會出現租用WebMail的形式。
推荐你讀以下2文章:
http://www.horde.org/papers/Scalable_webmail_HOWTO.html
http://freebsd.online.ha.cn/articles/webmail.html
你完成了發信模塊之后,離整個系統的目標還比較遠,
請讀完這兩篇文章之后,我們可以繼續討論。



> 我安裝了FreeBSD3.2 Release,在配置X Windows時遇到了一些問題我的顯卡是savage 3D(s3 model 8a20 accelerator),顯示器是三星510b,在使用XFree86配置后顯示Unable to find a server,選擇Ok后即無響應,Ctrl-Alt-Del也無用,望指教!
安裝時是否安裝了相應的X Server?
缺省只安裝VGA和SVGA的X Server。
請運行光盤中XFree86目錄下的install.sh
安裝X Server(或運行sysinstall
 


> 我已安裝了所有的X Server,在XFree86中配置時,若僅選擇顯卡不對顯示器和顯示模式進行選擇,則回分
配一個X Server,但只有640*480,256色.若選擇顯示模式為800*600,32bpp(我在win98與win2000中使用的設置),選擇顯示器為
Hyfreqency SVGA 1024*768@75Hz,則無法分配一個Server,并且系統無響應.此外我安裝bash和tcsh也未成功.(我在安裝系
統時是選All的,Ports Colletion也裝了,執行make install后返回Error.)
一般來講,如果設置程序不能確定你的顯卡,你將得到一個320x200的256色模式,
如果你得到640x480的256色模式,那就表明你已經得到Super VGA的模式,
因為標准VGA模式是640x480x16或320x200x256。請仔細檢查你的分辨率是否是
640x480x256.
如果得到640x480x256,那么你就可以設置更高的模式,你可以先使用
640x480x256來啟動你的XServer,然后再逐步增加分辨率。
bash 和tcsh可以通過package collection來安裝,
使用pkg_add,它們將被安裝到/usr/local/bin下


>     在自由軟件風起潮涌之時,作為FreeBSD的支持者,我們在play的同時,
> 也開始思索FreeBSD的未來。有一些觀點想跟您探討,請多指教。
> 首先,我們覺得linux的崛起對于所有的自由軟件來說,都是一個好事。
> 通過linux,大家都知道自由軟件并非只是擺設。從IDC的報告可知,自由軟件
> 已經改變人們的觀念并被接受了,這從redhat,VA-linux等業績可反映出。
> 
> 其次,隨著Internet革命的迅猛發展,服務器市場也逐漸回升(佩服IBM push e-commerce的策略),
> linux也涉足低端server,這是一個進步。但正如您在<>中所指出的一樣,
> 在Web server等網絡領域,FreeBSD絕對是PC平台上的NO.1。其實,在其它網絡設備中,
> FreeBSD也被廣泛地用著,如目前生產最快路由器的Juniper公司,就用FreeBSD作為其路由器的OS。
> 
> 目前,Internet市場蓬勃發展,國內一些網絡公司也想采用FreeBSD作為其server,但是總在擔憂
> 技朮支持后選擇了Turbolinux等專業公司的linux產品。或許新事物的出現總有一個過程,但是我們
> 認為作為FreeBSD的一份子,是否有必要為它做點什么。?關于FreeBSD的未來,我也常常在思考這個問題,
曾和一些Linuxer討論過,他們不太看好,這也難怪。
從個人角度來講,我主要關心服務器端,這是與那些
Linuxer不同的地方。
 



>    I'm sorry , would you tell me from where I can download the cclib16
>  used for
> chinput  under freebsd ) ?
please search cclib16 in yahoo or other search engine,
here is my search result for you:
No Title - Jian/ Family GL/ File Name FanTi Style GR encoding/charset --
beijing16.bdf.gz J SongTi GR GB2312-80 beijing24.bdf.gz J SongTi GR
GB2312-80 cclib16fs.bdf.gz J FangSongTi GR GB2312-80 cclib16st.bdf.gz J
SongTi GR GB2312-80 gb16fs.bdf.gz J FangSongTi.
--http://www.sinica.edu.tw/chinese-env/xfonts-readme.txt





>    我一台PC上安裝了redhat 6.1 ,在另一台服務器安裝了FreeBSD4.0。在用ab做apache的壓迫性
> 測試時,發現freebsd中出現pipe broken提示。好像是系統無法承載了。我已經對系統內核按你書
> 中所說進行了重編譯,打開了softupdate; apache的參數也做了調整,改進不大,請幫我分析一下
> ,如何在FreeBSD下得到一台高性能的Web服務器。
Broken Pipe的來源是連接被斷開了,它不僅與服務器有關,也與客戶機有關。
如果你在運行Apache的同一個服務器上使用ab,就更容易出現這個問題。
因為ab本身要占用網絡資源,例如,要建立一個連接,服務器端需要
一個文件描述字,ab也需要一個文件描述字,那么統共需要兩個文件描述字。
很多情況下是由于ab本身出現問題導致broken pipe問題。
下面我提出一些疑問,希望能對你有些幫助。

> FreeBSD 4.0 kernel重編譯支持SMP, 內核配置文件見附件,apache用的是已編譯的二進制包
> apache-1.3.12。
freeBsd下已編譯的apahce包缺省的hard server limit是512,不是apache缺省的256

> 觀察發現linux中進程最多時僅270左右, 而freeBSD中卻在達到380多個后,終止了測試。why
這也許是原因所在,linux下的apahce的hard server
limit是256(缺省),這意味著該server不能提供并發500個連接,ab將
等待其他連接。ab的實際連接數最多是256個。
freebsd中使用的freebsd缺省apache的hard server limit為
512(FreeBSD缺省),當連接達到380個之后,ab超過了測試客戶計算機的
能力,出現了Broken pipe問題。

> ???, 另外在靜態頁面的測試中安裝了freebsd的服務器也無優勢可言,請高手幫我分析一下,是否
> 還有什么可改進的地方,我覺得freebsd不該是這樣的。
為了達到最優的測試效果,你需要重新編譯apache,并需要調整apache的參數設置。




>    I am a reader of your ,and got to
> know that you have designed a NAT based load balancer. I am doing some
> academic research on this subject, can you kindly give me the source code.
> Thank you very much.
It is very glad to know someone do the research in these field.
I have a paper about it and post it in 中國圖形圖象學報 vol 1 , 2000.
you can get my source in http://freebsd.online.ha.cn
now my attention is not here, and do some others work( my job is not
in academic research ), but i want to know what progress in the field 
in USTC or other university, and new idea in the field.
how about introduce more new idea about it to me about your job
and more new progress in the field to me?





>     我根據你的說法調整了linux機器中apache的hard server limit, 在系統中仍然沒有出現
> pipe broken,結果也差不多, 而且我從另外的機器啟動了ab(局域網中)。
>     另外我發現一個有趣的問題,昨天我在另外一台機器(PIII450, 512M SDRAM 9.1 segate SCSI,
> aic7890 lvd 80M/s) 上安裝了freebsd3.4,速度非常快,ab測試每秒可以處理980個連接,但是只能
> 用ab -n 2000 -c 500測試,再大就會有pipe broken。但是安裝FreeBSD4.0后,速度只有130個連接
> , 但是可以支持 ab -n 15000 -c 1000的測試。我不太明白原因,用top觀察FreeBSD4.0的情況,50
many "broken pipe" is due to the Client (the computer running ab) Wrong,
Client can not open Too Many Socket in same time. I guess you can 
try running ab in one of FreeBSD to test another server.
anyway , you have not reached the top power of server.
in default apache in FreeBSD, the apache just support 512 concurrent, so 
the -c 1000 is useless.
here i don't know why it just have 130 concurent request, there should
be the deeper reason.

> 0多個進程,但只有3個runing, FreeBSD3.4的情況我沒注意,linux上我看230個process,140多個在
3 running is correct, you know, anyway one cpu just can running one
process in same time. why top report more running process? because when
top running, the process's status has changed. so the linux report
140 running process, i must say it is very dirty. maybe the linux
has different task scheme.
anyway, 230 processes means it can not serve 500 concurrent requerst of
ab. if it serve 500 concurrent requrest, at least there is 500 processes.
because linux just serve 256 concurrent request, so your client ab don't
report "broken pipe" error, if you make your linux serve 500 request( 500
httpd process in same time), i bet your ab will "broken pipe" .
i said your problem isn't the kernel configure.
after you configure your kerenel to support all your hardware( including
memory) and all necesaary feature( such as ppp, firewall, softupdate,
etc), to configure the kenerl just can decrease the size of kernel,
make kernel simple. anyway , it won't make the kernel appear
the different power as you wish.
what make you said your server is slower than your notebook?
have you try to look for the bottle-neck of it? 
i guess you haven't reach the 10% power of the server.
please tell me why you think your server is slower than your notebook,
maybe i can help you.



> How can i set up DNS Server to visit web by name?
if you want a Name for your server, you needn't setup a DNS server,
you need apply a Name in one DNS server.
if you want setup a DNS server, you also need apply a entry in CNNIC
or INTERNIC or other company, it need money.



>    我用同樣的內核配置。
>  FreeBSD3.4
> ab -n 2000 -c 500 loalhost , 在高筆記本和服務器都會出現pipe broken
> apache1.3.9 我已經重新編譯。
> Requests per secondRequest
> notebook: 1100/sec
> server: 900/sec
> 
> apache1.3.12 我已經重新編譯。
> FreeBSD4.0
> ab -n 10000 -c 1000 localhost
> Requests per secondRequest
> notebook: 280/sec
> server: 160/sec
> 
> 我不明白,為什么4.0比3.4慢了許多,而在notebook上又相對快些。你在FreeBSD中作相應的測試,
> 有這種問題嗎? 是否是4.0的Freebsd對內核做了重大的調整,使效率降低了,因為我發現用vmstat
> 5 觀察時,sy達到了70%,有些不太正常。
at any state, -c 1000 will be slower than -c 500.
the result cannot prove the 4.0 is slower than 3.4.
and , about your server is slower than notebook,
it is not normal. maybe there is some reason you 
have ignored.
ok, in fact don't concern the test result more,
it is a test envirement, not reality. in reality,
system will reach the bottle-neck in memory, I/O,
etc. you never meet the state in your experiment.



> Now i want to visit web by name like www.xxx.xxx. in my intranet.
> These are a way in setup  DNS,it is resolving-only,use /etc/hosts and 
> /etc/resolv.conf,not running named.
if you want to use resolv.conf, you must running named.

> I set up DNS address(web address) in WIN95. It doesn't work.
yes, you must set up named in server if you want to use DNS.
or you must edit c:\windows\hosts in every WIN95 computer.

> 
> I retry to run named,nslookup    ,appear the following is 
> 
> Default server:  sbw.freebsd.com.cn
> Address:  0.0.0.0 
in resolv.conf, add:
nameserver 127.0.0.1
of course, you must run named in 127.0.0.1

> 
> normally,the address entry is 127.0.0.1
> My server isnot it.
> 
> My mind is how to set up name resolve in my web server,client use it to 
> visit web ,not use IP address.
> 
> Please tell me step by step.
two way:
1, set up every hosts file in every windows95 and unix computer.
for windows95, hosts file in c:\windows\hosts
for unix, hosts file in /etc/hosts
add all name/ip pairs.

2, set up a named in one server. set up every DNS server entry to it in
every computer.
for windows, use control panel to set DNS server.
for unix,  use resolv.conf.
and for named, add a new zone(domain), and add all name in the
zone(domain) in the zone file.


>    我在4.0中用ab -n 1000 -c 50 localhost/ 的測試結果也是178 request/sec。與高并發的情況
> 類似,你能解釋這種情況嗎?另外,我想問一下ab到底能不能較為合理的評估一個WEB系統。因為
我懷疑有一些其他因素的影響。
ab不是一個完整的測試工具,它能大致評估一個web系統處理并發的最大能力。
但實際系統永遠達不到這個極限就會遇到其他瓶頸。因此不能迷信這個結果。
但它有時能告訴一些信息來幫助進行調試性能。

> 我發現在nt+iis4下,ab的測試速度可以達到1200 request/sec, 但是只能用ab -n 10000 -c 299
iis在處理并發的速度理論上要優于apache,這是由于iis使用的線程的生成速度要優于
apache使用的進程,系統消耗要小一些。

> 進行測試。似乎并發一高就會出現pipe broken。你在你的系統上有過測試結果嗎?能不能給一份
broken pipe大致是因為運行ab的計算機問題。
我的測試中在某些計算機上運行ab有一定的限度,但在另外的計算機上就沒有(對
同一台server)broken pipe問題。
在同一台server上(Dell 4300, 512M, 2xP3),使用ab測試localhost,結果大致
是500 request/sec。




> 我認為她這種集中式的開發模式比完全開放的模式更能保証系統的穩定的發展。Linux的多版本已經
> 使我們疲于應付。
最近的Linux版本都自己搞一套,歸根到底是想提供簡便的操作和管理界面,為了達到這個
目的,就不希望用戶直接控制系統文件,于是就把一些東西搞復雜了。
不過基本的東西還是一樣的。
> 另:您可否告訴我還有其它的關于FreeBSD的書,我在書店里只看到你的這一本。最好能在您這本的
> 基礎上再深一步。英文的也可以。謝謝。希望我們能成為朋友。
我所知道的就是在書中提到的,沒有中文版。
在W CDOM發行的正式光盤中附有這本書的txt版本。
我們會成為朋友的。


> freebsd下有沒有提供和sybase/oracle 的連接及編程接口。
數據庫接口屬于數據庫系統,不屬于操作系統。
因此首先可以檢查sybase/oracle提供的接口。
除了數據庫系統提供的接口之外,還有一些編程
系統提供的數據庫接口也支持sybase/oracle,關鍵
在于你選用那種工具和系統。例如,使用perl可以
用perl的DBI/DBD接口,使用PHP也有自己的接口,
等等。



OK, i check your system, i find two key for your question:
1: in kernel configure:
	you set NMBCLUSTER to 4096,
	it is enough for common user, but it is not enough for heavy
server, espically you want to test it. and, "ab" will alloc many mbufs,
so if you use less NMBCL.., "ab" will break.
	so, increase NMBCLUSTER to 20480 or more for testing.
	use "netstat -m" in testing to check if need increase more.
	in linux, no mbuf problem, but file handle is bottleneck in heavy
load.

2: in apache configure
	you use common apache configure. it is not enough for best
performace, espically in testing.
	you need: increase MaxSpareServer and MinSpareServer to MaxClient
		increase MaxClient to 256 or 512 according your testing
or common load.
		increase MaxRequestsPerChild to 5000 or more.
	you can get the 10-times test-results.

wb


> 提供了linux,nt的接口。沒有freebsd的接口,據你所知可在freebsd下工作的大型數據庫有那些
> (如sybase,oracle,informix...)
you can run sybase, oracle , informix for linux in freebsd.
the native database in freebsd is fewer than linux,
such as : Interbase, Solid, postgres ... 



>       我的機器裝了D-link 220(isa card)(irq=5,io=300),FreeBsd 不認
>        請問如何解決  謝謝!!!
記得啟動時的UserConfig嗎?
試一試將這個卡作為Ne2000兼容,并改動其資源值符合irq=5, io=300
如果不行,那就說明有兼容性問題了。



> 請問您是否在linux下安裝過qmail,我按照intall.txt進行安裝,可到第四步
> 執行./config時出錯,提示錯誤為:
> soft error
> sorry, i couldn't find your host's canonical name in DNS.
這個錯誤顯然是因為你的服務器沒有名字造成的,
你可以在/etc/hosts文件中加上你自己計算機的名字,
或者自己啟動一個DNS服務器。



> Where to get the bash and tcsh pakage for Freebsd?
in any FreeBSD CD or ftp site, cd packages, and then cd shell
you can find "bash-2.xxx.tgz" or "tcsh-XXXX.tgz"
then you can use "pkg_add bash-xxxxxx.tgz" to install
it, the bash will be installed to "/usr/local/bin"
that is all.


> 還望解答。BSD能不能很好的支持中文?
能,但不是很好。
你可以去看看http://www.cn.freebsd.org
有關的文檔。




>     2 我用IPFILTER做透明代理,但一運行ipnat,系統就顯示
>       “/DEV/ipnat DRIVER NOT CONFIGERD”,我把FREEBSD全部
>       安裝上去,但仍然沒有/DEV/ipnat這個文件,不知如何產生
>       /DEV/ipnat這個文件?
at first , complie the kernel with IPFILTER supported( without IPFW )
if no /dev/ipnat, make it by "MAKEDEV ipnat"



>  又有一個問題向你請教,我想知道unix下有沒有通過web方式遠程管理服務器的軟件。
管理什么服務器?Web服務器?郵件服務器?
但是這些東西都是跟具體環境相關的。
商業產品如solaris, AIX等當然會提供一整套的方案,
但自由軟件就更跟具體環境和服務器相關了。


> unix下有反病毒軟件嗎?
unix下有病毒嗎?
unix有反window病毒的軟件。



>         我對您來說是一個陌生的提問者,我看到一篇來自于“王波個人網站”的文章《建立大容量WEB
> 的EMAIL系統》,我對E-MAIL系統比較感興趣,但是不知道哪里可以找到QMAIL或者postfix的源代碼
postfix: www.postfix.org
qmail: www.qmail.org
simple?