<?xml version="1.0" encoding="UTF-8"?>
  <feed xmlns="http://www.w3.org/2005/Atom">
  <title type="html"><![CDATA[深圳虚拟主机专家－大中华资讯网]]></title>
  <subtitle type="html"><![CDATA[世界观人人不同，大中华资讯网服务始终如一！]]></subtitle>
  <id>http://blog.bigchina.com.cn/</id> 
  <link rel="alternate" type="text/html" href="http://blog.bigchina.com.cn/" /> 
  <link rel="self" type="application/atom+xml" href="http://blog.bigchina.com.cn/atom.asp" /> 
  <generator uri="http://www.pjhome.net/" version="2.4.1022">PJBlog2</generator> 
  <updated>2008-02-23T16:51:09+08:00</updated> 

  <entry>
	  <title type="html"><![CDATA[freebsd 6 目录]]></title>
	  <author>
		 <name>admin</name>
		 <uri>http://blog.bigchina.com.cn/</uri>
		 <email>sky@bigchina.com.cn</email>
	  </author>
	  <category term="" scheme="http://blog.bigchina.com.cn/default.asp?cateID=14" label="freebsd" /> 
	  <updated>2008-02-23T16:51:09+08:00</updated>
	  <published>2008-02-23T16:51:09+08:00</published>
		  <summary type="html"><![CDATA[<table id="AutoNumber1" style="BORDER-COLLAPSE: collapse" bordercolor="#111111" cellspacing="0" cellpadding="0" width="500" border="0">
    <tbody>
        <tr>
            <td width="100%" colspan="2">
            <p align="center"><tt class="chtitle1">FreeBSD 6.0架設管理與應用</tt></p>
            </td>
        </tr>
        <tr>
            <td align="center" width="50%"><img height="240" src="http://www.bigchina.com.cn/ebook/1/cover.jpg" width="178" border="0" alt="" /></td>
            <td width="50%">書名：FreeBSD 6.0架設管理與應用
            <p>作者：王俊斌</p>
            <p>ISBN：957-527-878-X</p>
            <p>出版社：博碩文化</p>
            <p>&lt;版權所有，非經授權請勿轉載&gt; </p>
            </td>
        </tr>
    </tbody>
</table>
<table id="AutoNumber2" style="BORDER-COLLAPSE: collapse" bordercolor="#111111" cellspacing="0" cellpadding="0" width="500" border="0">
    <tbody>
        <tr>
            <td width="100%">
            <pre>
            <pre><a href="http://www.bigchina.com.cn/ebook/1/ch00.asp">序</a>
            <a href="http://www.bigchina.com.cn/ebook/1/ch01.asp">第一章 FreeBSD 簡介</a>
            1.1 什麼是FreeBSD？
            1.2 為什麼要選擇FreeBSD？
            1.3 為什麼不選擇FreeBSD？
            1.4 FreeBSD的版本命名規則
            1.5 如何取得FreeBSD？
            1.6 如何得到更多資訊？
            1.7 本書光碟使用說明
            <a href="http://www.bigchina.com.cn/ebook/1/ch02.asp">第二章 安裝 FreeBSD</a>
            2.1 安裝前需知
            2.1.1 如何取得FreeBSD
            2.1.2 硬碟分割表的概念
            2.1.3 硬碟空間的配置
            2.1.4 多重開機
            2.2 系統安裝
            2.2.1 開機
            2.2.2 設定核心
            2.2.3 開始自訂安裝
            2.2.4 分割硬碟
            2.2.5 安裝自訂套件
            2.2.6 選擇安裝來源
            2.2.7 最後的設定
            <a href="http://www.bigchina.com.cn/ebook/1/ch03.asp">第三章 UNIX 系統入門</a>
            3.1 第一次登入系統
            3.2 認識 UNIX 使用環境
            3.2.1 UNIX 指令語法
            3.2.2 UNIX 的目錄結構
            3.2.3 檔案與目錄管理
            3.2.4 重導 I/O 及管道
            3.3 文書編輯器
            3.3.1 ee
            3.3.2 vi
            3.4 Shell 環境簡介
            3.4.1 Shell 的環境變數
            3.4.2 Tcsh 的環境設定
            3.5 使用者及權限管理
            3.6 系統服務及行程管理
            3.6.1 行程
            3.6.2 系統服務及行程管理
            3.6.3 基本系統服務 inetd
            3.6.4 定時執行工作
            3.7 虛擬終端機
            3.7.1登入後的訊息
            3.7.2 登入前的訊息
            3.7.3 使用中文終端機
            <a href="http://www.bigchina.com.cn/ebook/1/ch04.asp">第四章 使用者管理</a>
            4.1 帳號管理
            4.1.1 新增使用者
            4.1.2 /etc/group 介紹
            4.1.3 /etc/master.passwd 介紹
            4.1.4 刪除使用者
            4.2 系統資源限制
            4.2.1 登入類別
            4.2.2 磁碟配額
            4.3 大量新增帳號
            4.4 備份與移轉
            4.4.1備份
            4.4.2 移轉
            4.5 使用歷程記錄
            4.5.1 記錄使用者指令
            4.5.2 監看使用者
            4.5.3 控制 root 的使用
            <a href="http://www.bigchina.com.cn/ebook/1/ch05.asp">第五章 網路設定</a>
            5.1 網路概念介紹
            5.1.1 IP 位址與子網路遮罩
            5.1.2 申請 ADSL/Cable&nbsp; 的選擇
            5.1.3 申請網域名稱
            5.2 固接網路
            5.2.1 使用 sysinstall
            5.2.2 手動設定
            5.3 DHCP 動態取得 IP
            5.4 ADSL
            5.4.1 編譯核心
            5.4.2 修改 /etc/ppp/ppp.conf
            5.4.3 修改 /etc/rc.conf
            5.5 Modem 撥接
            5.5.1 編輯 /etc/ppp/ppp.conf
            5.5.2 編輯 /etc/ppp.linkup
            5.6 網路相關指令
            5.6.1 telnet
            5.6.2 ftp
            5.6.3 ping
            5.6.4 nslookup
            5.6.5 netstat
            5.6.6 traceroute
            5.6.7 sockstat
            5.6.8 ifconfig
            5.6.9 tcpdump
            5.6.10 lynx
            <a href="http://www.bigchina.com.cn/ebook/1/ch06.asp">第六章 檔案系統管理</a>
            6.1 FreeBSD 的檔案系統架構
            6.2 監看檔案系統使用情形
            6.2.1 磁碟空間使用情形
            6.2.2 磁碟使用效率
            6.3 掛入檔案系統
            6.3.1 掛入與卸載 FreeBSD 檔案系統
            6.3.2 掛入與卸載其它檔案系統
            6.3.3 開機時自動掛入
            6.4 磁碟分割與格式化
            6.4.1 使用 sysinstall
            6.4.2 使用命令列
            6.5 使用 USB 磁碟機
            6.5.1 事前的準備
            6.5.2 掛入已格式化的磁碟機
            6.5.3 格式化 USB 磁碟機
            6.6 檔案系統修復
            6.7 檔案系統快照
            <a href="http://www.bigchina.com.cn/ebook/1/ch07.asp">第七章 系統安全</a>
            7.1 概論
            7.2 系統管理
            7.2.1 執行程式的路徑
            7.2.2 降低安裝軟體的風險
            7.2.3 kernel Security Level
            7.2.4 檢視系統記錄
            7.2.5 資料的保全
            7.3 帳號管理
            7.3.1 慎選合宜的密碼
            7.3.2 控制 root 的使用
            7.3.3 限制系統資源的使用
            7.3.4 限制 crontab 及 at 的使用
            7.4 網路管理
            7.4.1 關閉不必要的服務
            7.4.2 使用 ssh
            7.4.3 TCP Wrapper
            7.4.4 ipfw
            7.5 漏洞修補
            <a href="http://www.bigchina.com.cn/ebook/1/ch08.asp">第八章 編譯核心</a>
            8.1 為什麼要重新編譯核心
            8.2 修改核心
            8.2.1 基本的設定
            8.2.2 一般選項
            8.2.3 各種檔案系統的支援
            8.2.4 軟硬體相容性設定
            8.2.5 匯流排及軟碟機
            8.2.6 IDE 介面裝置
            8.2.7 SCSI 裝置
            8.2.8 基本週邊設備
            8.2.9 網路卡設定
            8.2.10 虛擬裝置
            8.2.11 USB 裝置
            8.3 編譯與安裝
            8.3.1 編譯新的核心
            8.3.2 新的核心有問題
            <a href="http://www.bigchina.com.cn/ebook/1/ch09.asp">第九章 系統調校</a>
            9.1 監看系統效能
            9.2 使用 sysctl 調校
            9.2.1 kern.ipc.maxsockets
            9.2.2 net.inet.ip.portrange.*
            9.2.3 kern.ipc.shm_use_phys
            9.2.4 vfs.vmiodirenable
            9.2.5 vfs.write_behind
            9.2.6 vfs.hirunningspace
            9.2.7 net.inet.tcp.sendspace 及 net.inet.tcp.recvspace
            9.2.8 net.inet.tcp.always_keepalive
            9.2.9 net.inet.tcp.delayed_ack
            9.2.10 kern.ipc.somaxconn
            9.2.11 kern.maxfiles
            9.2.12 kern.maxusers
            9.2.13 kern.ipc.nmbclusters
            9.2.14 hw.ata.wc
            9.3 調整硬碟參數
            9.4 虛擬記憶體管理
            <a href="http://www.bigchina.com.cn/ebook/1/ch10.asp">第十章 軟體安裝</a>
            10.1 概論
            10.2 使用 package
            10.2.1 安裝 Package
            10.2.2 管理 Package
            10.3 使用 ports
            10.4 更新 port tree
            10.5 使用 portupgrade 更新軟體
            10.6 傳統安裝方式
            <a href="http://www.bigchina.com.cn/ebook/1/ch11.asp">第十一章 X Window 的使用</a>
            11.1 安裝 X Window
            11.2 X Window下的中文軟體
            11.2.1 中文終端機
            11.2.2 中文輸入
            <a href="http://www.bigchina.com.cn/ebook/1/ch12.asp">第十二章 NAT 及防火牆</a>
            12.1 概論
            12.1.1 NAT
            12.1.2 具封包過濾的橋接器
            12.2 NAT
            12.2.1 設定 kernel
            12.2.2 設定 rc.conf
            12.2.3 設定 rc.firewall
            12.2.4 client 端的設定
            12.2.5 NAT Port Forwarding
            12.3 防火牆
            12.3.1 ipfw 規則
            12.3.2 範例
            12.3.3 一些小建議
            12.4 封包過濾橋接器
            <a href="http://www.bigchina.com.cn/ebook/1/ch13.asp">第十三章 網頁伺服器</a>
            13.1 概論
            13.2 安裝及設定 Apache
            13.2.1使用 ports 安裝
            13.2.2 Apache 基本設定
            13.3 http.conf 說明
            13.4 PHP 進階設定
            13.5 Apache 伺服器狀態與管理
            13.5.1 Apache 狀態資訊
            13.5.2 效能測試
            13.5.3 維護伺服器記錄檔
            <a href="http://www.bigchina.com.cn/ebook/1/ch14.asp">第十四章 網頁伺服器進階應用</a>
            14.1 HTTP 安全與 SSL 協定
            14.1.1 產生金鑰
            14.1.2 設定及啟動 HTTPS
            14.2 對目錄設定密碼保護
            14.3 虛擬主機
            14.4 網頁記錄分析
            14.5 MRTG 流量分析
            14.5.1 安裝 SNMP
            14.5.2 安裝 MRTG
            <a href="http://www.bigchina.com.cn/ebook/1/ch15.asp">第十五章 FTP 伺服器</a>
            15.1 FTP 概論
            15.2 設定 FTP 伺服器
            15.2.1 啟動 FTP 伺服器
            15.2.2 編輯歡迎訊息
            15.2.3 FTP 伺服器管理
            15.3 FTP 權限控制
            15.3.1 限制帳號與連線來源
            15.3.2 限制上傳下載權限
            15.3.3 chroot
            15.3.4 匿名的 FTP
            15.4 SmbFTPD
            15.4.1 安裝 SmbFTPD
            15.4.2 限制登入帳號
            15.4.3 限制上下傳頻寬
            15.4.4 匿名的 FTP
            15.5 SmbFTPD 的目錄權限控制
            15.5.1 何謂 SMB Mode
            15.5.2 如何設定 SMB Mode
            15.5.3 設定範例
            15.5.4 chroot
            15.6 SSL/TLS 連線加密
            15.6.1 設定啟用 SSL/TLS
            15.6.2 安裝支援 SSL/TLS 的客戶端軟體
            15.7 smbftpd.conf
            15.7.1 系統區段
            17.7.2 使用者登入控制
            17.7.3 FTP 目錄權限控制
            17.7.4 匿名使用者控制
            17.7.5 檔案傳輸控制
            17.7.6 SSL/TLS 控制
            <a href="http://www.bigchina.com.cn/ebook/1/ch16.asp">第十六章 郵件伺服器</a>
            16.1 電子郵件概論
            16.2 具身份認證的 sendmail
            16.2.1 安裝 Cyrus SASL
            16.2.2 安裝 Sendmail
            16.2.3 Client 端的設定
            16.3 POP3 及 IMAP 設定
            16.3.1 簡單的 POP3 伺服器
            16.3.2 加密的 POP3 及 IMAP
            16.4 進階郵件伺服器設定
            16.4.1 設定郵件別名及自動轉寄
            16.4.2 一舨使用者設定自動轉寄及自動回信
            16.4.3 限制每封郵件大小上限
            16.5 郵件問題處理
            16.5.1 郵件結構
            16.5.2 限制寄件者來源
            16.5.3 處理未寄出之信件
            16.5.4 收發信件問題處理
            <a href="http://www.bigchina.com.cn/ebook/1/ch17.asp">第十七章 郵件伺服器進階應用</a>
            17.1 虛擬郵件主機
            17.1.1 DNS 設定
            17.1.2 對映到同一台機器的真實使用者
            17.1.3 可以擁有虛擬使用者
            17.2 垃圾信及病毒防護
            17.2.1 MailScanner 架構說明
            17.2.2 安裝 MailScanner
            17.2.3 設定 MailScanner
            17.2.4 MailScanner 進階管理
            17.3 Open WebMail
            17.3.1 系統需求
            17.3.2 安裝 Open WebMail
            <a href="http://www.bigchina.com.cn/ebook/1/ch18.asp">第十八章 DHCP伺服器</a>
            18.1 DHCP 簡介
            18.2 安裝 DHCP 伺服器
            18.3 客戶端 DHCP 設定
            18.4 DHCP 及系統管理
            <a href="http://www.bigchina.com.cn/ebook/1/ch19.asp">第十九章 資料庫系統</a>
            19.1 概論
            19.2 安裝 MySQL
            19.3 SQL 語法介紹
            19.3.1 Create
            19.3.2 Alter
            19.3.3 Drop
            19.3.4 Insert
            19.3.5 Select
            19.3.6 Update
            19.3.7 Delete
            19.4 MySQL 管理
            19.4.1 維護密碼安全
            19.4.2 備份資料庫
            19.4.3 使用者管理
            19.4.4 如何更改使用者密碼
            19.5 MySQL 圖形化管理工具介紹
            19.5.1 MySQL Administrator
            19.5.2 MySQL Query Browser
            19.6 PostgreSQL 安裝設定
            19.7 PostgreSQL 管理指令
            19.7.1 建立及刪除使用者
            19.7.2 建立及刪除資料庫
            19.7.3 互動式 SQL 指令
            19.7.4 資料庫備份及回復
            19.8 PostgreSQL 圖形化管理工具介紹
            <a href="http://www.bigchina.com.cn/ebook/1/ch20.asp">第二十章 SAMBA 網路芳鄰</a>
            20.1 網路芳鄰簡介
            20.1.1 SMB 協定簡介
            20.1.2 Samba 簡介
            20.2 安裝設定 Samba
            20.2.1 安裝 Samba
            20.2.2 基本的設定檔說明
            20.2.3 啟動 Samba
            20.3 smb.conf 設定說明
            20.3.1 global 區段的基本設定
            20.3.2 global 區段的安全性設定
            20.3.3 global 區段的效能調校設定
            20.3.4 global 區段的記錄檔及除錯設定
            20.3.5 global 區段的網路資源設定
            20.3.6 分享權限設定
            20.4 使用網頁設定 Samba
            20.5 Samba 命令列工具介紹
            20.5.1 smbpasswd 使用者及密碼管理
            20.5.2 smbstatus 伺服器狀態檢視
            20.5.3 nmblookup 名稱查詢
            20.6 Windows 設定
            20.7 存取 MS Windows 的網芳資料
            <a href="http://www.bigchina.com.cn/ebook/1/ch21.asp">第二十一章 NFS</a>
            21.1 概論
            21.2 NFS 設定
            21.3 NFS 的限制
            <a href="http://www.bigchina.com.cn/ebook/1/ch22.asp">第二十二章 DNS 伺服器</a>
            22.1 DNS 概論
            22.2 named.conf
            22.3 正解檔設定
            22.4 反解檔設定
            22.5 最後的設定
            <a href="http://www.bigchina.com.cn/ebook/1/ch23.asp">第二十三章 指令應用</a>
            23.1 基本 UNIX 指令
            23.1.1 概論
            23.1.2 man
            23.1.3 ls
            23.1.4 cd
            23.1.5 pwd
            23.1.6 cat
            23.1.7 more
            23.1.8 less
            23.1.9 head
            23.1.10 tail
            23.1.11 w
            23.1.12 who
            23.1.13 date
            23.1.14 cal
            23.1.15 echo
            23.1.16 clear
            23.2 系統管理
            23.2.1 ps
            23.2.2 kill
            23.2.3 top
            23.2.4 systat
            23.2.5 watch
            23.2.6 alias
            23.2.7 bg
            23.2.8 jobs
            23.2.9 fg
            23.2.10 ntpdate
            23.2.11 sync
            23.2.12 shutdown
            23.2.13 reboot
            23.2.14 su
            23.2.15 exit
            23.2.16 dmesg
            23.2.17 lastcomm
            23.2.18 crontab
            23.2.19 uptime
            23.2.20 sysctl
            23.3 使用者管理
            23.3.1 vipw
            23.3.2 groups
            23.3.3 adduser
            23.3.4 pwd_mkdb
            23.3.5 rmuser
            23.3.6 passwd
            23.3.7 chpass
            23.3.8 mesg
            23.3.9 write
            23.3.10 last
            23.4 檔案系統管理
            23.4.1 touch
            23.4.2 cp
            23.4.3 ln
            23.4.4 mkdir
            23.4.5 rm
            23.4.6 mv
            23.4.7 df
            23.4.8 du
            23.4.9 chmod
            23.4.10 chown
            23.4.11 chflags
            23.4.12 umask
            23.4.13 diff
            23.4.14 wc
            23.4.15 whereis
            23.4.16 which
            23.4.17 find
            23.4.18 grep
            23.4.19 tar
            23.4.20 fsck
            23.4.21 mount
            23.4.22 umount
            23.5 網路相關指令
            23.5.1 ping
            23.5.2 ifconfig
            23.5.3 arp
            23.5.4 traceroute
            23.5.5 netstat
            23.5.6 sockstat
            23.5.7 mail
            23.5.8 telnnet
            23.5.9 ssh
            23.5.10 ftp
            23.5.11 nslookup
            23.5.12 dig
            23.5.13 tcpdump
            <a href="http://www.bigchina.com.cn/ebook/1/ch24.asp">第二十四章 Shell Script</a>
            24.1 概論
            24.2 變數的使用
            24.2.1 變數的使用
            24.2.2 程式會自動定義的變數
            24.2.3 系統內定的標準變數
            24.2.4 空變數的處理
            24.3 運算符號
            24.3.1 四則運算
            24.3.2 簡單的條件判斷
            24.3.3 以 test 來比較字串及數字
            24.3.4 以 test 來處理檔案
            24.4 內建指令
            24.5 流程控制
            24.5.1 if 的條件判斷
            24.5.2 while 及 until 迴圈
            24.5.3 for 迴圈
            24.5.4 case 判斷
            24.6 函式的運用
            <a href="http://www.bigchina.com.cn/ebook/1/cha1.asp">附錄 A /etc 目錄下的檔案介紹</a>
            A.1 aliases：設定郵件收件者別名
            A.2 crontab：設定定時執行工作
            A.3 csh.cshrc：Tcsh 使用者登入後的 shell 環境設定
            A.4 csh.login：Tcsh 使用者登入後的 shell 環境設定
            A.5 csh.logout：Tcsh 使用者登出時會執行的設定
            A.6 defaults/periodic.conf：預設定時執行項目設定
            A.7 defaults/rc.conf：預設的系統設定檔
            A.8 fbtab：設定使用者登入時對系統裝置的存取權限
            A.9 fstab：檔案系統的載入設定
            A.10 ftpusers：設定哪些使用者不可以使用 FTP 登入
            A.11 ftpchroot：設定哪些使用者登入後要限制根目錄
            A.12 gettytab：終端機模式設定檔
            A.13 group：使用者群組設定檔
            A.14 host.conf：設定 DNS 查詢順序
            A.15 hosts：定義常用的機器名稱對映
            A.16 hosts.allow：設定允許或拒絕連線的主機
            A.17 hosts.equiv：設定遠端信任主機及使用者
            A.18 hosts.lpd：設定可以使用本地列表機的主機
            A.19 inetd.conf：各項 inetd 服務設定檔
            A.20 localtime：記錄所在時區設定
            A.21 locate.rc：快速搜尋檔案的名稱資料庫設定
            A.22 login.access：控制使用者登入權限
            A.23 login.conf：控制使用者可以使用的系統資源
            A.24 mail.rc：設定 mail 指令參數
            A.25 make.conf：設定 make 的參數
            A.26 manpath.config：設定 man 文件所在位置
            A.27 master.passwd：使用者密碼檔
            A.28 motd：使用者登入後訊息
            A.29 namedb/：DNS 伺服器設定檔
            A.30 netstart：啟動網路服務的程式
            A.31 networks：設定本地網路資訊
            A.32 newsyslog.conf：設定定期壓縮備份檔案
            A.33 nsmb.conf：設定 smbfs 資訊
            A.34 nsswitch.conf：設定 nsswich 資訊
            A.35 opiekeys：OPIE 設定檔
            A.36 pam.d：PAM 設定檔
            A.37 passwd：不含密碼的使用者資訊檔
            A.38 pccard_ether：啟用及停用 PCCARD 網路設備
            A.39 periodic/daily：包含每天會定時執行的工作
            A.40 periodic/weekly：包含每週會定時執行的工作
            A.41 periodic/monthly：包含每月會定時執行的工作
            A.42 periodic/security：包含每天會執行的安全檢查工作
            A.43 phones：遠端主機電話資料庫
            A.44 ppp/：PPP 相關設定檔
            A.45 printcap：列表機設定檔
            A.46 profile：Shell 設定檔
            A.47 rc：開機時會執行的檔案
            A.48 rc.d：所有開機時可能執行的服務
            A.49 rc.firewall：防火牆設定檔
            A.50 rc.local：使用者自行設定開機要執行的工作
            A.51 rc.*：其它開機時的相關執行檔
            A.52 resolv.conf：DNS 主機及網域設定
            A.53 services：定義網路服務的埠號
            A.54 shells：定義合法的 shell
            A.55 ssh：SSH 相關設定及金鑰
            A.56 sysctl.conf：開機時會執行的 sysctl 內容
            A.57 syslog.conf：定義系統記錄檔位置及規則
            A.58 ttys：各種終端機權限設定
            <a href="http://www.bigchina.com.cn/ebook/1/cha2.asp">附錄B 製作 FreeBSD 安裝光碟</a>
            B.1 燒錄 RELEASE 版安裝光碟
            B.2 燒錄 STABLE 版安裝光碟
            <a href="http://www.bigchina.com.cn/ebook/1/cha3.asp">附錄C 版權宣告</a>
            C.1 The FreeBSD Copyright
            C.2 The 4.4 BSD Copyright
            C.3 GNU GENERAL PUBLIC LICENSE
            C.4 GNU LIBRARY GENERAL PUBLIC LICENSE
            </pre>
            </pre>
            </td>
        </tr>
    </tbody>
</table>]]></summary>
	  <link rel="alternate" type="text/html" href="http://blog.bigchina.com.cn/default.asp?id=46" /> 
	  <id>http://blog.bigchina.com.cn/default.asp?id=46</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[附錄C 版權宣告]]></title>
	  <author>
		 <name>admin</name>
		 <uri>http://blog.bigchina.com.cn/</uri>
		 <email>sky@bigchina.com.cn</email>
	  </author>
	  <category term="" scheme="http://blog.bigchina.com.cn/default.asp?cateID=14" label="freebsd" /> 
	  <updated>2008-02-23T16:50:13+08:00</updated>
	  <published>2008-02-23T16:50:13+08:00</published>
		  <summary type="html"><![CDATA[<p><tt class="chtitle1">附錄C 版權宣告</tt></p>
<p><tt class="chtitle2">C.1 The FreeBSD Copyright</tt></p>
<p>Copyright 1994-2002 FreeBSD, Inc. All rights reserved.</p>
<p>Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:</p>
<ol>
    <li>Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. </li>
    <li>Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. </li>
</ol>
<p>THIS SOFTWARE IS PROVIDED BY THE FREEBSD PROJECT ``AS IS'' AND ANY EXPRESS or IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FREEBSD PROJECT or CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, or CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS or SERVICES; LOSS OF USE, DATA, or PROFITS; or BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, or TORT (INCLUDING NEGLIGENCE or OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p>
<p>The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project or FreeBSD, Inc.</p>
<p><tt class="chtitle2">C.2 The 4.4 BSD Copyright</tt></p>
<p>All of the documentation and software included in the 4.4BSD and 4.4BSD-Lite Releases is copyrighted by The Regents of the University of California.</p>
<p>Copyright 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved.</p>
<p>Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:</p>
<ol>
    <li>Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. </li>
    <li>Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. </li>
    <li>All advertising materials mentioning features or use of this software must display the following acknowledgement: <br />This product includes software developed by the University of California, Berkeley and its contributors. </li>
    <li>Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. </li>
</ol>
<p>THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS or IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS or CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, or CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS or SERVICES; LOSS OF USE, DATA, or PROFITS; or BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, or TORT (INCLUDING NEGLIGENCE or OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p>
<p>The Institute of Electrical and Electronics Engineers and the American National Standards Committee X3, on Information Processing Systems have given us permission to reprint portions of their documentation.</p>
<p>In the following statement, the phrase ``this text'' refers to portions of the system documentation.</p>
<p>Portions of this text are reprinted and reproduced in electronic form in the second BSD Networking Software Release, from IEEE Std 1003.1-1988, IEEE Standard Portable Operating System Interface for Computer Environments (POSIX), copyright C 1988 by the Institute of Electrical and Electronics Engineers, Inc. In the event of any discrepancy between these versions and the original IEEE Standard, the original IEEE Standard is the referee document.</p>
<p>In the following statement, the phrase ``This material'' refers to portions of the system documentation.</p>
<p>This material is reproduced with permission from American National Standards Committee X3, on Information Processing Systems. Computer and Business Equipment Manufacturers Association (CBEMA), 311 First St., NW, Suite 500, Washington, DC 20001-2178. The developmental work of Programming Language C was completed by the X3J11 Technical Committee.</p>
<p>The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the Regents of the University of California.</p>
<p><tt class="chtitle2">C.3 GNU GENERAL PUBLIC LICENSE</tt></p>
<p align="center">Version 2, June 1991</p>
<p align="center">Copyright (C) 1989, 1991 Free Software Foundation, Inc.<br />59 Temple Place - Suite 330, Boston, MA 02111-1307, USA</p>
<p align="center">Everyone is permitted to copy and distribute verbatim copies<br />of this license document, but changing it is not allowed.</p>
<p align="center"><b>Preamble</b></p>
<p>The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too.</p>
<p>When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.</p>
<p>To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. </p>
<p>For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. </p>
<p>We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. </p>
<p>Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. </p>
<p>Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.</p>
<p>The precise terms and conditions for copying, distribution and modification follow. </p>
<p align="center"><b>TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</b></p>
<p>0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The &quot;Program&quot;, below, refers to any such program or work, and a &quot;work based on the Program&quot; means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term &quot;modification&quot;.) Each licensee is addressed as &quot;you&quot;.</p>
<p>Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.</p>
<p>1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. </p>
<p>You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. </p>
<p>2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: </p>
<p>a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. </p>
<p>b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. </p>
<p>c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) </p>
<p>These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. </p>
<p>Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. </p>
<p>In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. </p>
<p>3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: </p>
<p>a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, </p>
<p>b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, </p>
<p>c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) </p>
<p>The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. </p>
<p>If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. </p>
<p>4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. </p>
<p>5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. </p>
<p>6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. </p>
<p>7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. </p>
<p>If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. </p>
<p>It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. </p>
<p>This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. </p>
<p>8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. </p>
<p>9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. </p>
<p>Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and &quot;any later version&quot;, you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. </p>
<p>10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. </p>
<p align="center"><b>NO WARRANTY</b></p>
<p>11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM &quot;AS IS&quot; WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED or IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR or CORRECTION.</p>
<p>12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW or AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, or ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL or CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE or INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA or DATA BEING RENDERED INACCURATE or LOSSES SUSTAINED BY YOU or THIRD PARTIES or A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER or OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.</p>
<p align="center"><b>END OF TERMS AND CONDITIONS</b></p>
<p align="center"><b>How to Apply These Terms to Your New Programs</b></p>
<p>If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. </p>
<p>To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the &quot;copyright&quot; line and a pointer to where the full notice is found. </p>
<blockquote>
<p><i>one line to give the program's name and an idea of what it does.<br />Copyright (C) yyyy name of author</i></p>
<p><i>This program is free software; you can redistribute it and/or<br />modify it under the terms of the GNU General Public License<br />as published by the Free Software Foundation; either version 2<br />of the License, or (at your option) any later version.<br /><br />This program is distributed in the hope that it will be useful,<br />but WITHOUT ANY WARRANTY; without even the implied warranty of<br />MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br />GNU General Public License for more details.<br /><br />You should have received a copy of the GNU General Public License<br />along with this program; if not, write to the Free Software<br />Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.</i></p>
</blockquote>
<p>Also add information on how to contact you by electronic and paper mail. </p>
<p>If the program is interactive, make it output a short notice like this when it starts in an interactive mode: </p>
<blockquote>
<p><i>Gnomovision version 69, Copyright (C) year name of author<br />Gnomovision comes with ABSOLUTELY NO WARRANTY; for details<br />type `show w'. This is free software, and you are welcome<br />to redistribute it under certain conditions; type `show c' <br />for details.</i></p>
</blockquote>
<p>The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. </p>
<p>You should also get your employer (if you work as a programmer) or your school, if any, to sign a &quot;copyright disclaimer&quot; for the program, if necessary. Here is a sample; alter the names: </p>
<blockquote>
<p><i>Yoyodyne, Inc., hereby disclaims all copyright<br />interest in the program `Gnomovision'<br />(which makes passes at compilers) written <br />by James Hacker.</i></p>
<p><i>signature of Ty Coon, 1 April 1989<br />Ty Coon, President of Vice</i></p>
</blockquote>
<p><tt class="chtitle2">C.4 GNU LIBRARY GENERAL PUBLIC LICENSE</tt></p>
<p align="center">Version 2, June 1991</p>
<p align="center">Copyright (C) 1991 Free Software Foundation, Inc.<br />59 Temple Place - Suite 330, Boston, MA 02111-1307, USA<br />Everyone is permitted to copy and distribute verbatim copies<br />of this license document, but changing it is not allowed.</p>
<p align="center">[This is the first released version of the library GPL. It is<br />numbered 2 because it goes with version 2 of the ordinary GPL.]</p>
<p align="center"><b>Preamble</b></p>
<p>he licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. </p>
<p>This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. </p>
<p>When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.</p>
<p>To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it.</p>
<p>For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights.</p>
<p>Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library.</p>
<p>Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations.</p>
<p>Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.</p>
<p>Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license.</p>
<p>The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such.</p>
<p>Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better.</p>
<p>However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries.</p>
<p>The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a &quot;work based on the library&quot; and a &quot;work that uses the library&quot;. The former contains code derived from the library, while the latter only works together with the library.</p>
<p>Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one.</p>
<p align="center"><b>TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</b></p>
<p>0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called &quot;this License&quot;). Each licensee is addressed as &quot;you&quot;.</p>
<p>A &quot;library&quot; means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables.</p>
<p>The &quot;Library&quot;, below, refers to any such software library or work which has been distributed under these terms. A &quot;work based on the Library&quot; means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term &quot;modification&quot;.)</p>
<p>&quot;Source code&quot; for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library.</p>
<p>Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does.</p>
<p>1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library.</p>
<p>You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.</p>
<p>2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:</p>
<p>a) The modified work must itself be a software library.</p>
<p>b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change.</p>
<p>c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License.</p>
<p>d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.)</p>
<p>These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.</p>
<p>Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library.</p>
<p>In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.</p>
<p>3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices.</p>
<p>Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy.</p>
<p>This option is useful when you wish to copy part of the code of the Library into a program that is not a library.</p>
<p>4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange.</p>
<p>If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code.</p>
<p>5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a &quot;work that uses the Library&quot;. Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.</p>
<p>However, linking a &quot;work that uses the Library&quot; with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a &quot;work that uses the library&quot;. The executable is therefore covered by this License. Section 6 states terms for distribution of such executables.</p>
<p>When a &quot;work that uses the Library&quot; uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law.</p>
<p>If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.)</p>
<p>Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. </p>
<p>6. As an exception to the Sections above, you may also compile or link a &quot;work that uses the Library&quot; with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications.</p>
<p>You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: </p>
<p>a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable &quot;work that uses the Library&quot;, as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) </p>
<p>b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution.</p>
<p>c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place.</p>
<p>d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. <br />For an executable, the required form of the &quot;work that uses the Library&quot; must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. </p>
<p>It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. </p>
<p>7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: </p>
<p>a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. </p>
<p>b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. <br />8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.</p>
<p>9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. </p>
<p>10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.</p>
<p>11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. </p>
<p>If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. </p>
<p>It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.</p>
<p>This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. </p>
<p>12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. </p>
<p>13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. </p>
<p>Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and &quot;any later version&quot;, you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. </p>
<p>14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. </p>
<p align="center"><b>NO WARRANTY</b></p>
<p>15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY &quot;AS IS&quot; WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED or IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR or CORRECTION. </p>
<p>16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW or AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, or ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL or CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE or INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA or DATA BEING RENDERED INACCURATE or LOSSES SUSTAINED BY YOU or THIRD PARTIES or A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER or OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. </p>
<p align="center"><b>END OF TERMS AND CONDITIONS</b></p>
<p align="center"><b>How to Apply These Terms to Your New Libraries</b></p>
<p>If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). </p>
<p>To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the &quot;copyright&quot; line and a pointer to where the full notice is found. </p>
<blockquote>
<p>o<i>ne line to give the library's name and an idea of what it does.<br />Copyright (C) year name of author<br /><br />This library is free software; you can redistribute it and/or<br />modify it under the terms of the GNU Library General Public<br />License as published by the Free Software Foundation; either<br />version 2 of the License, or (at your option) any later version.<br /><br />This library is distributed in the hope that it will be useful,<br />but WITHOUT ANY WARRANTY; without even the implied warranty of<br />MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU<br />Library General Public License for more details.<br /><br />You should have received a copy of the GNU Library General Public<br />License along with this library; if not, write to the<br />Free Software Foundation, Inc., 59 Temple Place - Suite 330,<br />Boston, MA 02111-1307, USA.</i></p>
</blockquote>
<p>Also add information on how to contact you by electronic and paper mail. </p>
<p>You should also get your employer (if you work as a programmer) or your school, if any, to sign a &quot;copyright disclaimer&quot; for the library, if necessary. Here is a sample; alter the names: </p>
<blockquote>
<p><i>Yoyodyne, Inc., hereby disclaims all copyright interest in<br />the library `Frob' (a library for tweaking knobs) written<br />by James Random Hacker.<br /><br />signature of Ty Coon, 1 April 1990<br />Ty Coon, President of Vice</i></p>
</blockquote>
<p>That's all there is to it! <br /></p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://blog.bigchina.com.cn/default.asp?id=45" /> 
	  <id>http://blog.bigchina.com.cn/default.asp?id=45</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[附錄B 製作 FreeBSD 安裝光碟]]></title>
	  <author>
		 <name>admin</name>
		 <uri>http://blog.bigchina.com.cn/</uri>
		 <email>sky@bigchina.com.cn</email>
	  </author>
	  <category term="" scheme="http://blog.bigchina.com.cn/default.asp?cateID=14" label="freebsd" /> 
	  <updated>2008-02-23T16:49:21+08:00</updated>
	  <published>2008-02-23T16:49:21+08:00</published>
		  <summary type="html"><![CDATA[<p><tt class="chtitle1">附錄B 製作 FreeBSD 安裝光碟</tt></p>
<p>如果您想要自行製作 FreeBSD 安裝光碟，您可以自各大 FTP 站台下載 FreeBSD 回來自行燒錄。FreeBSD 各個 RELEASE 版本推出時，都會將光碟的 ISO 檔釋出，如果您要燒錄 RELEASE 版的開機光碟，必須自 ftp 站台下載 ISO 檔。如果您所要燒錄的版本是 STABLE 版，通常都沒有 ISO 檔可以下載，我們必須自行選擇所要燒錄的檔案回來燒錄。在這裡我們就分別針對 RELEASE 及 STABLE 版本的光碟燒錄來加以說明。我們使用的燒錄軟體是 NERO，您可以自 http://www.nero.com 下載試用版本。</p>
<p><tt class="chtitle2">B.1 燒錄 RELEASE 版安裝光碟</tt></p>
<p>首先，請到離您最近的 FTP 站台下載所需的 ISO 檔，以 FreeBSD 5.2.1-RELEASE 為例，我們以 FTP 軟體至 ftp://freebsd.csie.nctu.edu.tw/pub/ISO-IMAGES-i386/5.2.1/ 目錄下，您可以看到以下幾個檔案：</p>
<table id="AutoNumber1" style="BORDER-COLLAPSE: collapse" bordercolor="#111111" cellspacing="0" cellpadding="0" width="600" border="1">
    <tbody>
        <tr>
            <td width="155"><b>檔案</b></td>
            <td width="426"><b>說明</b></td>
        </tr>
        <tr>
            <td width="155">5.2.1-disc1.iso</td>
            <td width="426">FreeBSD 安裝光碟，包含常用的 packages。</td>
        </tr>
        <tr>
            <td width="155">5.2.1-mini.iso</td>
            <td width="426">FreeBSD 安裝光碟，只有安裝必備檔，不含常用的 packages。</td>
        </tr>
        <tr>
            <td width="155">5.2.1-disc2.iso</td>
            <td width="426">修復光碟，可以開機並可自光碟執行系統指令。</td>
        </tr>
        <tr>
            <td width="155">5.2.1-disc3.iso</td>
            <td width="426">包含更多的 package 軟體。</td>
        </tr>
        <tr>
            <td width="155">5.2.1-disc4.iso</td>
            <td width="426">包含更多的 package 軟體。</td>
        </tr>
        <tr>
            <td width="155">CHECKSUM.MD5</td>
            <td width="426">各個 ISO 檔的 MD5 檢查結果。</td>
        </tr>
    </tbody>
</table>
<p>我們選擇第一個 INSTALL 光碟下載後，將檔名改成 5.2.1-disc1.nrg 後，請依下列步驟進行燒錄：</p>
<p>步驟一：進入 NERO 後，使用 [File]-&gt;[Open] 開啟檔案</p>
<p>圖 B-1</p>
<p><img height="460" src="http://www.bigchina.com.cn/ebook/1/images/b_01.png" width="568" border="0" alt="" /></p>
<p>步驟二：選擇檔案類型為 CD-Image(*.nrg)，並選取檔案。</p>
<p>圖 B-2</p>
<p><img height="536" src="http://www.bigchina.com.cn/ebook/1/images/b_02.png" width="768" border="0" alt="" /></p>
<p>接著將出現下列畫面，直接選 OK 即可：</p>
<p>圖 b-3</p>
<p><img height="288" src="http://www.bigchina.com.cn/ebook/1/images/b_03.png" width="294" border="0" alt="" /></p>
<p>步驟三：進入燒錄。我們點選 Finalize 將 CD 終結，並選 Write 進行燒錄，如此便可以燒錄出一片具光碟開機能力的 FreeBSD 光碟。</p>
<p>圖 B-4</p>
<p><img height="348" src="http://www.bigchina.com.cn/ebook/1/images/b_04.png" width="613" border="0" alt="" /></p>
<p><tt class="chtitle2">B.2 燒錄 STABLE 版安裝光碟</tt></p>
<p>由於 STABLE 版並沒有 ISO 檔可以下載，因此我們必須自行選擇要下載的檔案。我們以燒錄 4.9-STABLE-20031202-JPSNAP 版為例，請以 FTP 軟體連接到 ftp://freebsd.csie.nctu.edu.tw/pub/FreeBSD/snapshots/4.9-STABLE-20031202-JPSNAP 目錄下，我們要選取除了下列二個目錄外的所有檔案：</p>
<table id="AutoNumber2" style="BORDER-COLLAPSE: collapse" bordercolor="#111111" cellspacing="0" cellpadding="0" width="600" border="1">
    <tbody>
        <tr>
            <td width="196"><b>目錄</b></td>
            <td width="385"><b>說明</b></td>
        </tr>
        <tr>
            <td valign="top" width="196">4.9-STABLE-20031202-JPSNAP</td>
            <td width="385">如果選了這個目錄，將一直重覆的下載所有目錄。</td>
        </tr>
        <tr>
            <td valign="top" width="196">packages</td>
            <td width="385">由於 packages 目錄鏈結到其他目錄下，而且檔案很多，無法完全裝入光碟中。</td>
        </tr>
    </tbody>
</table>
<p>圖 B-5</p>
<p><img height="656" src="http://www.bigchina.com.cn/ebook/1/images/b_05.png" width="837" border="0" alt="" /></p>
<p>下載完成後，就可以使用下例步驟來燒錄了：</p>
<p>步驟一：打開 NERO，選擇燒錄可開機光碟，如下圖：</p>
<p>圖 B-6</p>
<p><img height="348" src="http://www.bigchina.com.cn/ebook/1/images/b_06.png" width="619" border="0" alt="" /></p>
<p>接著選取開機映象檔所在，請先選 Image file，再按 Browse去下載完後 STABLE 版的 floppies目錄中，選取 boot.flp 這個檔來當開機檔：</p>
<p>圖 B-7</p>
<p><img height="248" src="http://www.bigchina.com.cn/ebook/1/images/b_07.png" width="463" border="0" alt="" /></p>
<p>接著選取 &quot;Enable expert settings&quot;，再將 &quot;Kind of emulation&quot; 設為 2.88MB。然後就可以按 NEW 來加入要燒錄的檔案。<br />步驟二：我們將該來下載的所有檔案加入燒錄清單後，就可以執行寫入了。</p>
<p>圖 B-8</p>
<p><img height="495" src="http://www.bigchina.com.cn/ebook/1/images/b_08.png" width="647" border="0" alt="" /></p>
<p>步驟三：寫入 CD。在上圖中執行 &quot;Write CD&quot; 後，將出現下列畫面，我們直接選取 &quot;Write&quot; 即可進入燒錄。如此便完成 STABLE 版安裝光碟的製作了。</p>
<p>圖 B-9</p>
<p><img height="348" src="http://www.bigchina.com.cn/ebook/1/images/b_09.png" width="619" border="0" alt="" /></p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://blog.bigchina.com.cn/default.asp?id=44" /> 
	  <id>http://blog.bigchina.com.cn/default.asp?id=44</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[附錄 A /etc 目錄下的檔案介紹]]></title>
	  <author>
		 <name>admin</name>
		 <uri>http://blog.bigchina.com.cn/</uri>
		 <email>sky@bigchina.com.cn</email>
	  </author>
	  <category term="" scheme="http://blog.bigchina.com.cn/default.asp?cateID=14" label="freebsd" /> 
	  <updated>2008-02-23T16:48:43+08:00</updated>
	  <published>2008-02-23T16:48:43+08:00</published>
		  <summary type="html"><![CDATA[<p><tt class="chtitle1">附錄 A /etc 目錄下的檔案介紹</tt></p>
<p><tt class="filename">/etc</tt> 是 FreeBSD 系統主要設定檔所在，了解這個目錄下的檔案及其格式，對於我們管理及使用 FreeBSD 將有更深入的認識。因此，以下我們就分別說明一下這些檔案。</p>
<p>一個個讀這些設定檔的說明也許有點枯燥，因此，我們將這個章節放在附錄中，您可以在有需要時再來參考即可。</p>
<p><tt class="chtitle2">A.1 aliases：設定郵件收件者別名</tt></p>
<p><tt class="filename">/etc/aliases</tt> 是用以告知 sendmail 要將信轉給哪個使用者或是交由哪個程式處理。請注意，修改完這個檔案後，必須使用指令 <tt class="userinput">newaliases</tt> 來讓所做的修改在 sendmail 中發生作用。這個檔案是用來設定郵件的別名，也就是可以設定要將某人的信件轉給其他地方(人員或程式)。你也可以將某人的信轉給很多人，這個檔案的位置是由 <tt class="filename">sendmail.cf</tt> 檔案中的 AliasFile 這個選項所決定的。當 sendmail 收到信時，會一行一行比對，當第一行符合後，就不會再繼續下去，所以應注意優先順序。</p>
<p>本檔案的語法開頭的 &quot;#&quot; 代表該行是註解，大小寫都視為一樣。以下為幾個設定的範例：</p>
<ol>
    <li>root: alex </li>
    <li>webmanager: alex,jack,jim@other.hostname.com </li>
    <li>nobody: /dev/null </li>
    <li>homework: |/usr/local/bin/homework.sh </li>
    <li>olduser: :include: /usr/local/olduser_list </li>
</ol>
<ul>
    <li>範例 1 是將寄給 root 的信轉給本機中的使用者 alex。 </li>
    <li>範例 2 是將寄給 webmanager 的信轉給本地的使用者 alex,jack及別地的 jim@other.hostname.com。 </li>
    <li>範例 3 是將寄給 nobody 的信直接丟掉，丟入 /dev/null 這個無底深淵，也就是所有給 nobody 的信都直接刪除。 </li>
    <li>範例 4 是將寄給 homework 的信交給 /usr/local/bin/homework.sh 這支程式處理。 </li>
    <li>範例 5 是將寄給 olduser 的信轉給檔案 /usr/local/olduser_list中所列出的所有使用者。olduser_list 為使用者清單的文字檔。 </li>
</ul>
<p>當設定了一堆複雜的別名之後，我們要看最後信會寄到哪裡時，可以使用下面指令來看寄給 username 的信最後寄給誰：</p>
<pre class="screen"><tt class="prompt">#</tt> <tt class="userinput">sendmail -bv username</tt></pre>
<p><tt class="filename">aliases</tt> 檔中將很多東西都轉向 root，因此你可以去讀 root 的信箱或是將 root 的信轉給別的地方，下面這一行是將 root 的信都轉給 my@my.domain：</p>
<table width="600" border="1">
    <tbody>
        <tr>
            <td width="100%">
            <pre class="screen">root:	me@my.domain</pre>
            </td>
        </tr>
    </tbody>
</table>
<p>當郵件無法送出被退回時給使用者時，都是以 MAILER-DEAMON 為帳號寄出。因為使用者可能會回覆那封被退回的信，所以這個別名是必備的。而 postmaster 則負責處理所有關於郵件問題的信件，因此也是必備的，一定要保留下面二行，這是必要的系統基本設定：</p>
<table width="600" border="1">
    <tbody>
        <tr>
            <td width="100%">
            <pre class="screen">MAILER-DAEMON: postmaster
            postmaster: root</pre>
            </td>
        </tr>
    </tbody>
</table>
<p>在修改完 <tt class="filename">/etc/aliases</tt> 之後，我們必須執行下列指令來更新資料：</p>
<pre class="screen"><tt class="prompt">#</tt> <tt class="userinput">newaliases</tt></pre>
<p><tt class="chtitle2">A.2 crontab：設定定時執行工作</tt></p>
<p>在 UNIX 系統中，有一個背景程式會定時執行一些工作，系統管理者可以修改這個檔案以設定定期執行的工作。<tt class="filename">/etc/crontab</tt> 可以讓管理者設定要以什麼使用者的身份去執行定時工作，而一般使用者如果要設定定時執行工作時，可以使用指令 <tt class="userinput">crontab -e</tt> 來編輯自己的定時執行工作。</p>
<p>以下為 <tt class="filename">/etc/crontab </tt>的內容說明：</p>
<table width="600" border="1">
    <tbody>
        <tr>
            <td width="100%">
            <pre class="screen"># 設定使用的 shell, 路徑
            SHELL=/bin/sh
            PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
            # 設定執行指令時的目錄
            HOME=/var/log
            # 當指令有輸出資料時，要將輸出的東西寄給誰。
            MAILTO=&quot;&quot;
            #
            # 分	小時	天	月	星期幾	身份	指令
            #minute	hour	mday	month	wday	who	command
            #
            */5	*	*	*	*	root	/usr/libexec/atrun</pre>
            </td>
        </tr>
    </tbody>
</table>
<ul>
    <li>minute：代表一小時內的第幾分，範圍 0-59。 </li>
    <li>hour：代表一天中的第幾小時，範圍 0-23。 </li>
    <li>mday：代表一個月中的第幾天，範圍 1-31。 </li>
    <li>month：代表一年中第幾個月，範圍 1-12。 </li>
    <li>wday：代表星期幾，範圍 0-7 (0及7都是星期天)。 </li>
    <li>who：要使用什麼身份執行該指令，當您使用 crontab -e 時，不必加此欄位。 </li>
    <li>command：所要執行的指令。 </li>
</ul>
<p>小時的欄位中如果是 *，表示每小時，天的欄位中如果是 *，表示每天，依此類推。欄位中也可以使用 &quot;-&quot; 來表示範圍。例如，在小時的欄位中填 8-11，表示執行的時間是 8,9,10,11，共四次。</p>
<p>欄位中也可以用逗點來表示，以分的欄位而言， 1,2,5,9 表示將在 1,2,5,9 分時各執行一次。我們也可以寫成像這樣 1-2,12-14 ，表示在 1,2,12,13,14 分各執行一次。</p>
<p>另外，也可以用 / 後面加數字表示每幾分鐘要執行一次。如在分的欄位填 0-23/2，表示 1-22 分之間，每隔二分鐘執行一次，也就是 0,2,4,6,8,10,12,14,16,18,20,22。如果在分的欄位是 */5，表示每五分鐘一次。</p>
<p>除此之外，也可以用一個開頭為 @ 的字串來表示各種意義：</p>
<table width="529" border="1">
    <tbody>
        <tr>
            <td width="107"><b>字串</b></td>
            <td width="403"><b>代表意義</b></td>
        </tr>
        <tr>
            <td width="107">@reboot</td>
            <td width="403">開機時跑一次。</td>
        </tr>
        <tr>
            <td width="107">@yearly</td>
            <td width="403">每年跑一次，等於 &quot;0 0 1 1 *&quot;。</td>
        </tr>
        <tr>
            <td width="107">@annually</td>
            <td width="403">和 @yearly 一樣。</td>
        </tr>
        <tr>
            <td width="107">@monthly</td>
            <td width="403">每月跑一次，等於 &quot;0 0 1 * *&quot;，也就是每月一日半夜 12 點執行。</td>
        </tr>
        <tr>
            <td width="107">@weekly</td>
            <td width="403">每週跑一次，等於 &quot;0 0 * * 0&quot;，也就是每個週日半夜 12 點執行。</td>
        </tr>
        <tr>
            <td width="107">@daily</td>
            <td width="403">每天跑一次，等於 &quot;0 0 * * *&quot;，也就是每天半夜 12 點執行。</td>
        </tr>
        <tr>
            <td width="107">@midnight</td>
            <td width="403">和 @daily 一樣。</td>
        </tr>
        <tr>
            <td width="107">@hourly</td>
            <td width="403">每小時跑一次，等於 &quot;0 * * * *&quot;。</td>
        </tr>
    </tbody>
</table>
<p>另外，我們還可以在檔案中以「key = value」的方式設定在執行指令時的環境變數。例如，一般指令有輸出執行結果時，會自動寄給 root，我們也可以設定「MAILTO = &quot;&quot;」表示不要將輸出結果寄出。以下為幾個時間設定的範例：</p>
<table width="600" border="1">
    <tbody>
        <tr>
            <td width="100%">
            <pre class="screen"># 分	小時	天	月	星期幾	身份	指令
            #minute	hour	mday	month	wday	who	command
            #
            # 設定每 5 分鐘執行一次atrun。
            */5	*	*	*	*	root	/usr/libexec/atrun
            # 設定每天一點零一分時執行 /bin/check
            1	1	*	*	*	root	/bin/check
            # 設定每週一 3:11 分執行 week_check
            11	3	*	*	1	root	/usr/local/week_check
            # 設定每天一點及四點的零到二十三分中間，每二分鐘執行一次 something。
            0-23/2	1,4	*	*	root	/bin/something
            </pre>
            </td>
        </tr>
    </tbody>
</table>
<p>一般使用者的 crontab 會放在 /var/cron/tabs 目錄中，所以如果要備份或升級時，應該要注意這些檔案是否要備份。</p>
<table style="BORDER-COLLAPSE: collapse" bordercolor="#111111" cellspacing="0" cellpadding="0" width="600" border="1">
    <tbody>
        <tr>
            <td>
            <table border="0">
                <tbody>
                    <tr>
                        <td valign="top"><img height="64" src="http://www.bigchina.com.cn/ebook/1/images/note.png" width="64" border="0" alt="" /></td>
                        <td valign="top" width="100%"><tt class="hint">小提示</tt>
                        <p>我們在安排 crontab 時，應該要錯開每個程式的執行時間，才不會有一大堆程式同時執行，造成系統負荷過高。</p>
                        </td>
                    </tr>
                </tbody>
            </table>
            </td>
        </tr>
    </tbody>
</table>
<p><tt class="chtitle2">A.3 csh.cshrc：Tcsh 使用者登入後的 shell 環境設定</tt></p>
<p>這是給 Shell csh、tcsh 用的內定 .cshrc 檔案，也就是進入該 Shell 時會載入的設定。所有使用 csh 及 tcsh 的使用者登入後，系統都會自動載入這個檔案中的設定，若使用者自己的家目錄中的 <tt class="filename">.cshrc</tt> 和 <tt class="filename">csh.cshrc</tt> 有相同的設定，則會以使用者家目錄中的 <tt class="filename">.cshrc</tt> 為主。</p>
<table width="600" border="1">
    <tbody>
        <tr>
            <td width="100%">
            <pre class="screen"># 檔案權限設定
            umask 022
            # 設定內定使用的文字編輯器為 ee
            setenv  EDITOR  ee
            # 設定當使用者打 ls 時，出來的結果是 ls -F 的結果
            alias   ls      ls -F
            # 設定當使用者打 cd.. 時，變成是打 cd ..
            alias cd.. 'cd ..'
            # 設定命令提示符號為 &quot;主機名稱 [所在目錄] -使用者名稱-&gt;&quot;
            set prompt = &quot;%B%m [%/] -%n-&gt; &quot;
            </pre>
            </td>
        </tr>
    </tbody>
</table>
<p>這個檔案除了使用者登入時會載入外，如果使用者以 tcsh 或 csh 寫 shell scripts，在執行時也會載入這個檔案中的設定。</p>
<p><tt class="chtitle2">A.4 csh.login：Tcsh 使用者登入後的 shell 環境設定</tt></p>
<p>這是給 csh、tcsh 用的內定 .login 檔案，使用者登入 shell 時會自動載入本檔中的設定。和 csh.cshrc 不同的時，這個檔案只有在使用者登入時才會載入，而執行 shell scripts 時不會使用這個檔。如果使用者家目錄中的 <tt class="filename">.login</tt> 設定和 <tt class="filename">csh.login</tt> 相衝突時，將以使用者家目錄中的 <tt class="filename">.login</tt> 設定為主。</p>
<table width="600" border="1">
    <tbody>
        <tr>
            <td width="100%">
            <pre class="screen"># 要讀取系統訊息則將下面一行的 # 拿掉
            # msgs -f
            # 允許終端機訊息，設為 y 才可以使用 write 的指令，
            # 傳送訊息給其他使用者
            # mesg y
            # 設定支援中文的終端機
            setenv ENABLE_STARTUP_LOCALE zh_TW.Big5
            setenv LC_CTYPE is_IS.ISO_8859-1
            setenv LANG zh_TW.Big5
            # 登入時顯示 FreeBSD Tip
            [ -x /usr/games/fortune ] &amp;&amp; /usr/games/fortune freebsd-tips
            </pre>
            </td>
        </tr>
    </tbody>
</table>
<p><tt class="chtitle2">A.5 csh.logout：Tcsh 使用者登出時會執行的設定</tt></p>
<p>這是給 Shell csh、tcsh 用的內定 .login 檔案，也就是離開該 Shell 時會執行這個檔案中的指令。在離開 Shell 時，Shell 會載入 <tt class="filename">/etc/csh.logout</tt> 及 <tt class="filename">~/.logout</tt> 的設定。請 <tt class="userinput">man csh</tt>。</p>
<p><tt class="chtitle2">A.6 defaults/periodic.conf：預設定時執行項目設定</tt></p>
<p>這個檔定義了 <tt class="filename">/etc/periodic</tt> 目錄下哪些程式要定期執行。我們可以新增並編輯 <tt class="filename">/etc/periodic.conf</tt> 或 <tt class="filename">/etc/periodic.conf.local</tt> 來覆蓋這個檔案的設定。您可以 <tt class="userinput">man periodic.conf</tt> 來得到更多的資訊。</p>
<p><tt class="chtitle2">A.7 defaults/rc.conf：預設的系統設定檔</tt></p>
<p>系統開機時會讀取這個設定檔以決定應該執行哪些工作，例如網路設定、該執行哪些系統服務等。 <tt class="filename">/etc/defaults</tt> 目錄下的 <tt class="filename">rc.conf</tt> 中所有設定都是預設值，如果我們要修改，請新增 <tt class="filename">/etc/rc.conf</tt> 來加入你的設定，這樣在日後升級時我們的設定才不會覆蓋。如果 <tt class="filename">/etc/defaults/rc.conf</tt> 中的設定和 <tt class="filename">/etc/rc.conf</tt> 重覆時，會以 <tt class="filename">/etc/rc.conf</tt> 為主。另外，當我們執行 <tt class="userinput">sysinstall</tt> 後所做的設定，也會被寫入 <tt class="filename">/etc/rc.conf</tt> 中。建議您可以讀一下 <tt class="filename">rc.conf</tt> 看看我們有哪些可以設定的項目。</p>
<p>&nbsp;<tt class="filename">rc.conf</tt> 有很多設定，例如網路卡 IP、hostname、firewall、要啟動什麼系統服務等，幾乎所有的系統設定都放在這個檔案中。FreeBSD 在開機時，會讀取 <tt class="filename">/etc/rc.conf</tt> 以決定要不要啟動某些服務，而當我們從 ports 中安裝程式時，通常安裝完後，我們也要設定這個檔才能讓該程式在開機時執行。例如，安裝完 SNMP 時，我們要在 <tt class="filename">/etc/rc.conf</tt> 中加入「snmpd_enable=&quot;YES&quot;」，這樣一來 SNMP 才會在開機時啟動。</p>
<p><tt class="chtitle2">A.8 fbtab：設定使用者登入時對系統裝置的存取權限</tt></p>
<p>fbtab 用來設定使用者登入對於系統裝置的存取權限。大多數的人都是使用虛擬的終端機，我們登入系統時所使用的 tty 是虛擬的終端機 ttyv0、ttyv1 等，FreeBSD 將這些系統裝置視為檔案，放在 <tt class="filename">/dev/ </tt>中。例如，console 就是 <tt class="filename">/dev/console</tt> 這個檔，但該檔的擁有者是 root，而有的應用程式用要求使用 <tt class="filename">/dev/console</tt> 的存取權限，fbtab 這個檔案是用來定義當你從虛擬的終端機登入時，能自動取得某個裝置的權限。詳細說明請 <tt class="userinput">man fbtab</tt>。</p>
<p><tt class="chtitle2">A.9 fstab：檔案系統的載入設定</tt></p>
<p>這個檔案用來定義開機時要掛入的檔案分割區及各分割區的參數設定，例如，要掛入哪一個目錄中、掛入時的參數、備份時是否要備份等。</p>
<table width="600" border="1">
    <tbody>
        <tr>
            <td width="100%">
            <pre class="screen"># 裝置名稱	掛入點	      檔案系統	參數		Dump	Pass#
            /dev/ad0s1b	none		swap	sw		0	0
            /dev/ad0s1a	/		ufs	rw		1	1
            /dev/ad1s1f	/home		ufs	rw		2	2
            /dev/ad0s1e	/usr		ufs	rw		2	2
            /dev/ad1s1e	/var		ufs	rw		2	2
            /dev/acd0c	/cdrom		cd9660	ro,noauto	0	0
            proc		/proc		procfs	rw		0
            </pre>
            </td>
        </tr>
    </tbody>
</table>
<ul>
    <li>Device：裝置名稱，就是要掛入的來源，最常用的是 /dev/ 的檔案，我們說過FreeBSD 將裝置視為檔案，所以這裡填的是 /dev/*。裝置也可以是NFS或是其他的虛擬裝置，如 proc,linpro 等。 </li>
    <li>Mountpoint：掛入點，就是你要將來源掛到什麼地方，其中 swap 沒有掛入點，所以是 none。 </li>
    <li>FStype：檔案系統就是要掛入的類型，必須在 kernel 中有定義。一般 FreeBSD 的檔案是 ufs，硬碟要掛入的設定就是 ufs。如果是 cdrom 就是 cd9660。<br />&nbsp;
    <table width="466" border="1">
        <tbody>
            <tr>
                <td valign="top" width="96"><b>檔案系統格式</b></td>
                <td width="351"><b>說明</b></td>
            </tr>
            <tr>
                <td valign="top" width="96">ufs</td>
                <td width="351">本地的 UNIX 檔案系統。</td>
            </tr>
            <tr>
                <td valign="top" width="122">ext2fs</td>
                <td width="459">Linux EXT2 檔案格式。</td>
            </tr>
            <tr>
                <td valign="top" width="96">msdos</td>
                <td width="351">FAT/FAT32，DOS 相容的檔案系統。</td>
            </tr>
            <tr>
                <td valign="top" width="122">ntfs</td>
                <td width="459">Windows 的 NTFS。</td>
            </tr>
            <tr>
                <td valign="top" width="96">cd9660</td>
                <td width="351">CD-ROM 的檔案系統。</td>
            </tr>
            <tr>
                <td valign="top" width="96">udf</td>
                <td width="351">DVD 資料光碟格式。</td>
            </tr>
            <tr>
                <td valign="top" width="96">nfs</td>
                <td width="351">和 Sun Microsystems 相容的 &quot;Network File System&quot;。</td>
            </tr>
            <tr>
                <td valign="top" width="96">smbfs</td>
                <td width="351">CIFS/SMB 檔案格式，也就是 Windows 的網路芳鄰，請參考 Samba 網路芳鄰一章。</td>
            </tr>
            <tr>
                <td valign="top" width="96">mfs</td>
                <td width="351">本地的 memory-based UNIX 檔案系統。</td>
            </tr>
            <tr>
                <td valign="top" width="96">swap</td>
                <td width="351">用來作 swapping 的檔案系統。</td>
            </tr>
            <tr>
                <td valign="top" width="96">procfs</td>
                <td width="351">用來存取執行程序(process)的檔案系統。</td>
            </tr>
            <tr>
                <td valign="top" width="96">kernfs</td>
                <td width="351">用來存取核心參數(kernel parameter)的檔案系統。</td>
            </tr>
        </tbody>
    </table>
    </li>
    <li>Options：參數依各裝置而有所不同，如果開機時不掛入的話(如 cdrom)，就必須加入參數 noauto。defaults 設定為 rw、dev、exec、auto、nouser、async。可用的參數如下，加上no 則為相反，如 nouser、noauto：<br />&nbsp;
    <table width="400" border="1">
        <tbody>
            <tr>
                <td width="102"><b>參數</b></td>
                <td width="279"><b>說明</b></td>
            </tr>
            <tr>
                <td width="102">rw</td>
                <td width="279">可讀可寫。</td>
            </tr>
            <tr>
                <td width="102">ro</td>
                <td width="279">只可讀不可寫。</td>
            </tr>
            <tr>
                <td width="102">async</td>
                <td width="279">所有資料以非同步方式完成。</td>
            </tr>
            <tr>
                <td width="102">atime</td>
                <td width="279">每次存取動作都更新檔案時間。</td>
            </tr>
            <tr>
                <td width="102">auto</td>
                <td width="279">能被 mount -a 自動掛入系統。</td>
            </tr>
            <tr>
                <td width="102">dev</td>
                <td width="279">解譯檔案系統特性與儲存裝置規格。</td>
            </tr>
            <tr>
                <td width="102">exec</td>
                <td width="279">允許檔案系統中的二進位元檔被執行。</td>
            </tr>
            <tr>
                <td width="102">user</td>
                <td width="279">允許一般user 掛入。</td>
            </tr>
            <tr>
                <td width="102">sync</td>
                <td width="279">所有資料以同步方式完成。</td>
            </tr>
            <tr>
                <td width="102">sw</td>
                <td width="279">swap。</td>
            </tr>
            <tr>
                <td width="102">noauto</td>
                <td width="279">開機時不掛入。</td>
            </tr>
            <tr>
                <td width="102">userquota</td>
                <td width="279">使用者磁碟配額限制 (須 kernel 支援 quota)。</td>
            </tr>
            <tr>
                <td width="102">groupquota</td>
                <td width="279">群組磁碟配額限制 (須 kernel 支援 quota)。</td>
            </tr>
        </tbody>
    </table>
    </li>
    <li>dump：表示使用指令 dump 時要備份的檔案系統，0表示不要,1表示要。 </li>
    <li>pass：這個欄位是給指令 fsck 用的，是檢查的順序。/ 的數字應該是1而其他的檔案系統為2。不需檢查的就是0(如 cdrom,swap 等)。 </li>
</ul>
<p><tt class="chtitle2">A.10 ftpusers：設定哪些使用者不可以使用 FTP 登入</tt></p>
<p>這個檔案用來定義哪些使用者不可以使用 FTP 登入，只要將使用者登入的帳號加入這個檔案中，該使用者就不能使用 FTP 登入系統了。例如，我們要讓使用者 tom 無法使用 FTP 來登入系統，只要在 fupusers 檔案開頭加入該使用者名稱。ftpusers 中也可以加入群組名稱，如果您不希望某個群組的使用者使用 FTP 登入，只要在該檔案中加入 @groupname 即可。開頭為 &quot;@&quot; 表示該行的設定為群組名稱。</p>
<table width="600" border="1">
    <tbody>
        <tr>
            <td width="100%">
            <pre class="screen"># $FreeBSD: src/etc/ftpusers,v 1.6 1999/08/27 23:23:41 peter Exp $
            #
            # list of users disallowed any ftp access.
            # read by ftpd(8).
            @noftp
            tom
            root
            toor
            daemon
            operator
            bin
            tty
            kmem
            games
            news
            man
            bind
            uucp
            xten
            pop
            nobody
            </pre>
            </td>
        </tr>
    </tbody>
</table>
<p><tt class="chtitle2">A.11 ftpchroot：設定哪些使用者登入後要限制根目錄</tt></p>
<p>FreeBSD 內附的 FTP daemon 還有一個重要的功能，就是可以讓使用者登入後，只看得到自己的家目錄。如果在 ftpchroot 這個檔案中有該使用者名稱或以 &quot;@&quot; 為開頭的群組名稱，使用者登入後，根目錄就會是自己的家目錄，而無法切換目錄到非家目錄的其他系統目錄中。我們也可以設定將某個使用者或群組設定登入後只能在某一個固定的目錄中，詳細設定請參考「FTP 伺服器」一章的說明。</p>
<p><tt class="chtitle2">A.12 gettytab：終端機模式設定檔</tt></p>
<p>這個檔案是終端機模式設定檔。在啟動終端機時 (例如，使用者登入系統時)，系統會讀取這個檔案中關於終端機的設定值。例如，我們可以修改這個檔案以設定使用者登入前的提示訊息。以下為該檔案 default 的部份：</p>
<table width="600" border="1">
    <tbody>
        <tr>
            <td width="100%">
            <pre class="screen"># im= 就是別人連上你的機器時會看到的字串，其中 \r\n 表示換行
            # 其中的%s %m %h %t 分別對應到 FreeBSD i386 alexwang.com ttyp0，
            # 如果你不想顯示 FreeBSD ，就把 %s 拿掉。最後一行 if=/etc/issue
            # 就是表如果沒有 issue 這個檔的話，就執行 default。
            default:\
            :cb:ce:ck:lc:fd#1000:im=\r\n%s/%m (%h) (%t)\r\n\r\n:sp#1200:\
            :if=/etc/issue:</pre>
            </td>
        </tr>
    </tbody>
</table>
<p><tt class="chtitle2">A.13 group：使用者群組設定檔</tt></p>
<p>這個檔案記錄了系統中的使用者群組設定。詳細說明請參考「使用者管理」一章。我們要注意的是每一個群組的編號 (gid) 不可以重覆。另外，在 FreeBSD 中，如果使用者要具有 su 成 root 的權限，必須將該使用者加入 wheel 群組中。例如，我們要讓使用者 alex 可以 su 成 root 的權限，則在 group 檔中 wheel 群組後面加上 alex：</p>
<table width="600" border="1">
    <tbody>
        <tr>
            <td width="100%">
            <pre class="screen">wheel:*:0:root,alex
            daemon:*:1:
            kmem:*:2:
            sys:*:3:
            </pre>
            </td>
        </tr>
    </tbody>
</table>
<p><tt class="chtitle2">A.14 host.conf：設定 DNS 查詢順序</tt></p>
<p>這個檔案用來設定 DNS 查詢的順序。預設的查詢順序是先查詢 hosts 這個檔，再由 bind 向 DNS Server 查詢。如果有 NIS 的話，還要再加入 nis 那一行。</p>
<table width="600" border="1">
    <tbody>
        <tr>
            <td width="100%">
            <pre class="screen"># $FreeBSD: src/etc/host.conf,v 1.6 1999/08/27 23:23:41 peter Exp $
            # First try the /etc/hosts file
            hosts
            # Now try the nameserver next.
            bind
            # If you have YP/NIS configured, uncomment the next line
            # nis
            </pre>
            </td>
        </tr>
    </tbody>
</table>
<p><tt class="chtitle2">A.15 hosts：定義常用的機器名稱對映</tt></p>
<p>我們可以將常用的機器名稱及 IP 對映寫在這個檔案中，以節省向 DNS Server 查詢的時間。如果你的主機有多個 domain name，將你最喜歡的放在最前面，這樣寄信時才會出現該 domain name。</p>
<p>在設定時，檔案中最少要有 localhost 和自己的 domain name。hosts 的格式如下：</p>
<pre class="screen">IP 位址	正式的主機名稱	別名</pre>
<p>別名的用意在於，使用時可以用比較簡單的名稱來連線到該機器。例如，我們設定了 bbs.ba.mgt.ncu.edu.tw 的別名為 bbs，則在使用 telnet、ssh、ping 等指令時，我們只要輸入 bbs 做為主機名稱即可，不必輸入其 IP 或是一長串的正式主機名稱。以下為設定範例：</p>
<table width="600" border="1">
    <tbody>
        <tr>
            <td width="100%">
            <pre class="screen">127.0.0.1               localhost.com localhost
            192.168.0.1             mydomain.com mydomain
            192.168.0.1             mydomain.com.
            192.168.0.2             mail.mydomain.com mail
            140.115.83.240          bbs.mgt.ncu.edu.tw bbs.mgt
            140.115.75.5            bbs.ba.mgt.ncu.edu.tw bbs</pre>
            </td>
        </tr>
    </tbody>
</table>
<p><tt class="chtitle2">A.16 hosts.allow：設定允許或拒絕連線的主機</tt></p>
<p>設定允許或拒絕使用本機服務、連線的主機來源。例如你可以在這裡加入拒絕某台電腦使用 telnet、ssh、ftp 等連線到你的機器。在「系統安全」一章詳細的說明了如何使用這個檔案來讓我們的主機更安全</p>
<p><tt class="chtitle2">A.17 hosts.equiv：設定遠端信任主機及使用者</tt></p>
<p>設定遠端信任主機及使用者，這個檔案主要是給一些 &quot;r&quot; 系列的服務用，例如 rcp、rlogin、rsh 等。詳細說明請 <tt class="userinput">man hosts.equiv</tt>。</p>
<p><tt class="chtitle2">A.18 hosts.lpd：設定可以使用本地列表機的主機</tt></p>
<p>我們可以將 FreeBSD 設定成 LPR 網路列表機，而這個檔案是用來設定可以使用本地列表機的主機，只要加入主機名稱或 IP 即可。</p>
<p><tt class="chtitle2">A.19 inetd.conf：各項 inetd 服務設定檔</tt></p>
<p>inetd 是 UNIX 系統中用來掌管許多服務的重要 daemon，我們可以修改這個檔來設定 inetd 所要提供的服務。它的格式如下：</p>
<table id="AutoNumber1" style="BORDER-COLLAPSE: collapse" bordercolor="#111111" cellspacing="0" cellpadding="0" width="600" border="1">
    <tbody>
        <tr>
            <td width="100%">
            <pre class="screen">#ftp	stream	tcp	nowait  root    /usr/libexec/ftpd       ftpd -l
            #ftp	stream	tcp6	nowait  root    /usr/libexec/ftpd       ftpd -l
            #ssh	stream	tcp	nowait  root    /usr/sbin/sshd          sshd -i -4
            #ssh	stream	tcp6	nowait  root    /usr/sbin/sshd          sshd -i -6
            telnet	stream	tcp	nowait  root    /usr/libexec/telnetd    telnetd
            #telnet	stream	tcp6	nowait  root    /usr/libexec/telnetd    telnetd
            </pre>
            </td>
        </tr>
    </tbody>
</table>
<p>第一個欄位是服務的名稱，要和 <tt class="filename">/etc/services</tt> 搭配設定。如果要開放某一項服務，只要將開頭的 # 符號移除即可。我們一般可以在這個檔案中設定的常用服務有 telnet、ftp、pop3等。當修改這個檔後，必須重跑 inetd 才會生效。</p>
<pre class="screen"><tt class="prompt">#</tt> <tt class="userinput">kill -1 `cat /var/run/inetd.pid`</tt></pre>
<p><tt class="chtitle2">A.20 localtime：記錄所在時區設定</tt></p>
<p>這個檔記載你所在的時區資料，你可以經由 <tt class="userinput">sysinstall</tt> 來設定時區。該程式會自動將 <tt class="filename">/usr/share/zoneinfo</tt> 中合適的檔案複製一份成為 <tt class="filename">/etc/localtime</tt>。</p>
<p><tt class="chtitle2">A.21 locate.rc：快速搜尋檔案的名稱資料庫設定</tt></p>
<p>FreeBSD 會自動依這檔案的內容來建立硬碟中檔案名稱資料庫，以利我們快速搜尋檔案名稱。詳細的說明請 <tt class="userinput">man updatedb</tt>、<tt class="userinput">man locate</tt>。</p>
<p><tt class="chtitle2">A.22 login.access：控制使用者登入權限</tt></p>
<p>用來設定登入系統使用者的權限，我們可以在這裡設定是否允許使用者從 console 登入、從不同區域登入的權限等。</p>
<p>當某個使用者登入後，會先依本檔中的設定來控制使用者的登入來源。這裡所使用的規則是由上往下比對，先符合者優先，也就是 first match wins，來決定該使用者可以登入或是被拒絕。它的格式是以 &quot;:&quot; 分割成三個欄位：</p>
<pre class="screen">permission : users : origins</pre>
<ul>
    <li>第一個欄位應該是 &quot;+&quot; (可以登入) 或 &quot;-&quot; (拒絕登入) 的其中之一。 </li>
    <li>第二個欄位是一個或多個登入的名稱、群組名稱或是 ALL(永遠符合)。 </li>
    <li>第三個欄位是一個或多個 tty 的名稱清單(非網路登入用)、主機名稱、所屬網域(開頭是 &quot;.&quot; 的)、主機位址、網際網路編號(結尾是 &quot;.&quot; 的)、或是本地的機器 (任何沒有包含 &quot;.&quot; 的字串)。如果你有跑 NIS，你可以使用@netgroupname在主機或是使用者的格式中。 </li>
</ul>
<p>我們也可以使用 EXCEPT 的運算符號寫出非常簡潔的規則。群組的設定只有在使用者名稱不符合規則時才會被用到，而且這個程式並不會去查使用者主要的群組是什麼。</p>
<p><tt class="chtitle2">A.23 login.conf：控制使用者可以使用的系統資源</tt></p>
<p>這個檔案用來控制不同帳號可以使用的系統資源，它會依照使用者在密碼檔中的 login class 來尋找相對應的 class 設定，如果沒有分類則使用 default 的預設值。請參考「使用者管理」一章中的說明。</p>
<p><tt class="chtitle2">A.24 mail.rc：設定 mail 指令參數</tt></p>
<p>用來設定 mail 的參數。當 mail 指令執行時，它會先讀 <tt class="filename">/usr/share/misc/mail.rc</tt>、<tt class="filename">/usr/local/etc/mail.rc</tt> 及 <tt class="filename">/etc/mail.rc</tt>，最後再讀使用者的 <tt class="filename">~/mailrc</tt> 這個檔。請 <tt class="userinput">man mail</tt>，您不必動到這個檔。</p>
<p><tt class="chtitle2">A.25 make.conf：設定 make 的參數</tt></p>
<p>當我們在重新編譯 FreeBSD 內附的程式時 (例如使用 port 安裝軟體時)，我們所使用的指令 <tt class="userinput">make</tt> 會讀取 <tt class="filename">/etc/make.conf</tt> 來取得一些編譯時的參數。它可以讓你在 make 時覆蓋一些設定而不必去修改 source tree。make.conf檔案一定要使用有效的 Makefile 語法。一般而言，我們會修改一些關於下載檔案的 FTP 站台設定，以從 port 安裝軟體而言，當下達 make install 指令時，make 會去抓一些必要的檔案，如果要去國外抓的話實在太慢了，所以我們會將 FTP 站台設定為離我最近或最快的站台。只要在 make.conf 中最下方加入下列設定即可：</p>
<table width="600" border="1">
    <tbody>
        <tr>
            <td width="100%">
            <pre class="screen"># 當使用 port 安裝軟體時，優先使用中央大學資工系及交大資工的 FTP
            MASTER_SITE_BACKUP?=    \
            ftp://freebsd.csie.ncu.edu.tw/FreeBSD/ports/distfiles/${DIST_SUBDIR}/ \
            ftp://freebsd.csie.nctu.edu.tw/pub/distfiles/${DIST_SUBDIR}/
            MASTER_SITE_OVERRIDE?=	${MASTER_SITE_BACKUP}
            </pre>
            </td>
        </tr>
    </tbody>
</table>
<p><tt class="chtitle2">A.26 manpath.config：設定 man 文件所在位置</tt></p>
<p>設定 man 指令的參數，如 man 的文件所在等。</p>
<p><tt class="chtitle2">A.27 master.passwd：使用者密碼檔</tt></p>
<p>FreeBSD 使用 shadow password 的方式來保護密碼檔，只有 root 才可以讀取編碼後的密碼檔 <tt class="filename">/etc/master.passwd</tt>，而一般使用者只能看到 passwd 檔中的資料。但是這並不是系統用來驗証的檔案，為了加快速度，FreeBSD 將該檔做成資料庫 <tt class="filename">/etc/spwd.db</tt> 及 <tt class="filename">/etc/pwd.db</tt>， 因此在修改完 <tt class="filename">master.passwd</tt> 後，必須使用指令 <tt class="userinput">pwd_mkdb</tt> 來將 <tt class="filename">master.passwd</tt> 做成資料庫檔案。不過一般而言，我會使用 <tt class="userinput">vipw</tt> 這個指令來修改 <tt class="filename">master.passwd</tt>，<tt class="userinput">vipw</tt> 會先將 <tt class="filename">master.passwd</tt> 以預設的文書編輯軟體打開，修改完存檔後，它會視需要自動更新資料庫。</p>
<p>它的格式是：</p>
<pre class="screen">name:password:UID:GID:class:change:expire:fullname:home:shell</pre>
<ul>
    <li>name：使用者帳號名稱，也就是您 login 時所需輸入的名字。使用者名稱長度最長可以是 16 個字元，但如果您要使用 NIS，則最多只可以使用8個字元。每個使用者名稱不可重覆。而且使用者名稱中只能包英文字、減號 &quot;-&quot;、底線 &quot;_&quot;、及數字，而且最好不要使用大寫的英文字，而開頭的第一個字也不可以是減號 &quot;-&quot;。在 master.passwd 這個檔案中，每個欄位都不可以使用冒號 &quot;:&quot;，因為冒號是用來分割欄位的特殊符號。 </li>
    <li>password：可以是空的，代表不用密碼就可以登入，這樣很危險；也可以是 *，表示不可以登入；上面 vipw 顯示出來的項目中，以使用者 root 而言，他的密碼是使用 MD5 編碼過的，特徵是開頭為 $1 且看起來比較長；而使用者 tom 的密碼是使用 DES 編碼過的，DES 會將密碼編成一串13個字元的符號。 </li>
    <li>UID：使用者代號，每個使用者都不一樣，不可重覆，如果有多個帳號使用同樣的 UID，FreeBSD 會將它當成同一個帳號。編號從 0 到 65535。UID 0 為系統中超級使用者的代號，內定只有 root 和 toor 的 UID 為 0。toor 帳號是 bash 所建立的使用者，內定不能使用該使用者登入。 </li>
    <li>GID：群組代號，編號從 0 到 65535。 </li>
    <li>class：除了群組外，class是更有彈性的控制方法，可以針對 /etc/login.conf 中不同的使用者設定來調整每個使用者的可使用的資源設定。 </li>
    <li>change：強迫使用者變更密碼的時間，以從1970年到所要變更日期所經過的秒數來表示。你可以使用 date +%s 來求出從1970年到現在時間所經過的秒數，每天為86400秒，以現在時間的秒數加上86400*天數即為你要設定的時間。你可以使用指令下列指令來取得30天後的秒數，再將其填入即可。若設為0則表示不使用此功能： </li>
</ul>
<blockquote>
<pre class="screen"><tt class="prompt">#</tt> <tt class="userinput">expr `date +%s` + 86400 \* 30</tt></pre>
</blockquote>
<ul>
    <li>expire：帳號的有效日期，一樣是以從1970年到到期日所經過的秒數來代表。若設為0則表示不使用此功能。 </li>
    <li>fullname：使用者全名，你可以在此鍵入真實姓名。請注意這個欄位也不可以使用冒號哦。 </li>
    <li>home：使用者的家目錄，即使用者登入後的所在目錄。 </li>
    <li>shell：使用者的 shell。如果使用 /sbin/nologin 表示該名使用者不可以登入。 </li>
</ul>
<p><tt class="chtitle2">A.28 motd：使用者登入後訊息</tt></p>
<p>系統登入後，會自動秀出一段文字，稱為 Message Of The Day(motd)。這一段文字是可以修改的，你可以編輯 <tt class="filename">/etc/motd</tt> 來製作自己的畫面。如果您不希望 motd 內容出現 FreeBSD 的版本資訊，您可以在 <tt class="filename">rc.conf</tt> 中加入下面內容：</p>
<table width="600" border="1">
    <tbody>
        <tr>
            <td width="100%">
            <pre class="screen">update_motd=&quot;YES&quot;</pre>
            </td>
        </tr>
    </tbody>
</table>
<p>如此一來，下次您更新 motd 的內容時，系統就不會自動將版本資訊加入 motd 中。</p>
<p><tt class="chtitle2">A.29 namedb/：DNS 伺服器設定檔</tt></p>
<p>如果你有架 Name Server 的話，你必須設定該目錄下的檔案。詳細說明請參考「DNS伺服器」一章的說明。</p>
<p><tt class="chtitle2">A.30 netstart：啟動網路服務的程式</tt></p>
<p>這個檔案並不會被其他程式所使用，它只是讓你在單人模式下執行，用以啟動網路。而多人模式的網路設定在於 /etc/rc.network。</p>
<p><tt class="chtitle2">A.31 networks：設定本地網路資訊</tt></p>
<p>用來設定本地網路的資訊，我們通常不會需要修改這個檔案。</p>
<p><tt class="chtitle2">A.32 newsyslog.conf：設定定期壓縮備份檔案</tt></p>
<p>這個檔主要用來定期檢查 <tt class="filename">/var/log/</tt> 的檔案，設定當 log 到一定大小或是定期的將舊的檔案壓縮備份，並刪除太老舊的檔案。除了 log 外，您也可以用它來設定定時要壓縮備份的檔案。</p>
<p>語法：</p>
<pre class="screen">logfilename [owner:group] mode count size when [ZB] [/pid_file] [sig_num]</pre>
<table width="600" border="1">
    <tbody>
        <tr>
            <td valign="top" width="122"><b>欄位</b></td>
            <td width="459"><b>說明</b></td>
        </tr>
        <tr>
            <td valign="top" width="122">logfilename</td>
            <td width="459">log 檔名稱</td>
        </tr>
        <tr>
            <td valign="top" width="122">[owner:group]</td>
            <td width="459">log 檔擁有人:群組</td>
        </tr>
        <tr>
            <td valign="top" width="122">mode</td>
            <td width="459">該 log 檔的權限(檔案屬性)</td>
        </tr>
        <tr>
            <td valign="top" width="122">count</td>
            <td width="459">最多計算到多少，例如 cron 是 3 表示將有四個壓縮檔：cron.0.gz, cron.1.gz, cron.2.gz, cron.3.gz。</td>
        </tr>
        <tr>
            <td valign="top" width="122">size</td>
            <td width="459">檔案最大到多少即壓縮備份，以 KB 計。</td>
        </tr>
        <tr>
            <td valign="top" width="122">when</td>
            <td width="459">什麼時候做備份，請 man newsyslog 來看詳細說明。以 @ 為首代表用 ISO 8601 結構的時間格式。以 $ 為首代表使用每天、每週、每月。<br />一些例子：<br />$D0 每天半夜十二點<br />$D23 每天 23:00 時<br />$W0D23 每週日 23:00 <br />$W5D16 每週五 16:00 <br />$MLD0 每月最後一天半夜十二點<br />$M5D6 每月第五天 6:00 </td>
        </tr>
        <tr>
            <td valign="top" width="122">[ZB]</td>
            <td width="459">Z 表示要將該檔以 gzip 壓縮起來，B 表示該檔是 binary 檔。</td>
        </tr>
        <tr>
            <td valign="top" width="122">[/pid_file]</td>
            <td width="459">pid 檔的絕對路徑，如果有設定，則會送出 sig_num 給該程式。</td>
        </tr>
        <tr>
            <td valign="top" width="122">[sig_num]</td>
            <td width="459">要送給該 daemon 程的 signal number，預設是 SIGHUP。</td>
        </tr>
    </tbody>
</table>
<p><tt class="chtitle2">A.33 nsmb.conf：設定 smbfs 資訊</tt></p>
<p>我們可以在 FreeBSD 中使用 mount_smbfs 來掛入 Windows 網路芳鄰中所分享出來的共享資料夾。而 nsmb.conf 就是執行 mount_smbfs 所使用的設定檔。我們可以設定所要使用的 codepage、使用者名稱及密碼等，請 <tt class="userinput">man nsmb.conf</tt> 以取得相關的設定說明。</p>
<p><tt class="chtitle2">A.34 nsswitch.conf：設定 nsswich 資訊</tt></p>
<p>FreeBSD 中有所謂 name-server switch，用來控制名稱資訊轉換，例如，當系統要取得 password、group、host 等資訊時，會參考這個檔案以決定要從哪裡得到資訊。請 <tt class="userinput">man nsswitch.conf</tt> 以取得相關的設定說明。</p>
<p><tt class="chtitle2">A.35 opiekeys：OPIE 設定檔</tt></p>
<p>FreeBSD 內建一種密碼驗證的方法 OPIE (One Time Password In Everything)，就是一種只能使用一次的密碼。而 opiekeys 這個檔案是用來存放使用 OPIE 的使用者設定。您可以 <tt class="userinput">man opie</tt> 及 <tt class="userinput">man opiepasswd</tt> 以取得更多資訊。</p>
<p><tt class="chtitle2">A.36 pam.d：PAM 設定檔</tt></p>
<p>PAM 是 Pluggable Authentication Module 的縮寫。它是 FreeBSD 內建的一種極富彈性的認證機制，您可以參考這個網頁來取得更多關於 PAM 的資訊：http://www.freebsd.org/doc/en_US.ISO8859-1/articles/pam/；或者如果您安裝時有安裝 FreeBSD 文件，您也可以在下列目錄找到關於 PAM 的說明：</p>
<pre class="screen"><tt class="prompt">#</tt> <tt class="userinput">ls /usr/share/doc/en_US.ISO8859-1/articles/pam</tt></pre>
<p><tt class="chtitle2">A.37 passwd：不含密碼的使用者資訊檔</tt></p>
<p>FreeBSD 使用 shadow password 的方式來保護密碼檔，只有 root 才可以讀取編碼後的密碼檔 <tt class="filename">/etc/master.passwd</tt>，而一般使用者只能看到 passwd 檔中的資料。但是這並不是系統用來驗証的檔案，為了加快速度，FreeBSD 將該檔做成資料庫 <tt class="filename">/etc/spwd.db</tt> 及 <tt class="filename">/etc/pwd.db</tt>， 因此在修改完 <tt class="filename">master.passwd</tt> 後，必須使用指令 pwd_mkdb 來將 <tt class="filename">master.passwd</tt> 做成資料庫檔案。不過一般而言，我會使用 <tt class="userinput">vipw</tt> 這個指令來修改 <tt class="filename">master.passwd</tt>，vipw 會先將 <tt class="filename">master.passwd</tt> 以預設的文書編輯軟體打開，修改完存檔後，它會視需要自動更新資料庫。你不需要改 passwd 的內容，只要改 <tt class="filename">master.passwd</tt> 即可。詳細說明請參考 <tt class="userinput">man master.passwd</tt> 的說明。</p>
<p><tt class="chtitle2">A.38 pccard_ether：啟用及停用 PCCARD 網路設備</tt></p>
<p>本檔用以啟動或停用 PCCARD 網路設備的執行檔。</p>
<p><tt class="chtitle2">A.39 periodic/daily：包含每天會定時執行的工作</tt></p>
<p>設定每天要執行一次的程式。該目錄下放的是 shell script，如果你想自行增加的話，只需在該目錄下編輯新的 shell script 並將權限設為可執行即可，或者編輯 <tt class="filename">/etc/daily.local</tt>，加入想要執行的指令。在 <tt class="filename">/etc/defaults/periodic.conf</tt> 中定義了定期執行的設定，以下即為 daily 選項每個檔案所執行的動作：</p>
<table width="500" border="1">
    <tbody>
        <tr>
            <td width="150"><b>檔案</b></td>
            <td width="323"><b>動作</b></td>
            <td align="center" width="34"><b>預設執行</b></td>
        </tr>
        <tr>
            <td valign="top" width="150">100.clean-disks</td>
            <td width="323">清理磁碟，要清除的檔案類型可以在 periodic.conf 中設定。</td>
            <td align="center" width="34">否</td>
        </tr>
        <tr>
            <td valign="top" width="150">110.clean-tmps</td>
            <td width="323">清除 /tmp。</td>
            <td align="center" width="34">否</td>
        </tr>
        <tr>
            <td valign="top" width="150">120.clean-preserve</td>
            <td width="323">刪除 /var/preserve 中它舊的檔案。</td>
            <td align="center" width="34">是</td>
        </tr>
        <tr>
            <td valign="top" width="150">130.clean-msgs</td>
            <td width="323">清除舊的系統訊息。</td>
            <td align="center" width="34">是</td>
        </tr>
        <tr>
            <td valign="top" width="150">140.clean-rwho</td>
            <td width="323">清除 /var/rwho 中的舊資料。</td>
            <td align="center" width="34">是</td>
        </tr>
        <tr>
            <td valign="top" width="150">150.clean-hoststat</td>
            <td width="323">清除 /var/spool/.hoststat。</td>
            <td align="center" width="34">是</td>
        </tr>
        <tr>
            <td valign="top" width="150">200.backup-passwd</td>
            <td width="323">備份 /etc/master.passwd 及 /etc/group 並比對是否有更動。</td>
            <td align="center" width="34">是</td>
        </tr>
        <tr>
            <td valign="top" width="150">210.backup-aliases</td>
            <td width="323">備份 /etc/mail/aliases。</td>
            <td align="center" width="34">是</td>
        </tr>
        <tr>
            <td valign="top" width="150">300.calendar</td>
            <td width="323">執行 calendar -a。</td>
            <td align="center" width="34">否</td>
        </tr>
        <tr>
            <td valign="top" width="150">310.accounting</td>
            <td width="323">移轉 /var/account/ 的檔案。</td>
            <td align="center" width="34">是</td>
        </tr>
        <tr>
            <td valign="top" width="150">330.news</td>
            <td width="323">執行 /etc/news.expire。</td>
            <td align="center" width="34">是</td>
        </tr>
        <tr>
            <td valign="top" width="150">400.status-disks</td>
            <td width="323">執行 df 及 dump -W。</td>
            <td align="center" width="34">是</td>
        </tr>
        <tr>
            <td valign="top" width="150">405.status-ata-raid</td>
            <td width="323">檢查 ATA Raid 的狀態。</td>
            <td align="center" width="34">否</td>
        </tr>
        <tr>
            <td valign="top" width="150">420.status-network</td>
            <td width="323">執行 netstat -i。</td>
            <td align="center" width="34">是</td>
        </tr>
        <tr>
            <td valign="top" width="150">430.status-rwho</td>
            <td width="323">執行 uptime。</td>
            <td align="center" width="34">是</td>
        </tr>
        <tr>
            <td valign="top" widt