MFen:
handbook: advanced-networking/chapter.sgml 1.422 -> 1.425 basics/chapter.sgml 1.156 -> 1.157 bibliography/chapter.sgml 1.85 -> 1.86 config/chapter.sgml 1.236 -> 1.238 cutting-edge/chapter.sgml 1.240 -> 1.244 desktop/chapter.sgml 1.86 -> 1.91 disks/chapter.sgml 1.290 -> 1.291 dtrace/chapter.sgml 1.7 -> 1.8 eresources/chapter.sgml 1.197 -> 1.199 filesystems/chapter.sgml 1.5 -> 1.8 firewalls/chapter.sgml 1.86 -> 1.86 introduction/chapter.sgml 1.133 -> 1.135 jails/chapter.sgml 1.17 -> 1.18 kernelconfig/chapter.sgml 1.190 -> 1.192 linuxemu/chapter.sgml 1.136 -> 1.139 mirrors/chapter.sgml 1.458 -> 1.464 multimedia/chapter.sgml 1.130 -> 1.132 network-servers/chapter.sgml 1.116 -> 1.118 vinum/chapter.sgml 1.46 -> 1.47 virtualization/chapter.sgml 1.17 -> 1.19 x11/chapter.sgml 1.190 -> 1.194 Obtained from: The FreeBSD Simplified Chinese Project
This commit is contained in:
parent
b10cd500b4
commit
2b72c95307
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=35046
21 changed files with 1112 additions and 492 deletions
zh_CN.GB2312/books/handbook
advanced-networking
basics
bibliography
config
cutting-edge
desktop
disks
dtrace
eresources
filesystems
firewalls
introduction
jails
kernelconfig
linuxemu
mirrors
multimedia
network-servers
vinum
virtualization
x11
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Chinese Documentation Project
|
||||
|
||||
Original revision: 1.422
|
||||
Original revision: 1.425
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -51,7 +51,7 @@
|
|||
|
||||
<listitem>
|
||||
<para>如何利用 CARP, &os; 支持的
|
||||
Common Access Redundancy Protocol (共用地址冗余协议)</para>
|
||||
Common Address Redundancy Protocol (共用地址冗余协议)</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
|
@ -404,7 +404,7 @@ host2.example.com link#1 UC 0 0
|
|||
中把它置成默认值。您在可以在 &man.rc.conf.5; 中改变下列变量的值为
|
||||
<literal>YES</literal>,使这个功能生效:</para>
|
||||
|
||||
<programlisting>gateway_enable=YES # Set to YES if this host will be a gateway</programlisting>
|
||||
<programlisting>gateway_enable="YES" # Set to YES if this host will be a gateway</programlisting>
|
||||
|
||||
<para>这个选项会把&man.sysctl.8;
|
||||
变量——<varname>net.inet.ip.forwarding</varname>
|
||||
|
@ -537,7 +537,7 @@ static_routes="internalnet2"
|
|||
route_internalnet2="-net 192.168.2.0/24 192.168.1.2"</programlisting>
|
||||
|
||||
<para>配置变量 <literal>static_routes</literal>
|
||||
是一串以空格格开的字符串。每一串表示一个路由名字。
|
||||
是一串以空格隔开的字符串。每一串表示一个路由名字。
|
||||
在上面的例子中我们中有一个串在 <literal>static_routes</literal>
|
||||
里。这个字符串中 <replaceable>internalnet2</replaceable>。
|
||||
然后我们新增一个配置变量
|
||||
|
@ -4061,21 +4061,61 @@ ISDN BRI line</literallayout>
|
|||
其余的计算机则通过那台 <quote>网关</quote> 机来连接 Internet。</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="network-natdloaderconfiguration">
|
||||
<indexterm>
|
||||
<primary>boot loader (引导加载器)</primary>
|
||||
<secondary>configuration (配置)</secondary>
|
||||
</indexterm>
|
||||
|
||||
<title>引导加载器配置</title>
|
||||
|
||||
<para>在默认的 <filename>GENERIC</filename>
|
||||
内核中, 并没有启用通过 &man.natd.8; 进行网址翻译的功能,
|
||||
不过, 这一功能可以通过在 <filename>/boot/loader.conf</filename>
|
||||
中添加两项配置来在引导时自动予以加载:</para>
|
||||
|
||||
<programlisting>ipfw_load="YES"
|
||||
ipdivert_load="YES"</programlisting>
|
||||
|
||||
<para>此外, 还可以将引导加载器变量
|
||||
<literal>net.inet.ip.fw.default_to_accept</literal>
|
||||
设为 <literal>1</literal>:</para>
|
||||
|
||||
<programlisting>net.inet.ip.fw.default_to_accept="1"</programlisting>
|
||||
|
||||
<note>
|
||||
<para>在刚开始配置防火墙和 NAT 网关时,
|
||||
增加这个配置是个好主意。 默认的 &man.ipfw.8;
|
||||
规则将是 <literal>allow ip from any to
|
||||
any</literal> 而不是默认的 <literal>deny ip from
|
||||
any to any</literal>, 这样, 在系统重启时,
|
||||
也就不太容易被反锁在外面。</para>
|
||||
</note>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="network-natdkernconfiguration">
|
||||
<title>内核配置</title>
|
||||
|
||||
<indexterm>
|
||||
<primary>内核</primary>
|
||||
<secondary>配置</secondary>
|
||||
</indexterm>
|
||||
<title>配置</title>
|
||||
<para>下面这些选项必须放到内核配置文件中:</para>
|
||||
<para>当不能使用内核模块, 或更希望将全部需要的功能联编进内核时,
|
||||
可以在内核配置中添加下面的设置来实现:</para>
|
||||
|
||||
<programlisting>options IPFIREWALL
|
||||
options IPDIVERT</programlisting>
|
||||
|
||||
<para>此外,下列是一些可选的选项:</para>
|
||||
<programlisting>options IPFIREWALL_DEFAULT_TO_ACCEPT
|
||||
options IPFIREWALL_VERBOSE</programlisting>
|
||||
</sect2>
|
||||
|
||||
<para>这些配置必须放到 <filename>/etc/rc.conf</filename> 中:</para>
|
||||
<sect2 id="network-natdsystemconfiguration">
|
||||
<title>系统引导时的配置</title>
|
||||
|
||||
<para>如果希望在系统引导过程中启用防火墙和 NAT 支持,
|
||||
应在 <filename>/etc/rc.conf</filename>中添加下列配置:</para>
|
||||
|
||||
<programlisting>gateway_enable="YES" <co id="co-natd-gateway-enable">
|
||||
firewall_enable="YES" <co id="co-natd-firewall-enable">
|
||||
|
@ -5024,12 +5064,12 @@ route_hostD="192.168.173.4 hatm0 0 102 llc/snap ubr"</programlisting>
|
|||
</author>
|
||||
</authorgroup>
|
||||
</sect1info>
|
||||
<title>Common Access Redundancy Protocol (CARP, 共用地址冗余协议)</title>
|
||||
<title>Common Address Redundancy Protocol (CARP, 共用地址冗余协议)</title>
|
||||
|
||||
<indexterm><primary>CARP</primary></indexterm>
|
||||
<indexterm><primary>Common Access Redundancy Protocol, 共用地址冗余协议</primary></indexterm>
|
||||
<indexterm><primary>Common Address Redundancy Protocol, 共用地址冗余协议</primary></indexterm>
|
||||
|
||||
<para>Common Access Redundancy Protocol, 或简称
|
||||
<para>Common Address Redundancy Protocol, 或简称
|
||||
<acronym>CARP</acronym> 能够使多台主机共享同一
|
||||
<acronym>IP</acronym> 地址。 在某些配置中, 这样做可以提高可用性,
|
||||
或实现负载均衡。 下面的例子中, 这些主机也可以同时使用其他的不同的
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Simplified Chinese Project
|
||||
|
||||
Original Revision: 1.156
|
||||
Original Revision: 1.157
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -918,7 +918,7 @@ root 5211 0.0 0.2 3620 1724 2 I+ 2:09AM 0:00.01 passwd</screen>
|
|||
</row>
|
||||
|
||||
<row>
|
||||
<entry><filename class="directory">/usr/ports</filename></entry>
|
||||
<entry><filename class="directory">/usr/ports/</filename></entry>
|
||||
<entry>存放 FreeBSD 的 Ports Collection (可选)。</entry>
|
||||
</row>
|
||||
|
||||
|
@ -980,7 +980,7 @@ root 5211 0.0 0.2 3620 1724 2 I+ 2:09AM 0:00.01 passwd</screen>
|
|||
</row>
|
||||
|
||||
<row>
|
||||
<entry><filename>/var/yp</filename></entry>
|
||||
<entry><filename class="directory">/var/yp/</filename></entry>
|
||||
<entry>NIS 映射。</entry>
|
||||
</row>
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!--
|
||||
The FreeBSD Chinese Documentation Project
|
||||
|
||||
Original Revision: 1.85
|
||||
Original Revision: 1.86
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -615,11 +615,6 @@
|
|||
¡£</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><emphasis>The BSD Release Announcements collection</emphasis>.
|
||||
1997. <ulink url="http://www.de.FreeBSD.org/de/ftp/releases/"></ulink></para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><emphasis>Networked Computer Science Technical Reports
|
||||
Library</emphasis>. <ulink url="http://www.ncstrl.org/"></ulink></para>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Chinese Documentation Project
|
||||
|
||||
Original Revision: 1.236
|
||||
Original Revision: 1.238
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -52,7 +52,7 @@
|
|||
</listitem>
|
||||
<listitem>
|
||||
<para><filename>rc.conf</filename> 的基本设置以及
|
||||
<filename>/usr/local/etc/rc.d</filename> 启动体系。</para>
|
||||
<filename class="directory">/usr/local/etc/rc.d</filename> 启动体系。</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>如何设置和测试网卡。</para>
|
||||
|
@ -61,7 +61,7 @@
|
|||
<para>如何在您的网络设备上配置虚拟主机。</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>如何使用 <filename>/etc</filename> 下的各配置文件。</para>
|
||||
<para>如何使用 <filename class="directory">/etc</filename> 下的各配置文件。</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>如何通过 <command>sysctl</command> 变量来对 &os; 系统进行调优。</para>
|
||||
|
@ -93,13 +93,13 @@
|
|||
|
||||
<indexterm><primary>分区规划</primary></indexterm>
|
||||
<indexterm>
|
||||
<primary><filename>/etc</filename></primary>
|
||||
<primary><filename class="directory">/etc</filename></primary>
|
||||
</indexterm>
|
||||
<indexterm>
|
||||
<primary><filename>/var</filename></primary>
|
||||
<primary><filename class="directory">/var</filename></primary>
|
||||
</indexterm>
|
||||
<indexterm>
|
||||
<primary><filename>/usr</filename></primary>
|
||||
<primary><filename class="directory">/usr</filename></primary>
|
||||
</indexterm>
|
||||
|
||||
<sect3>
|
||||
|
@ -109,30 +109,32 @@
|
|||
来分割您的文件系统的时候,
|
||||
要记住硬盘驱动器外磁道传输数据要比从内磁道传输数据快。
|
||||
因此应该将小的和经常访问的文件系统放在驱动器靠外的位置,
|
||||
一些大的分区比如 <filename>/usr</filename>
|
||||
一些大的分区比如 <filename class="directory">/usr</filename>
|
||||
应该放在磁盘比较靠里的位置。
|
||||
以类似这样的顺序建立分区是一个不错的主意:root,swap,
|
||||
<filename>/var</filename>,<filename>/usr</filename>。</para>
|
||||
<filename class="directory">/var</filename>,
|
||||
<filename class="directory">/usr</filename>。</para>
|
||||
|
||||
<para><filename>/var</filename> 分区的大小能反映您的机器使用情况。
|
||||
<filename>/var</filename> 文件系统用来存储邮件,
|
||||
<para><filename class="directory">/var</filename> 分区的大小能反映您的机器使用情况。
|
||||
<filename class="directory">/var</filename> 文件系统用来存储邮件,
|
||||
日志文件和打印队列缓存,
|
||||
特别是邮箱和日志文件可能会达到无法预料的大小,
|
||||
这主要取决于在您的系统上有多少用户和您的日志文件可以保存多长时间。
|
||||
大多数用户很少需要 <filename>/var</filename>
|
||||
大多数用户很少需要 <filename class="directory">/var</filename>
|
||||
有 1GB 以上的闲置空间。</para>
|
||||
|
||||
<note>
|
||||
<para>有时候 <filename>/var/tmp</filename> 需要很多的磁盘空间。
|
||||
<para>有时候 <filename class="directory">/var/tmp</filename> 需要很多的磁盘空间。
|
||||
在使用 &man.pkg.add.1; 安装新的软件时,包管理工具会在
|
||||
<filename>/var/tmp</filename> 中解压出一份临时拷贝。
|
||||
<filename class="directory">/var/tmp</filename> 中解压出一份临时拷贝。
|
||||
大的软件包,像 <application>Firefox</application>,
|
||||
或者 <application>OpenOffice</application>
|
||||
在安装时如果 <filename>/var/tmp</filename>
|
||||
在安装时如果 <filename class="directory">/var/tmp</filename>
|
||||
中没有足够的空间就可能需要一些技巧了。</para>
|
||||
</note>
|
||||
|
||||
<para><filename>/usr</filename> 分区存储很多用来系统运行所需要的文件例如
|
||||
<para><filename class="directory">/usr</filename>
|
||||
分区存储很多用来系统运行所需要的文件例如
|
||||
&man.ports.7; (建议这样做) 和源代码 (可选的)。
|
||||
ports 和基本系统的源代码在安装时都是可选的,
|
||||
但我们建议给这个分区至少保留 2GB 的可用空间。</para>
|
||||
|
@ -143,7 +145,8 @@
|
|||
|
||||
<note><para>一些用户会发现 &man.sysinstall.8; 的
|
||||
<literal>Auto-defaults</literal> 自动分区有时会分配给
|
||||
<filename>/var</filename> 和 <filename>/</filename> 较小的分区空间。
|
||||
<filename class="directory">/var</filename> 和
|
||||
<filename class="directory">/</filename> 较小的分区空间。
|
||||
分区应该精确一些并且大一些。</para></note>
|
||||
</sect3>
|
||||
|
||||
|
@ -176,9 +179,9 @@
|
|||
<para>一些用户认为一个单独的大分区将会很好,
|
||||
但是有很多原因会证明为什么这是个坏主意。首先,
|
||||
每个分区有不同的分区特性,因此分开可以让文件系统调整它们。
|
||||
例如,根系统和 <filename>/usr</filename> 一般只是读取,写入很少。
|
||||
很多读写频繁的被放在 <filename>/var</filename> 和
|
||||
<filename>/var/tmp</filename>中。</para>
|
||||
例如,根系统和 <filename class="directory">/usr</filename> 一般只是读取,写入很少。
|
||||
很多读写频繁的被放在 <filename class="directory">/var</filename> 和
|
||||
<filename class="directory">/var/tmp</filename>中。</para>
|
||||
|
||||
<para>适当的划分一个系统, 在其中使用较小的分区, 这样,
|
||||
那些以写为主的分区将不会比以读为主的分区付出更高的代价。
|
||||
|
@ -186,9 +189,9 @@
|
|||
例如放在实际的大硬盘的前面代替放在分区表的后面,将会提高您需要的分区的
|
||||
I/O 性能。现在可能也需要在比较大的分区上有很好的 I/O 性能,
|
||||
把他们移动到磁盘外围不会带来多大的性能提升,反而把
|
||||
<filename>/var</filename> 移到外面会有很好的效果。最后涉及到安全问题。
|
||||
<filename class="directory">/var</filename> 移到外面会有很好的效果。最后涉及到安全问题。
|
||||
一个主要是只读的小的、整洁的根分区可以提高从一个严重的系统崩溃中恢复过来的机会。
|
||||
</para>
|
||||
</para>
|
||||
</sect3>
|
||||
</sect2>
|
||||
|
||||
|
@ -210,7 +213,7 @@
|
|||
<para>系统管理员应该在 <filename>rc.conf</filename> 文件中建立记录来覆盖
|
||||
<filename>/etc/defaults/rc.conf</filename> 中的默认设置。
|
||||
这个默认文件不应该被逐字的复制到
|
||||
<filename>/etc</filename> —— 它包含的是默认值而不是一个例子。
|
||||
<filename class="directory">/etc</filename> —— 它包含的是默认值而不是一个例子。
|
||||
所有特定的改变应该在 <filename>rc.conf</filename> 中。</para>
|
||||
|
||||
<para>在集群应用中,为了降低管理成本,
|
||||
|
@ -242,7 +245,6 @@
|
|||
<para>使用 &man.sysinstall.8; 或者 <command>make world</command>
|
||||
来升级系统不会覆盖 <filename>rc.conf</filename>
|
||||
文件, 所以系统配置信息不会丢失。</para>
|
||||
|
||||
</sect1>
|
||||
|
||||
<sect1 id="configtuning-appconfig">
|
||||
|
@ -255,7 +257,7 @@
|
|||
<indexterm><primary>/usr/local/etc</primary></indexterm>
|
||||
|
||||
<para>一般来说,这些文件被安装在
|
||||
<filename>/usr/local/etc</filename>。这个例子中,
|
||||
<filename class="directory">/usr/local/etc</filename>。这个例子中,
|
||||
一个应用程序有很多配置文件并且创建了一个子目录来存放他们。</para>
|
||||
|
||||
<para>通常,当一个 port 或者 package 被安装的时候,
|
||||
|
@ -263,7 +265,8 @@
|
|||
的后缀来标识。如果不存在这个应用程序的配置文件, 它们会通过复制
|
||||
<filename>.default</filename> 文件来创建。</para>
|
||||
|
||||
<para>例如,看一下这个目下的内容 <filename>/usr/local/etc/apache</filename>:</para>
|
||||
<para>例如,看一下这个目下的内容
|
||||
<filename class="directory">/usr/local/etc/apache</filename>:</para>
|
||||
|
||||
<literallayout class="monospaced">-rw-r--r-- 1 root wheel 2184 May 20 1998 access.conf
|
||||
-rw-r--r-- 1 root wheel 2184 May 20 1998 access.conf.default
|
||||
|
@ -308,60 +311,6 @@
|
|||
这取决于 &os; 版本。 但是不管怎样,
|
||||
需要考虑的一个重要方面是他们的启动配置文件要能被基本启动脚本识别捕获。</para>
|
||||
|
||||
<para>在 <filename>rc.d</filename> 出现之前, 应用程序会把一个简单的启动脚本放到
|
||||
<filename class="directory">/usr/local/etc/rc.d</filename>
|
||||
目录中, 这个目录中的脚本会被系统初始化脚本读取。</para>
|
||||
|
||||
<para>尽管很多人已经花费了相当多的时间来把旧的配置方式融入到新系统中,
|
||||
仍然有许多第三方软件需要把脚本放到上面提到的目录中。
|
||||
是否使用 <filename>rc.d</filename> 会对这些脚本的执行带来一些变化。
|
||||
在 &os; 5.1 之前采用的是旧式的配置,
|
||||
当然, 绝大多数情况下, 新式的脚本也会工作的很好。</para>
|
||||
|
||||
<para>每个脚本都应该遵守 &os; 版本所需求的一些规定:
|
||||
每个脚本必须是能够被系统执行,通常可以使用
|
||||
<command>chmod</command> 命令设置成 <literal>555</literal> 权限。
|
||||
它还应该能接受 <literal>start</literal>
|
||||
选项来启动程序并且接受 <literal>stop</literal>
|
||||
选项来结束程序。</para>
|
||||
|
||||
<para>一个简单的脚本看起来可能会像这样:</para>
|
||||
|
||||
<programlisting>#!/bin/sh
|
||||
echo -n ' utility'
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
/usr/local/bin/utility
|
||||
;;
|
||||
stop)
|
||||
kill -9 `cat /var/run/utility.pid`
|
||||
;;
|
||||
*)
|
||||
echo "Usage: `basename $0` {start|stop}" >&2
|
||||
exit 64
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0</programlisting>
|
||||
|
||||
<para>这个脚本提供了 <literal>stop</literal> 和
|
||||
<literal>start</literal> 两个选项, 用以操作
|
||||
<literal>utility</literal>。</para>
|
||||
|
||||
<para>可以用如下方法来启动:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput><filename>/usr/local/etc/rc.d/utility</filename> start</userinput></screen>
|
||||
|
||||
<para>现在不是所有第三方软件都需要在
|
||||
<filename>rc.conf</filename> 中进行如此的配置,
|
||||
不过几乎每天都有新的 port 被修改来采用这种配置方法。
|
||||
您应在安装的最后阶段查看所显示的信息,
|
||||
以了解某个具体的应用是否需要这样的配置。
|
||||
某些第三方软件会提供启动脚本, 以便与
|
||||
<filename>rc.d</filename> 配合使用;
|
||||
这些内容将在下一节介绍。</para>
|
||||
|
||||
<sect2>
|
||||
<title>扩展应用程序配置</title>
|
||||
|
||||
|
@ -380,14 +329,6 @@ exit 0</programlisting>
|
|||
# REQUIRE: DAEMON
|
||||
# KEYWORD: shutdown
|
||||
|
||||
#
|
||||
# DO NOT CHANGE THESE DEFAULT VALUES HERE
|
||||
# SET THEM IN THE /etc/rc.conf FILE
|
||||
#
|
||||
utility_enable=${utility_enable-"NO"}
|
||||
utility_flags=${utility_flags-""}
|
||||
utility_pidfile=${utility_pidfile-"/var/run/utility.pid"}
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="utility"
|
||||
|
@ -396,15 +337,20 @@ command="/usr/local/sbin/utility"
|
|||
|
||||
load_rc_config $name
|
||||
|
||||
pidfile="${utility_pidfile}"
|
||||
#
|
||||
# DO NOT CHANGE THESE DEFAULT VALUES HERE
|
||||
# SET THEM IN THE /etc/rc.conf FILE
|
||||
#
|
||||
utility_enable=${utility_enable-"NO"}
|
||||
utility_pidfile=${utility_pidfile-"/var/run/utility.pid"}
|
||||
|
||||
start_cmd="echo \"Starting ${name}.\"; /usr/bin/nice -5 ${command} ${utility_flags} ${command_args}"
|
||||
pidfile="${utility_pidfile}"
|
||||
|
||||
run_rc_command "$1"</programlisting>
|
||||
|
||||
<para>这个脚本将保证
|
||||
<application>utility</application> 能够在
|
||||
<literal>daemon</literal> 服务之后启动。 它同时也提供了设置和跟踪
|
||||
<literal>DAEMON</literal> 服务之后启动。 它同时也提供了设置和跟踪
|
||||
<acronym>PID</acronym>, 也就是进程
|
||||
<acronym>ID</acronym> 文件的方法。</para>
|
||||
|
||||
|
@ -439,7 +385,6 @@ run_rc_command "$1"</programlisting>
|
|||
<literal>@reboot</literal> 来指定时间。
|
||||
这样的设置将在 &man.cron.8; 启动时运行,
|
||||
通常这也是系统初始化的时候。</para>
|
||||
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
|
@ -462,7 +407,7 @@ run_rc_command "$1"</programlisting>
|
|||
<para>&os; 最有用的软件包(utilities)中的一个是 &man.cron.8;。
|
||||
<command>cron</command> 软件在后台运行并且经常检查
|
||||
<filename>/etc/crontab</filename> 文件。<command>cron</command>
|
||||
软件也检查 <filename>/var/cron/tabs</filename> 目录,搜索新的
|
||||
软件也检查 <filename class="directory">/var/cron/tabs</filename> 目录,搜索新的
|
||||
<filename>crontab</filename> 文件。这些 <filename>crontab</filename>
|
||||
文件存储一些 <command>cron</command> 在特定时间执行任务的信息。</para>
|
||||
|
||||
|
@ -612,7 +557,7 @@ HOME=/var/log
|
|||
<para>在 2002 年, &os; 整合了来自 NetBSD 的
|
||||
<filename>rc.d</filename> 系统, 并通过它来完成系统的初始化工作。
|
||||
用户要注意在
|
||||
<filename>/etc/rc.d</filename> 目录下的文件。
|
||||
<filename class="directory">/etc/rc.d</filename> 目录下的文件。
|
||||
这里面的许多文件是用来管理基础服务的, 它们可以通过
|
||||
<option>start</option>、 <option>stop</option>,
|
||||
以及 <option>restart</option> 选项来控制。
|
||||
|
@ -1263,7 +1208,7 @@ ifconfig_fxp0_alias7="inet 202.0.75.20 netmask 255.255.255.255"</programlisting>
|
|||
<title>配置文件</title>
|
||||
|
||||
<sect2>
|
||||
<title><filename>/etc</filename> 布局</title>
|
||||
<title><filename class="directory">/etc</filename> 布局</title>
|
||||
<para>在配置信息中有很多的目录,这些包括:</para>
|
||||
|
||||
<informaltable frame="none" pgwide="1">
|
||||
|
@ -1273,37 +1218,37 @@ ifconfig_fxp0_alias7="inet 202.0.75.20 netmask 255.255.255.255"</programlisting>
|
|||
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><filename>/etc</filename></entry>
|
||||
<entry><filename class="directory">/etc</filename></entry>
|
||||
<entry>一般的系统配置信息。这儿的数据是与特定系统相关的。</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><filename>/etc/defaults</filename></entry>
|
||||
<entry><filename class="directory">/etc/defaults</filename></entry>
|
||||
<entry>系统配置文件的默认版本。</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><filename>/etc/mail</filename></entry>
|
||||
<entry><filename class="directory">/etc/mail</filename></entry>
|
||||
<entry>额外的 &man.sendmail.8; 配置信息,其他 MTA 配置文件。
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><filename>/etc/ppp</filename></entry>
|
||||
<entry><filename class="directory">/etc/ppp</filename></entry>
|
||||
<entry>用于用户级和内核级 ppp 程序的配置。
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><filename>/etc/namedb</filename></entry>
|
||||
<entry><filename class="directory">/etc/namedb</filename></entry>
|
||||
<entry>&man.named.8; 数据的默认位置。通常 <filename>named.conf</filename> 和区域文件存放在这里。</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><filename>/usr/local/etc</filename></entry>
|
||||
<entry><filename class="directory">/usr/local/etc</filename></entry>
|
||||
<entry>被安装的应用程序配置文件。可以参考每个应用程序的子目录。</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><filename>/usr/local/etc/rc.d</filename></entry>
|
||||
<entry><filename class="directory">/usr/local/etc/rc.d</filename></entry>
|
||||
<entry>被安装程序的 启动/停止 脚本。</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><filename>/var/db</filename></entry>
|
||||
<entry><filename class="directory">/var/db</filename></entry>
|
||||
<entry>特定系统自动产生的数据库文件,像 package 数据库,位置数据库等等。</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Simplified Chinese Project
|
||||
|
||||
Original Revision: 1.240
|
||||
Original Revision: 1.244
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -86,7 +86,7 @@
|
|||
|
||||
<listitem>
|
||||
<para>如何使用
|
||||
<application>CVSup</application><!-- ºÍ
|
||||
<application>CVSup</application> 或者文档 ports<!-- 和
|
||||
<application>Docsnap</application>--> 来更新本地的文档。</para>
|
||||
</listitem>
|
||||
|
||||
|
@ -275,7 +275,7 @@ MergeChanges /etc/ /var/named/etc/</programlisting>
|
|||
<programlisting>@daily root freebsd-update cron</programlisting>
|
||||
|
||||
<para>这条记录是说明每天运行一次
|
||||
<command>freebsd-update</command>¡£ÓÃÕâÖÖ·½·¨£¬
|
||||
<command>freebsd-update</command> 工具。 用这种方法,
|
||||
使用了 <option>cron</option> 参数,
|
||||
<command>freebsd-update</command> 仅检查是否存在更新。
|
||||
如果有了新的补丁,就会自动下载到本地的磁盘,
|
||||
|
@ -858,6 +858,198 @@ DOCSUPFILE?= /usr/share/examples/cvsup/doc-supfile</programlisting>
|
|||
&prompt.root; <userinput>make FORMATS='html html-split' install clean</userinput></screen>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="doc-ports">
|
||||
<sect2info>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<firstname>Marc</firstname>
|
||||
<surname>Fonvieille</surname>
|
||||
<contrib>原作: </contrib>
|
||||
</author>
|
||||
</authorgroup>
|
||||
</sect2info>
|
||||
|
||||
<title>使用文档 Ports</title>
|
||||
|
||||
<indexterm><primary>Updating and Upgrading</primary></indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>documentation package</primary>
|
||||
<see>Updating and Upgrading</see>
|
||||
</indexterm>
|
||||
|
||||
<para>在之前的章节中, 我们已展示了从源代码更新 &os; 文档的方法。
|
||||
基于源代码的更新的方法可能并不是对于所有的 &os; 系统都可行有效。
|
||||
编译文档源代码需要一大堆的工具, <emphasis>文档工具链</emphasis>,
|
||||
对于 <application>CVS</application> 的一定了解和从仓库中检出源代码,
|
||||
还有一些编译已检出代码的手工步骤。 这一章节我们将介绍一种使用 Ports
|
||||
来更新已安装的 &os; 文档:</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>下载并安装预编译好的文档快照, 而不用在本地编译任何部份
|
||||
(这样便不再需要安装整个文档工具链了)。</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>下载文档的源代码并使用 ports 框架编译
|
||||
(使得检出和编译的步骤更容易些)。
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>这两种更新 &os; 文档的方法都由一组 &a.doceng; 每月更新的
|
||||
<emphasis>文档 ports</emphasis> 提供支持。 这些都列在了 &os;
|
||||
Ports <ulink url="http://www.freshports.org/docs/">docs</ulink>
|
||||
虚拟分类下面。</para>
|
||||
|
||||
<sect3 id="doc-ports-install-make">
|
||||
<title>编译和安装文档 Ports</title>
|
||||
|
||||
<para>文档 ports 使用 ports 的构建框架使得文档的编译变得更加容易。
|
||||
自动化了检出文档源代码, 配以适合的环境设置和命令行参数运行
|
||||
&man.make.1;, 它们使得安装或卸载文档变得就像安装 &os; 其他
|
||||
port 或二进制包那样容易。</para>
|
||||
|
||||
<note>
|
||||
<para>另一个特性便是当在本地编译文档 ports 时,
|
||||
<emphasis>文档工具链</emphasis> ports 会被列入依赖关系,
|
||||
并自动安装。</para>
|
||||
</note>
|
||||
|
||||
<para>文档 ports 按以下的方式组织:</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>一个 <quote>主 port</quote>, 在
|
||||
<filename role="package">misc/freebsd-doc-en</filename>
|
||||
下可以找到这个文档 port。 它是所有文档 ports 的基础。
|
||||
在默认的情况下, 它只安装英文版文档。</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>一个 <quote>合集 port</quote>,
|
||||
<filename role="package">misc/freebsd-doc-all</filename>,
|
||||
它将构建并安装所有语言版本的所有文档。</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>最后是各种翻译的 <quote>从属 port</quote>, 比如:
|
||||
<filename role="package">misc/freebsd-doc-hu</filename>
|
||||
是匈牙利文版的文档。 所有这些都基于主 port
|
||||
并会安装上对应语言的翻译文档。</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>以 <username>root</username>
|
||||
用户身份运行如下的命令安装文档:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>cd /usr/ports/misc/freebsd-doc-en</userinput>
|
||||
&prompt.root; <userinput>make install clean</userinput></screen>
|
||||
|
||||
<para>这将会安装分章节的英文版本 <acronym>HTML</acronym> 格式文档
|
||||
(与<ulink url="http://www.FreeBSD.org"></ulink> 上的相同) 到
|
||||
<filename class="directory">/usr/local/share/doc/freebsd</filename>
|
||||
目录。</para>
|
||||
|
||||
<sect4 id="doc-ports-options">
|
||||
<title>常见的调节选项</title>
|
||||
|
||||
<para>文档 ports 有许多用来修改默认行为的选项。
|
||||
以下是一段简要列表:</para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><makevar>WITH_HTML</makevar></term>
|
||||
|
||||
<listitem>
|
||||
<para>允许构建 HTML 格式: 每份文档为一个单一的 HTML 文件。
|
||||
此种文档的文件名视情况而定通常是
|
||||
<filename>article.html</filename>,
|
||||
或 <filename>book.html</filename>,
|
||||
另外附加一些图片。</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><makevar>WITH_PDF</makevar></term>
|
||||
|
||||
<listitem>
|
||||
<para>允许构建 &adobe; Portable Document Format,
|
||||
可使用 &adobe; &acrobat.reader;,
|
||||
<application>Ghostscript</application> 或者其他的
|
||||
PDF 阅读器查阅。 此种文档的文件名视情况而定通常是
|
||||
<filename>article.pdf</filename> 或
|
||||
<filename>book.pdf</filename>。</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><makevar>DOCBASE</makevar></term>
|
||||
|
||||
<listitem>
|
||||
<para>文档将被安装到的目录。默认值 <filename
|
||||
class="directory">/usr/local/share/doc/freebsd</filename>。</para>
|
||||
<note>
|
||||
<para>请注意默认的目录与 <application>CVSup</application>
|
||||
方法种所使用的目录不同。 这是因为我们正在安装的是一个 port,
|
||||
而 ports 通常会被安装到
|
||||
<filename class="directory">/usr/local</filename> 目录。
|
||||
这可以指定 <makevar>PREFIX</makevar> 变量覆盖默认值。</para>
|
||||
</note>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
<para>这是一份简短的关于如何使用以上提到变量来安装
|
||||
PDF 格式的匈牙利文档:</para>
|
||||
|
||||
<screen>&prompt.root; cd /usr/ports/misc/freebsd-doc-hu
|
||||
&prompt.root; make -DWITH_PDF DOCBASE=share/doc/freebsd/hu install clean</screen>
|
||||
</sect4>
|
||||
</sect3>
|
||||
|
||||
<sect3 id="doc-ports-install-package">
|
||||
<title>使用文档 Packages</title>
|
||||
|
||||
<para>正如上文所述, 从 ports
|
||||
构建文档需要在本地安装一份文档工具链和一些编译所需的磁盘空间。
|
||||
当不够资源安装文档工具链, 或者从源代码编译需要太多的磁盘空间时,
|
||||
我们仍然可以安装预编译好的文档快照的 ports。</para>
|
||||
|
||||
<para>&a.doceng; 每个月都会制作 &os; 文档快照的包。
|
||||
这些二进制包可以通过包工具来操作, 比如 &man.pkg.add.1;,
|
||||
&man.pkg.delete.1;, 等等。<para>
|
||||
|
||||
<note>
|
||||
<para>当使用二进制包时, 将安装所指定语言相关的 &os; 文档的
|
||||
<emphasis>所有</emphasis> 可用格式。</para>
|
||||
</note>
|
||||
|
||||
<para>举例来说, 以下的命令将安装最新预编译的匈牙利语文档:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>pkg_add -r hu-freebsd-doc</userinput></screen>
|
||||
|
||||
<note>
|
||||
<para>二进制包使用了以下与对应 ports 名称不同的命名格式:
|
||||
<literal><replaceable>lang</replaceable>-freebsd-doc</literal>。
|
||||
这里的 <replaceable>lang</replaceable> 是语言代码的简短形式,
|
||||
比如 <literal>hu</literal> 表示匈牙利语, 或者
|
||||
<literal>zh_cn</literal> 表示简体中文。</para>
|
||||
</note>
|
||||
</sect3>
|
||||
|
||||
<sect3 id="doc-ports-update">
|
||||
<title>更新文档 Ports</title>
|
||||
|
||||
<para>任何用于更新 ports 的工具都可以被用来更新已安装的文档 port。
|
||||
举例来说, 下面的命令通过 <filename
|
||||
role="package">ports-mgmt/portupgrade</filename>
|
||||
工具来更新已安装的匈牙利语文档二进制包。
|
||||
|
||||
<screen>&prompt.root; <userinput>portupgrade -PP hu-freebsd-doc</userinput></screen>
|
||||
</sect3>
|
||||
</sect2>
|
||||
|
||||
<!-- FIXME: Waiting for a working docsnap server... -->
|
||||
<![ IGNORE [
|
||||
<sect2 id="docsnap">
|
||||
|
@ -866,7 +1058,7 @@ DOCSUPFILE?= /usr/share/examples/cvsup/doc-supfile</programlisting>
|
|||
<author>
|
||||
<firstname>Pav</firstname>
|
||||
<surname>Lucistnik</surname>
|
||||
<contrib>Based on information provided by </contrib>
|
||||
<contrib>原作: </contrib>
|
||||
</author>
|
||||
</authorgroup>
|
||||
</sect2info>
|
||||
|
@ -880,54 +1072,45 @@ DOCSUPFILE?= /usr/share/examples/cvsup/doc-supfile</programlisting>
|
|||
<see>Updating and Upgrading</see>
|
||||
</indexterm>
|
||||
|
||||
<para><application>Docsnap</application> is an &man.rsync.1;
|
||||
repository for updating installed &os; Documentation in a
|
||||
relatively easy and fast way. A
|
||||
<quote><application>Docsnap</application> server</quote> tracks
|
||||
the documentation sources, and builds them in HTML format every
|
||||
hour. The <filename role="package">textproc/docproj</filename>
|
||||
is unneeded with <application>Docsnap</application> as only
|
||||
patches to the built documentation exist.</para>
|
||||
<para><application>Docsnap</application> 是一个通过 &man.rsync.1;
|
||||
仓库更新已安装的 &os; 文档简单快速的方法。
|
||||
一台 <quote><application>Docsnap</application> 服务器</quote>
|
||||
跟踪文档原代码, 并每个小时编译自动成 HTML 格式。 使用
|
||||
<application>Docsnap</application> 并不需要
|
||||
<filename role="package">textproc/docproj</filename>,
|
||||
有的只是对已编译文档生成的补丁。</para>
|
||||
|
||||
<para>The only requirement for using this technique is
|
||||
the <filename role="package">net/rsync</filename> port or
|
||||
package. To add it, use the following command:</para>
|
||||
<para>使用这项技术唯一需要的就是
|
||||
<filename role="package">net/rsync</filename> port
|
||||
或者对应的二进制包。 可使用如下的命令安装:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>pkg_add -r rsync</userinput></screen>
|
||||
|
||||
<note>
|
||||
<para><application>Docsnap</application> has been originally
|
||||
developed for updating documentation installed
|
||||
to <filename class="directory">/usr/share/doc</filename>, but
|
||||
the following examples could be adapted for other directories
|
||||
as well. For user directories, it does not require
|
||||
<username>root</username> privileges.</para>
|
||||
<para><application>Docsnap</application> 原本是被用来更新安装到
|
||||
<filename class="directory">/usr/share/doc</filename>
|
||||
的文档, 但是以下的例子同样适用于其他的目录。 对于用户的目录,
|
||||
这样就不需要 <username>root</username> 权限了。</para>
|
||||
</note>
|
||||
|
||||
<para>To update the documentation set, issue the following
|
||||
command:</para>
|
||||
<para>更新文档, 运行如下的命令:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>rsync -rltvz <replaceable>docsnap.sk.FreeBSD.org</replaceable>::docsnap <replaceable>/usr/share/doc</replaceable></userinput></screen>
|
||||
|
||||
<note>
|
||||
<para>There is only one <application>Docsnap</application>
|
||||
server at the moment;
|
||||
the <hostid>docsnap.sk.FreeBSD.org</hostid> shown
|
||||
above.</para>
|
||||
<para>目前还只有上面所显示的 <hostid>docsnap.sk.FreeBSD.org</hostid>
|
||||
这一台 <application>Docsnap</application> 服务器。</para>
|
||||
</note>
|
||||
|
||||
<para>Do not use the <option>--delete</option> flag here as there
|
||||
are some items installed
|
||||
into <filename class="directory">/usr/share/doc</filename>
|
||||
during <command>make installworld</command>, which would
|
||||
accidentally be removed. To clean up, use this command
|
||||
instead:</para>
|
||||
<para>此处不要使用 <option>--delete</option> 标志,
|
||||
因为还有些 <command>make installworld</command> 时安装到
|
||||
<filename class="directory">/usr/share/doc</filename>
|
||||
下的文件可能会被意外的移除。 请使用如下的命令清除无用的文件:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>rsync -rltvz --delete <replaceable>docsnap.sk.FreeBSD.org</replaceable>::docsnap/??_??\.\* <replaceable>/usr/share/doc</replaceable></userinput></screen>
|
||||
|
||||
<para>If a subset of documentation needs to be updated, for
|
||||
example, the English documentation only, the following command
|
||||
should be used:</para>
|
||||
<para>如果只需升级文档的某一子集, 比如,
|
||||
可以使用如下的命令升级文档的英文部分:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>rsync -rltvz <replaceable>docsnap.sk.FreeBSD.org</replaceable>::docsnap/en_US.ISO8859-1 <replaceable>/usr/share/doc</replaceable></userinput></screen>
|
||||
</sect2>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Chinese Project
|
||||
|
||||
Original Revision: 1.86
|
||||
Original Revision: 1.91
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -108,7 +108,7 @@
|
|||
请参考<xref linkend="x11-wm">得到更多完整的有关设定这些桌面环境的信息。</para>
|
||||
|
||||
<para>如果您要找小型的浏览器, 可以试试看
|
||||
<filename role="package">www/dillo</filename>、
|
||||
<filename role="package">www/dillo2</filename>、
|
||||
<filename role="package">www/links</filename> 或
|
||||
<filename role="package">www/w3m</filename>。</para>
|
||||
|
||||
|
@ -220,11 +220,16 @@
|
|||
<keycap>Enter</keycap>。 浏览器将给出一个页面,
|
||||
其中会显示已经安装的插件,
|
||||
您应在这个列表中找到 <application>&java;</application>
|
||||
插件。 如果不是这样的话, 则需要以
|
||||
<username>root</username> 身份执行下列命令:</para>
|
||||
插件。 如果不是这样的话, 每个用户则需要运行如下命令:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>ln -s /usr/local/diablo-jre1.6.0/plugin/i386/ns7/libjavaplugin_oji.so \
|
||||
/usr/local/lib/browser_plugins/</userinput></screen>
|
||||
<screen>&prompt.user; <userinput>ln -s /usr/local/diablo-jre1.6.0/plugin/i386/ns7/libjavaplugin_oji.so \
|
||||
$HOME/.mozilla/plugins/</userinput></screen>
|
||||
|
||||
<para>or, if you installed the <application>Diablo
|
||||
&jdk;</application> package:</para>
|
||||
|
||||
<screen>&prompt.user; <userinput>ln -s /usr/local/diablo-jdk1.6.0/jre/plugin/i386/ns7/libjavaplugin_oji.so \
|
||||
$HOME/.mozilla/plugins/</userinput></screen>
|
||||
|
||||
<para>然后重新启动浏览器。</para>
|
||||
</sect2>
|
||||
|
@ -241,22 +246,59 @@
|
|||
这个 wrapper 也支持 &adobe; &acrobat;、
|
||||
RealPlayer 和很多其他插件。</para>
|
||||
|
||||
<warning>
|
||||
<para>以下的章节涵盖了在近期 -STABLE 分支, &os; 7.1-RELEASE
|
||||
及以上的版本安装 &flash; 9.X。 如果你正在使用一个旧版本的 &os;
|
||||
或者遇到了问题, 你应该安装
|
||||
<filename role="package">www/linux-flashplugin7</filename>
|
||||
并跳过 &man.linprocfs.5; 的部分。</para>
|
||||
</warning>
|
||||
<para>根据你 &os; 版本的不同选择相应的安装步骤:</para>
|
||||
|
||||
<para>应安装 <filename role="package">www/nspluginwrapper</filename>
|
||||
port, 这个 port 需要依赖一个很大的 port
|
||||
<filename role="package">emulators/linux_base</filename>。</para>
|
||||
<procedure>
|
||||
<step>
|
||||
<title>&os; 7.X</title>
|
||||
|
||||
<para>下一步是安装 <filename
|
||||
role="package">www/linux-flashplugin9</filename> port。
|
||||
一旦装好了这个插件,需要用户运行一下
|
||||
<command>nspluginwrapper</command> 命令:</para>
|
||||
<para>安装 <filename
|
||||
role="package">www/nspluginwrapper</filename> port。
|
||||
这个 port 需要安装一个较大的<filename
|
||||
role="package">emulators/linux_base-fc4</filename>
|
||||
port。</para>
|
||||
|
||||
<para>下一步是安装 <filename
|
||||
role="package">www/linux-flashplugin9</filename>
|
||||
port。 这将会安装 &flash; 9.X, 此版本目前能在 &os; 7.X
|
||||
上正常运行。</para>
|
||||
|
||||
<note>
|
||||
<para>在比 &os; 7.1-RELEASE 更旧版本的系统上,
|
||||
你必须安装 <filename
|
||||
role="package">www/linux-flashplugin7</filename>
|
||||
并跳过以下 &man.linprocfs.5; 的部份。</para>
|
||||
</note>
|
||||
</step>
|
||||
|
||||
<step>
|
||||
<title>&os; 8.X</title>
|
||||
|
||||
<para>安装 <filename
|
||||
role="package">www/nspluginwrapper</filename> port。
|
||||
这个 port 需要安装一个较大的<filename
|
||||
role="package">emulators/linux_base-f10</filename>
|
||||
port。</para>
|
||||
|
||||
<para>下一步是安装 <filename
|
||||
role="package">www/linux-f10-flashplugin10</filename> port。
|
||||
这将会安装 &flash; 10.X, 此版本目前能在 &os; 8.X
|
||||
上正常运行。</para>
|
||||
|
||||
<para>这个版本需要创建一个符号链接:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>ln -s /usr/local/lib/npapi/linux-f10-flashplugin/libflashplayer.so \
|
||||
/usr/local/lib/browser_plugins/</userinput></screen>
|
||||
</step>
|
||||
</procedure>
|
||||
|
||||
<para>Once the right &flash; port, according to the &os; version
|
||||
you run,
|
||||
is installed, the plugin must be installed by each
|
||||
user with <command>nspluginwrapper</command>:</para>
|
||||
<para>按照 &os; 版本, 在安装了正确的 &flash; port 之后,
|
||||
插件必须由每个用户运行 <command>nspluginwrapper</command>
|
||||
安装:</para>
|
||||
|
||||
<screen>&prompt.user; <userinput>nspluginwrapper -v -a -i</userinput></screen>
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Simplified Chinese Project
|
||||
|
||||
Original Revision: 1.290
|
||||
Original Revision: 1.291
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -661,14 +661,17 @@ device da
|
|||
device pass
|
||||
device uhci
|
||||
device ohci
|
||||
device ehci
|
||||
device usb
|
||||
device umass</programlisting>
|
||||
|
||||
<para> &man.umass.4; 驱动程序使用 SCSI 子系统来访问 USB 存储设备,
|
||||
您的 USB 设备将被系统看成为一个 SCSI 设备。依靠您主板上的 USB 芯片,
|
||||
您只须选择 <literal>device
|
||||
uhci</literal> 或 <literal>device ohci</literal> 二者之一即可,
|
||||
但是两者都加入内核配置文件当中也没有坏外。
|
||||
uhci</literal> 或用于 USB 1.X 支持的 <literal>device ohci</literal>
|
||||
二者之一即可, 但是两者都加入内核配置文件当中也是无害的。
|
||||
对于 USB 2.X 控制器的支持由 &man.ehci.4; 提供
|
||||
(<literal>device ehci</literal> 这一行)。
|
||||
不要忘了如果您加入了上面的几行要重新编译和安装内核。</para>
|
||||
|
||||
<note>
|
||||
|
@ -680,14 +683,6 @@ device umass</programlisting>
|
|||
<para>由于刻录机被视为 SCSI 设备, 因此, 不应该在内核配置文件中使用
|
||||
&man.atapicam.4; 驱动程序。</para>
|
||||
</note>
|
||||
|
||||
<para>在 &os; 中已经提供了对 USB 2.0 控制器的内建支持;
|
||||
然而, 您必须在编译内核时在配置中加入:</para>
|
||||
|
||||
<programlisting>device ehci</programlisting>
|
||||
|
||||
<para>注意, 如果需要 USB 1.X 的支持, 您仍需要使用
|
||||
&man.uhci.4; 和 &man.ohci.4; 驱动程序。</para>
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
|
@ -784,9 +779,9 @@ umass0: detached</screen>
|
|||
|
||||
<para>除了 <link linkend="disks-adding">Adding
|
||||
Disks</link> 和 <link linkend="mount-unmount">Mounting and
|
||||
Unmounting File Systems</link> 章之外,阅读
|
||||
&man.umass.4;, &man.camcontrol.8;, 和 &man.usbdevs.8;
|
||||
也是很有益的。</para>
|
||||
Unmounting File Systems</link> 章之外, 阅读各种手册页也是有益的:
|
||||
&man.umass.4;, &man.camcontrol.8;, 和 &os; 8.X 的
|
||||
&man.usbconfig.8; 或者对于更早期 &os; 版本的 &man.usbdevs.8;。</para>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
|
@ -2874,7 +2869,7 @@ Filesystem 1K-blocks Used Avail Capacity Mounted on
|
|||
<programlisting>check_quotas="NO"</programlisting>
|
||||
|
||||
<para>最后,要编辑 <filename>/etc/fstab</filename> 文件,以在每一个
|
||||
文件系统基础上雇用磁盘配额。这是启用用户和组配额,或同时启用用户
|
||||
文件系统基础上启用磁盘配额。这是启用用户和组配额,或同时启用用户
|
||||
和组配额的地方。</para>
|
||||
|
||||
<para>要在一个文件系统上启用每个用户的配额,可以在 <filename>/etc/fstab</filename>
|
||||
|
|
|
@ -8,7 +8,7 @@ that might make this chapter too large.
|
|||
|
||||
<!--
|
||||
The FreeBSD Documentation Project
|
||||
Original Revision: 1.7
|
||||
Original Revision: 1.8
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -112,8 +112,8 @@ that might make this chapter too large.
|
|||
简化的调试信息。<acronym>CTF</acronym> 数据是由
|
||||
<command>ctfconvert</command> 和 <command>ctfmerge</command>
|
||||
工具加入二进制文件的。<command>ctfconvert</command>
|
||||
工具分析由编译器生成的 <acronym>DWARF</acronym> 调试
|
||||
<acronym>ELF</acronym> section,
|
||||
工具分析由编译器生成的 <acronym>DWARF</acronym>
|
||||
<acronym>ELF</acronym> 调试 section,
|
||||
<command>ctfmerge</command> 合并目标文件的
|
||||
<acronym>CTF</acronym> <acronym>ELF</acronym> section
|
||||
到可执行文件或共享库。更多关于在启用 &os;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Simplified Chinese Project
|
||||
|
||||
Original Revision: 1.197
|
||||
Original Revision: 1.199
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -265,6 +265,11 @@
|
|||
<entry>文件系统</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>&a.gecko.name;</entry>
|
||||
<entry><application>Gecko 渲染引擎</application> issues</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>&a.geom.name;</entry>
|
||||
<entry>针对 GEOM 的讨论和实现</entry>
|
||||
|
@ -1045,6 +1050,20 @@
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>&a.gecko.name;</term>
|
||||
|
||||
<listitem>
|
||||
<para><emphasis>Gecko 渲染引擎</emphasis></para>
|
||||
|
||||
<para>这是一个讨论 &os; 上 <application>Gecko</application>
|
||||
有关的应用程序的邮件列表。</para>
|
||||
|
||||
<para>围绕 &os; 上 Gecko Ports 应用程序的讨论,
|
||||
以及它们的安装, 开发和支持。</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>&a.geom.name;</term>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<!--
|
||||
The FreeBSD Documentation Project
|
||||
Original Revision: 1.5
|
||||
Original Revision: 1.8
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -100,7 +100,7 @@
|
|||
</sect1>
|
||||
|
||||
<sect1 id="filesystems-zfs">
|
||||
<title>Z 文件系统</title>
|
||||
<title>Z 文件系统 (ZFS)</title>
|
||||
|
||||
<para>Z 文件系统是由 &sun; 开发使用存储池方法的新技术。
|
||||
这就是说只有在需要存储数据的时候空间才会被使用。
|
||||
|
@ -136,7 +136,7 @@
|
|||
既然大部份的驱动都有以模块的形式存在,它们就可以很容易的通过
|
||||
<filename>/boot/loader.conf</filename> 加载。</para>
|
||||
|
||||
<para>i386 构架的用户应在内核配置文件中加入以下的选项,
|
||||
<para>&i386; 构架的用户应在内核配置文件中加入以下的选项,
|
||||
重新编译内核并重启机器:</para>
|
||||
|
||||
<programlisting>options KVA_PAGES=512</programlisting>
|
||||
|
@ -177,18 +177,19 @@ vfs.zfs.vdev.cache.size="5M"</programlisting>
|
|||
<screen>&prompt.root; <userinput>echo 'zfs_enable="YES"' >> /etc/rc.conf</userinput>
|
||||
&prompt.root; <userinput>/etc/rc.d/zfs start</userinput></screen>
|
||||
|
||||
<para>这份文档剩余的部分假定系统中有2块
|
||||
<para>这份文档剩余的部分假定系统中有 3 块
|
||||
<acronym>SCSI</acronym> 磁盘可用,
|
||||
它们的设备名分别为
|
||||
<devicename><replaceable>da0</replaceable></devicename>
|
||||
和 <devicename><replaceable>da1</replaceable></devicename>。
|
||||
<devicename><replaceable>da0</replaceable></devicename>,
|
||||
<devicename><replaceable>da1</replaceable></devicename>
|
||||
和 <devicename><replaceable>da2</replaceable></devicename>。
|
||||
<acronym>IDE</acronym> 硬件的用户可以使用
|
||||
<devicename><replaceable>ad</replaceable></devicename>
|
||||
代替 <acronym>SCSI</acronym>。</para>
|
||||
<sect3>
|
||||
<title>单个磁盘存储池</title>
|
||||
|
||||
<para>在单个磁盘上创建 <acronym>ZFS</acronym>,
|
||||
<para>在单个磁盘上创建一个简单, 非冗余的 <acronym>ZFS</acronym>,
|
||||
使用 <command>zpool</command> 命令:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>zpool create example /dev/da0</userinput></screen>
|
||||
|
@ -312,14 +313,22 @@ example/data 17547008 0 17547008 0% /example/data</screen>
|
|||
<sect3>
|
||||
<title><acronym>ZFS</acronym> RAID-Z</title>
|
||||
|
||||
<para>正如前文中所提到的,这一章节将假设存在两个
|
||||
<para>正如前文中所提到的,这一章节将假设存在 3 个
|
||||
<acronym>SCSI</acronym> 设备,
|
||||
<devicename>da0</devicename> 和
|
||||
<devicename>da1</devicename>。
|
||||
使用如下的命令创建一个 <acronym>RAID</acronym>-Z
|
||||
存储池:</para>
|
||||
<devicename>da0</devicename>, <devicename>da1</devicename>
|
||||
和 <devicename>da2</devicename> (或者 <devicename>ad0</devicename>
|
||||
和超出此例使用了 IDE 磁盘)。 使用如下的命令创建一个
|
||||
<acronym>RAID</acronym>-Z 存储池:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>zpool create storage raidz da0 da1</userinput></screen>
|
||||
<screen>&prompt.root; <userinput>zpool create storage raidz da0 da1 da2</userinput></screen>
|
||||
|
||||
<note><para>&sun; 推荐在一个 <acronym>RAID</acronym>-Z
|
||||
配置中使用的磁盘数量为 3 至 9 块。
|
||||
如果你要求在单独的一个存储池中使用 10 块或更多的磁盘,
|
||||
请考虑分拆成更小 <acronym>RAID</acronym>-z 组。
|
||||
如果你只有 2 块磁盘, 并仍然需要冗余,
|
||||
请考虑使用 <acronym>ZFS</acronym> 的 mirror 特性。
|
||||
更多细节请参考 &man.zpool.8; 手册页。</para></note>
|
||||
|
||||
<para>zpool <literal>storage</literal> 至此就创建好了。
|
||||
可以如前文提到的那样使用 &man.mount.8; 和 &man.df.1; 确认。
|
||||
|
@ -395,8 +404,8 @@ Filesystem 1K-blocks Used Avail Capacity Mounted on
|
|||
/dev/ad0s1a 2026030 235240 1628708 13% /
|
||||
devfs 1 1 0 100% /dev
|
||||
/dev/ad0s1d 54098308 1032826 48737618 2% /usr
|
||||
storage 17547008 0 17547008 0% /storage
|
||||
storage/home 17547008 0 17547008 0% /home</screen>
|
||||
storage 26320512 0 26320512 0% /storage
|
||||
storage/home 26320512 0 26320512 0% /home</screen>
|
||||
|
||||
<para>这样就基本完成了 <acronym>RAID</acronym>-Z
|
||||
的配置了。使用夜间 &man.periodic.8;
|
||||
|
@ -440,6 +449,7 @@ config:
|
|||
raidz1 DEGRADED 0 0 0
|
||||
da0 ONLINE 0 0 0
|
||||
da1 OFFLINE 0 0 0
|
||||
da2 ONLINE 0 0 0
|
||||
|
||||
errors: No known data errors</screen>
|
||||
|
||||
|
@ -468,6 +478,7 @@ config:
|
|||
raidz1 ONLINE 0 0 0
|
||||
da0 ONLINE 0 0 0
|
||||
da1 ONLINE 0 0 0
|
||||
da2 ONLINE 0 0 0
|
||||
|
||||
errors: No known data errors</screen>
|
||||
|
||||
|
@ -511,6 +522,7 @@ config:
|
|||
raidz1 ONLINE 0 0 0
|
||||
da0 ONLINE 0 0 0
|
||||
da1 ONLINE 0 0 0
|
||||
da2 ONLINE 0 0 0
|
||||
|
||||
errors: No known data errors</screen>
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>&os; 中内建的集中防火墙之间的差异。</para>
|
||||
<para>&os; 中内建的几种防火墙之间的差异。</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Simplified Chinese Project
|
||||
|
||||
Original Revision: 1.133
|
||||
Original Revision: 1.135
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -433,6 +433,11 @@
|
|||
</para>
|
||||
</listitem>
|
||||
|
||||
<indexterm><primary>网易</primary></indexterm>
|
||||
<listitem>
|
||||
<para><ulink url="http://www.163.com/">NetEase</ulink></para>
|
||||
</listitem>
|
||||
|
||||
<indexterm><primary>Weathernews</primary></indexterm>
|
||||
<listitem>
|
||||
<para><ulink url="http://www.wni.com/">Weathernews</ulink>
|
||||
|
@ -597,7 +602,7 @@
|
|||
<para>其后在 2005 年 7 月又建立了 RELENG_6 分支。 而 6.X 分支上的第一个版本,
|
||||
即 6.0-RELEASE, 则是在 2005 年 11 月发布的。
|
||||
最新的 &rel2.current;-RELEASE 发布于 &rel2.current.date;。
|
||||
这很可能是我们发布的最后一个 RELENG_6 的发行版本。</para>
|
||||
RELENG_6 分支上不再会有发布版本了。</para>
|
||||
|
||||
<para>RELENG_7 分支于 2007 年 10 月创建。
|
||||
第一个这个分支的发行版是 7.0-RELEASE, 这个版本是 2008 年 2 月发布的。
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Simplified Chinese Project
|
||||
|
||||
Original Revision: 1.17
|
||||
Original Revision: 1.18
|
||||
$FreeBSD$
|
||||
-->
|
||||
<chapter id="jails">
|
||||
|
@ -203,7 +203,8 @@
|
|||
<screen>&prompt.root; <userinput>setenv D <replaceable>/here/is/the/jail</replaceable></userinput>
|
||||
&prompt.root; <userinput>mkdir -p $D</userinput> <co id="jailpath">
|
||||
&prompt.root; <userinput>cd /usr/src</userinput>
|
||||
&prompt.root; <userinput>make world DESTDIR=$D</userinput> <co id="jailworld">
|
||||
&prompt.root; <userinput>make buildworld</userinput> <co id="jailbuildworld">
|
||||
&prompt.root; <userinput>make installworld DESTDIR=$D</userinput> <co id="jailinstallworld">
|
||||
&prompt.root; <userinput>cd etc/</userinput> <footnote><para>在 &os; 6.0 及
|
||||
之后的版本中不必须进行这个步骤。</para></footnote>
|
||||
&prompt.root; <userinput>make distribution DESTDIR=$D</userinput> <co id="jaildistrib">
|
||||
|
@ -220,10 +221,15 @@
|
|||
它通常包含了 &os; 默认安装的基本系统中每个文件的副本。</para>
|
||||
</callout>
|
||||
|
||||
<callout arearefs="jailworld">
|
||||
<para>这个命令将在 jail 目录中安装所需的可执行文件、 函数库以及联机手册等。
|
||||
这些是以传统的 &os; 风格的方式完成的 — 首先联编所有的文件,
|
||||
然后将其安装到目标路径。</para>
|
||||
<callout arearefs="jailbuildworld">
|
||||
<para>如果你已经通过使用 <command>make world</command>
|
||||
或者 <command>make buildworld</command> 重新编译过了你的 userland,
|
||||
则可以跳过这一步骤并把现有的 userland 安装进新的 jail。</para>
|
||||
</callout>
|
||||
|
||||
<callout arearefs="jailinstallworld">
|
||||
<para>这个命令将在 jail 目录中安装所需的可执行文件、
|
||||
函数库以及联机手册等。</para>
|
||||
</callout>
|
||||
|
||||
<callout arearefs="jaildistrib">
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Chinese Documentation Project
|
||||
|
||||
Original Revision: 1.190
|
||||
Original Revision: 1.192
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -71,28 +71,28 @@
|
|||
<sect1 id="kernelconfig-custom-kernel">
|
||||
<title>为什么需要建立定制的内核?</title>
|
||||
|
||||
<para>过去, &os; 采用称作 <quote>单片式</quote> 的内核。
|
||||
这句话的意思是说内核是一个大的程序, 支持固定的设备,
|
||||
如果您希望改变内核的行为则必须编译一个新的,
|
||||
并重新启动计算机来引导它。</para>
|
||||
<para>过去, &os; 采用的是被人们称作
|
||||
<quote>单片式</quote> 的内核。 这种内核本身是一个大的程序,
|
||||
它支持的设备不能够动态地加以改变,
|
||||
而当希望改变内核的行为时, 就必须编译一个新的内核,
|
||||
并重新启动计算机才可以使用它。</para>
|
||||
|
||||
<para>今天, &os; 已经迅速地转移到了一个新的模型,
|
||||
其重要特征是内核功能可以由能够根据需要动态加载和卸载的模块来提供。
|
||||
这使得内核能够迅速地适应硬件的调整 (例如笔记本电脑的 PCMCIA),
|
||||
或为内核增加在最初编译它时所不具备的新的功能。
|
||||
这一模式成为模块化内核。</para>
|
||||
<para>如今, &os; 正在迅速地迁移到一种新的模型,
|
||||
其特点是将大量内核功能放进可以动态加载和卸载的内核模块来提供。
|
||||
这使得内核能够适应硬件的调整 (例如笔记本计算机中的 PCMCIA 卡),
|
||||
以及为内核引入新的功能, 而无需在编译内核时就将其添加进去。
|
||||
这种做法称为模块化内核。</para>
|
||||
|
||||
<para>尽管如此, 一些功能仍然需要静态地连编进内核。
|
||||
一些情况是因为这些功能于内核的结合十分紧密,
|
||||
而不可能将它们做成可以动态加载的。
|
||||
另一种情况是因为没有人有时间来编写实现那个功能的可以动态加载的内核模块。</para>
|
||||
<para>尽管如此, 仍然有一些功能需要静态地联编进内核。
|
||||
有时, 这是由于这些功能与内核的结合非常紧密而无法实现动态加载,
|
||||
还有一些情况是暂时没有人将这些功能改写为可动态加载的模块。</para>
|
||||
|
||||
<para>建造定制的内核是几乎每一个 BSD 用户所必须经历的一关。
|
||||
尽管这项工作可能比较耗时, 但它能够为使用 &os; 系统带来很多好处。
|
||||
与必须支持大量各式硬件的 <filename>GENERIC</filename>
|
||||
内核不同, 定制的内核可以只包含对于
|
||||
<emphasis>您的</emphasis> PC 硬件的支持。
|
||||
这有很多好处, 例如:</para>
|
||||
<para>联编定制的内核是成为高级 BSD 用户所必须经历的一关。
|
||||
尽管这一过程需要花费一些时间, 但它能够为您的 &os; 系统带来一些好处。
|
||||
与必须支持大量硬件的 <filename>GENERIC</filename> 内核不同,
|
||||
定制的内核可以只包含对于
|
||||
<emphasis>您</emphasis> PC 硬件的支持。
|
||||
这样做有很多好处, 例如:</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
|
@ -101,11 +101,11 @@
|
|||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>使用更少的内存。 定制的内核通常会比
|
||||
<filename>GENERIC</filename> 内核使用更少的内存,
|
||||
由于内核必须时刻处于物理内存中, 因此这就显得更加重要。
|
||||
基于这样的原因, 对于内存较小的系统来说,
|
||||
定制内核将发挥更大的作用。</para>
|
||||
<para>使用更少的内存。 由于可以删去不需要的功能和设备驱动,
|
||||
通常定制的内核会比 <filename>GENERIC</filename> 使用的内存更少。
|
||||
节省内核使用的内存之所以重要是因为内核必须常驻于物理内存中,
|
||||
从而使应用程序能够用到更多的内存。 正因为这样,
|
||||
对 RAM 较小的系统来说定制内核就更为重要了。</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
|
@ -202,7 +202,7 @@ ath_hal(4) - Atheros Hardware Access Layer (HAL)</programlisting>
|
|||
中,并能由 &man.kldload.8; 命令加载入正在运行的内核。
|
||||
基本上所有的内核驱动都有特定的模块和手册页。比如,
|
||||
下面提到的 <devicename>ath</devicename> 无线以太网驱动。
|
||||
在这个设备的手册页中有以下信息:</para>
|
||||
在这个设备的联机手册中有以下信息:</para>
|
||||
|
||||
<programlisting>Alternatively, to load the driver as a module at boot time, place the
|
||||
following line in &man.loader.conf.5:
|
||||
|
@ -451,6 +451,31 @@ following line in &man.loader.conf.5:
|
|||
<filename>/usr/src/sys/conf/NOTES</filename>
|
||||
找到。</para>
|
||||
|
||||
<para>从 &os; 5.0 开始, 配置文件中新增了 <literal>include</literal> 语句。
|
||||
这个语句能够在内核配置文件中直接引用其他配置文件的内容,
|
||||
使得您能够使用较小的、 仅包含相对于现存配置的变动而减少维护所需的工作。
|
||||
例如, 如果您只需对 <filename>GENERIC</filename> 内核进行少量定制,
|
||||
在其中添加几个驱动程序和附加选项, 则只要维护相对于 GENERIC
|
||||
的变化就可以了:</para>
|
||||
|
||||
<programlisting>include GENERIC
|
||||
ident MYKERNEL
|
||||
|
||||
options IPFIREWALL
|
||||
options DUMMYNET
|
||||
options IPFIREWALL_DEFAULT_TO_ACCEPT
|
||||
options IPDIVERT
|
||||
</programlisting>
|
||||
|
||||
<para>许多系统管理员会发现, 这种方法与先前从头开始写配置文件的方法相比,
|
||||
可以带开相当多的好处: 本地采用的配置文件只表达与
|
||||
<filename>GENERIC</filename> 内核的差异, 这样,
|
||||
在升级的时候往往就不需要做任何改动,
|
||||
而新加入 <filename>GENERIC</filename> 的功能就会自动加入到本地的内核,
|
||||
除非使用
|
||||
<literal>nooptions</literal> 或 <literal>nodevice</literal> 语句将其排除。
|
||||
这一章余下的部分将着重介绍典型的配置文件, 以及内核选项和设备的作用。</para>
|
||||
|
||||
<note>
|
||||
<para>如果您需要一份包含所有选项的文件,
|
||||
例如用于测试目的, 则应以 <username>root</username> 身份执行下列命令:</para>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!--
|
||||
The FreeBSD Documentation Project
|
||||
|
||||
Original Revision: 1.136
|
||||
Original Revision: 1.139
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -145,9 +145,17 @@ Id Refs Address Size Name
|
|||
<para>这是最容易的安装方法,只需要像安装其他port一样从
|
||||
<ulink type="html" url="file://localhost/usr/ports/">Ports Collection</ulink>来安装:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>cd /usr/ports/emulators/linux_base-fc4</userinput>
|
||||
<screen>&prompt.root; <userinput>cd /usr/ports/emulators/linux_base-f10</userinput>
|
||||
&prompt.root; <userinput>make install distclean</userinput></screen>
|
||||
|
||||
<note>
|
||||
<para>对于 &os; 8.0 之前的版本的 &os; 系统,
|
||||
你需要使用 <filename
|
||||
role="package">emulators/linux_base-fc4</filename> port
|
||||
而不是 <filename
|
||||
role="package">emulators/linux_base-f10</filename>。</para>
|
||||
</note>
|
||||
|
||||
<para>
|
||||
您现在应当是工作在Linux兼容模式下了。一些程序可能会提示系统库的版本不正确。通常,这不是问题。</para>
|
||||
|
||||
|
@ -261,6 +269,22 @@ Abort</screen>
|
|||
<para>GNU工具现在会自动把适当的标记信息放到ELF程序中,您以后遇到这个问题的机会越来越少。</para>
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<title>安装各种基于 RPM 的应用程序</title>
|
||||
|
||||
<para>FreeBSD 使用自己的包数据库来跟踪所有的 ports (包括 &linux; ports)。
|
||||
所以无法使用(不支持) &linux; RPM 数据库。</para>
|
||||
|
||||
<para>如果你需要安装任意的一个基于 RPM 的 &linux; 应用程序,
|
||||
可以通过一下的步骤完成:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>cd /compat/linux</userinput>
|
||||
&prompt.root; <userinput>rpm2cpio -q < /path/to/linux.archive.rpm | cpio -id</userinput></screen>
|
||||
|
||||
<para>然后对已安装的 ELF 二进制程序(不包括库)运行 brandelf。
|
||||
用此种方法安装的程序不能被完全卸载, 但是可能有助于做些测试。</para>
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<title>配置主机名解析器</title>
|
||||
|
||||
|
@ -1502,7 +1526,7 @@ with 128 MB
|
|||
<para>首先<link linkend="linuxemu-libs-port">linux_base</link>
|
||||
port需要安装(以<username>root</username>身份):</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>cd /usr/ports/emulators/linux_base</userinput>
|
||||
<screen>&prompt.root; <userinput>cd /usr/ports/emulators/linux_base-fc4</userinput>
|
||||
&prompt.root; <userinput>make install distclean</userinput></screen>
|
||||
|
||||
</sect3>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Chinese Documentation Project
|
||||
|
||||
Original Revision: 1.458
|
||||
Original Revision: 1.464
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -182,6 +182,17 @@
|
|||
</address>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<address>
|
||||
<otheraddr>LinuxCenter.Kz</otheraddr>
|
||||
<city>Ust-Kamenogorsk</city>
|
||||
<country>Kazakhstan</country>
|
||||
Phone: <phone>+7-705-501-6001</phone>
|
||||
Email: <email>info@linuxcenter.kz</email>
|
||||
WWW: <otheraddr><ulink url="http://linuxcenter.kz/page.php?page=fr"></ulink></otheraddr>
|
||||
</address>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<address>
|
||||
<otheraddr>LinuxCenter.Ru</otheraddr>
|
||||
|
@ -2302,6 +2313,15 @@ doc/zh_*</screen>
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>RELENG_7_2</term>
|
||||
|
||||
<listitem>
|
||||
<para>FreeBSD-7.2 的发行版分支, 只用于安全公告,
|
||||
以及其他重要更新。</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>RELENG_7_1</term>
|
||||
|
||||
|
@ -2560,6 +2580,14 @@ doc/zh_*</screen>
|
|||
最后, <filename class="directory">www</filename> 树上不会有任何特定发行版的标签。</para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>RELENG_7_2_0_RELEASE</term>
|
||||
|
||||
<listitem>
|
||||
<para>FreeBSD 7.2</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>RELENG_7_1_0_RELEASE</term>
|
||||
|
||||
|
@ -2964,7 +2992,7 @@ doc/zh_*</screen>
|
|||
|
||||
<para>可用的 collection:</para>
|
||||
<itemizedlist>
|
||||
<listitem><para>vol/4/freebsd-core: 对于
|
||||
<listitem><para>FreeBSD: 对于
|
||||
FreeBSD FTP 服务器的完整镜像。</para></listitem>
|
||||
</itemizedlist>
|
||||
</listitem>
|
||||
|
@ -3004,11 +3032,11 @@ doc/zh_*</screen>
|
|||
<term>英国</term>
|
||||
|
||||
<listitem>
|
||||
<para>rsync://rsync.mirror.ac.uk/</para>
|
||||
<para>rsync://rsync.mirrorservice.org/</para>
|
||||
|
||||
<para>可用的 collection:</para>
|
||||
<itemizedlist>
|
||||
<listitem><para>ftp.FreeBSD.org: FreeBSD FTP 服务器
|
||||
<listitem><para>sites/ftp.FreeBSD.org: FreeBSD FTP 服务器
|
||||
的完整镜像。</para></listitem>
|
||||
</itemizedlist>
|
||||
</listitem>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Simplified Chinese Documentation Project
|
||||
|
||||
Original Revision: 1.130
|
||||
Original Revision: 1.132
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -351,15 +351,20 @@ kld snd_ich (1p/2r/0v channels duplex default)</screen>
|
|||
|
||||
<para>使用两条sysctl命令来设置虚拟声道的数目。 如果您是
|
||||
<username>root</username> 用户, 执行下面的操作:</para>
|
||||
<screen>&prompt.root; <userinput>sysctl hw.snd.pcm0.vchans=4</userinput>
|
||||
<screen>&prompt.root; <userinput>sysctl dev.pcm.0.play.vchans=4</userinput>
|
||||
&prompt.root; <userinput>sysctl dev.pcm.0.rec.vchans=4</userinput>
|
||||
&prompt.root; <userinput>sysctl hw.snd.maxautovchans=4</userinput></screen>
|
||||
|
||||
<para>上面的实例设定了4个虚拟声道,这也是实际上所使用的数目。<varname>hw.snd.pcm0.vchans</varname>
|
||||
是 <devicename>pcm0</devicename> 的虚拟声道数,一当链接上一个设备它就可配置了。
|
||||
<para>上面的实例设定了4个虚拟声道,这也是实际上所使用的数目。
|
||||
<varname>dev.pcm.0.play.vchans=4</varname> 和
|
||||
<varname>dev.pcm.0.rec.vchans=4</varname>
|
||||
是 <devicename>pcm0</devicename> 用来播放与录音的虚拟声道数,
|
||||
一当链接上一个设备它就可配置了。
|
||||
<literal>hw.snd.maxautovchans</literal> 是分配给新的音频设备的虚拟声道数,
|
||||
此时这个设备要用 &man.kldload.8; 来链接。 因为 <devicename>pcm</devicename>
|
||||
模块可以独立装载许多硬件驱动程序, 因此 <varname>hw.snd.maxautovchans</varname>
|
||||
也就可以存储分配给以后链接到的设备的虚拟声道数。</para>
|
||||
也就可以存储分配给以后链接到的设备的虚拟声道数。
|
||||
可参阅 &man.pcm.4; 手册页义获取更多细节。</para>
|
||||
|
||||
<note>
|
||||
<para>您不能在使用某个设备的时候改变其虚拟通道数。
|
||||
|
@ -369,7 +374,7 @@ kld snd_ich (1p/2r/0v channels duplex default)</screen>
|
|||
<para>如果不使用 &man.devfs.5;, 就必须把应用程序指向
|
||||
<filename>/dev/dsp0</filename>.<replaceable>x</replaceable>,
|
||||
其中 <replaceable>x</replaceable> 为0到3, 因为在上面的例子里
|
||||
<varname>hw.snd.pcm.0.vchans</varname> 被设为了4。
|
||||
<varname>dev.pcm.0.rec.vchans</varname> 被设为了4。
|
||||
在使用 &man.devfs.5; 的系统中, 当应用程序请求 <filename>/dev/dsp0</filename>
|
||||
时, 系统会自动为其分配一个而无需额外干预。</para>
|
||||
</sect2>
|
||||
|
@ -441,9 +446,12 @@ kld snd_ich (1p/2r/0v channels duplex default)</screen>
|
|||
|
||||
<para><application>mpg123</application>
|
||||
可以在执行时通过命令行指定声音设备和要播放的 MP3
|
||||
文件, 如下所示:</para>
|
||||
文件, 假设你的声音设备是 <devicename>/dev/dsp1.0</devicename>
|
||||
并且你想要播放的 MP3 文件为
|
||||
<replaceable>Foobar-GreatestHits.mp3</replaceable>
|
||||
你可以键入以下的命令:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>mpg123 -a <replaceable>/dev/dsp1.0</replaceable> Foobar-GreatestHits.mp3</userinput>
|
||||
<screen>&prompt.root; <userinput>mpg123 -a <devicename>/dev/dsp1.0</devicename> <replaceable>Foobar-GreatestHits.mp3</replaceable></userinput>
|
||||
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layer 1, 2 and 3.
|
||||
Version 0.59r (1999/Jun/15). Written and copyrights by Michael Hipp.
|
||||
Uses code from various people. See 'README' for more!
|
||||
|
@ -456,10 +464,6 @@ THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! USE AT YOUR OWN RISK!
|
|||
Playing MPEG stream from Foobar-GreatestHits.mp3 ...
|
||||
MPEG 1.0 layer III, 128 kbit/s, 44100 Hz joint-stereo
|
||||
</screen>
|
||||
|
||||
<para>前面的 <filename><replaceable>/dev/dsp1.0</replaceable></filename> 应换成您系统上对应的
|
||||
<devicename>dsp</devicename> 设备。</para>
|
||||
|
||||
</sect2>
|
||||
|
||||
<sect2 id="rip-cd">
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Simplified Chinese Project
|
||||
|
||||
Original Revision: 1.116
|
||||
Original Revision: 1.118
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -2236,12 +2236,12 @@ nis_client_flags="-S <replaceable>NIS domain</replaceable>,<replaceable>server</
|
|||
<see>DHCP</see>
|
||||
</indexterm>
|
||||
<indexterm>
|
||||
<primary>Internet Software Consortium (ISC)</primary>
|
||||
<primary>Internet Systems Consortium (ISC)</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>DHCP, 动态主机配置协议, 是一种让系统得以连接到网络上,
|
||||
并获取所需要的配置参数手段。 FreeBSD 6.0 之前的版本,
|
||||
采用的是 ISC (Internet Software
|
||||
采用的是 ISC (Internet Systems
|
||||
Consortium) 的 DHCP 客户端 (&man.dhclient.8;) 实现。
|
||||
更高版本使用的则是来自 OpenBSD 3.7
|
||||
的 OpenBSD <command>dhclient</command>。
|
||||
|
@ -2415,7 +2415,7 @@ dhclient_flags=""</programlisting>
|
|||
<title>这一章包含哪些内容</title>
|
||||
|
||||
<para>这一章提供了关于如何在 FreeBSD 系统上使用 ISC
|
||||
(Internet 软件协会) 的 DHCP 实现套件来架设 DHCP 服务器的信息。</para>
|
||||
(Internet 系统协会) 的 DHCP 实现套件来架设 DHCP 服务器的信息。</para>
|
||||
|
||||
<para>DHCP 套件中的服务器部分并没有作为 FreeBSD 的一部分来提供,
|
||||
因此您需要安装
|
||||
|
@ -2651,8 +2651,8 @@ dhcpd_ifaces="dc0"</programlisting>
|
|||
提供少量域名解析服务并对域名信息进行缓存的域名服务器组成的。</para>
|
||||
|
||||
<para>目前, BIND 由
|
||||
Internet Software Consortium
|
||||
<ulink url="http://www.isc.org/"></ulink>
|
||||
Internet Systems Consortium
|
||||
<ulink url="https://www.isc.org/"></ulink>
|
||||
维护。</para>
|
||||
</sect2>
|
||||
|
||||
|
@ -2690,7 +2690,7 @@ dhcpd_ifaces="dc0"</programlisting>
|
|||
</row>
|
||||
|
||||
<row>
|
||||
<entry><application>named</application>, BIND, 域名服务器</entry>
|
||||
<entry><application>named</application>, BIND</entry>
|
||||
<entry>在 &os; 中 BIND 域名服务器软件包的常见叫法。</entry>
|
||||
</row>
|
||||
|
||||
|
@ -2701,7 +2701,7 @@ dhcpd_ifaces="dc0"</programlisting>
|
|||
|
||||
<row>
|
||||
<entry>反向 <acronym>DNS</acronym></entry>
|
||||
<entry>与正向 <acronym>DNS</acronym> 相对; 将 <acronym>IP</acronym> 地址映射为主机名</entry>
|
||||
<entry>将 <acronym>IP</acronym> 地址映射为主机名</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
|
@ -2728,7 +2728,7 @@ dhcpd_ifaces="dc0"</programlisting>
|
|||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para><hostid>.</hostid> 是根域。</para>
|
||||
<para><hostid>.</hostid> 在本文档中通常指代根域。</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
|
@ -2806,7 +2806,7 @@ dhcpd_ifaces="dc0"</programlisting>
|
|||
<sect2>
|
||||
<title>DNS 如何运作</title>
|
||||
<para>在 &os; 中, BIND 服务程序被称为
|
||||
<application>named</application>, 其原因显而易见。</para>
|
||||
<application>named</application>。</para>
|
||||
|
||||
<informaltable frame="none" pgwide="1">
|
||||
<tgroup cols="2">
|
||||
|
@ -2852,6 +2852,7 @@ dhcpd_ifaces="dc0"</programlisting>
|
|||
|
||||
<sect2>
|
||||
<title>启动 BIND</title>
|
||||
|
||||
<indexterm>
|
||||
<primary>BIND</primary>
|
||||
<secondary>starting (启动)</secondary>
|
||||
|
@ -2860,10 +2861,11 @@ dhcpd_ifaces="dc0"</programlisting>
|
|||
<para>由于 BIND 是默认安装的, 因此配置它相对而言很简单。</para>
|
||||
|
||||
<para>默认的 <application>named</application> 配置, 是在
|
||||
&man.chroot.8; 环境中提供基本的域名解析服务。
|
||||
&man.chroot.8; 环境中提供基本的域名解析服务,
|
||||
并且只限于监听本地 IPv4 回环地址 (127.0.0.1)。
|
||||
如果希望启动这一配置, 可以使用下面的命令:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>/etc/rc.d/named forcestart</userinput></screen>
|
||||
<screen>&prompt.root; <userinput>/etc/rc.d/named onestart</userinput></screen>
|
||||
|
||||
<para>如果希望 <application>named</application>
|
||||
服务在每次启动的时候都能够启动, 需要在
|
||||
|
@ -2883,6 +2885,7 @@ dhcpd_ifaces="dc0"</programlisting>
|
|||
|
||||
<sect2>
|
||||
<title>配置文件</title>
|
||||
|
||||
<indexterm>
|
||||
<primary>BIND</primary>
|
||||
<secondary>configuration files (配置文件)</secondary>
|
||||
|
@ -2894,23 +2897,6 @@ dhcpd_ifaces="dc0"</programlisting>
|
|||
除非您只打算让它完成简单的域名解析服务。
|
||||
这个目录同时也是您进行绝大多数配置的地方。</para>
|
||||
|
||||
<sect3>
|
||||
<title>使用 <command>make-localhost</command></title>
|
||||
|
||||
<para>要为 localhost 配置权威域, 需要进入
|
||||
<filename class="directory">/etc/namedb</filename> 目录,
|
||||
并运行下面的命令:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>sh make-localhost</userinput></screen>
|
||||
|
||||
<para>如果一切正常的话, 在
|
||||
<filename class="directory">master</filename> 子目录中会增加一组文件。
|
||||
本地域名对应的文件是 <filename>localhost.rev</filename>,
|
||||
而 <acronym>IPv6</acronym> 对应的配置则是 <filename>localhost-v6.rev</filename>。
|
||||
作为默认配置, 所需的信息已经放到了
|
||||
<filename>named.conf</filename> 文件中。</para>
|
||||
</sect3>
|
||||
|
||||
<sect3>
|
||||
<title><filename>/etc/namedb/named.conf</filename></title>
|
||||
|
||||
|
@ -2925,6 +2911,7 @@ dhcpd_ifaces="dc0"</programlisting>
|
|||
// or cause huge amounts of useless Internet traffic.
|
||||
|
||||
options {
|
||||
// Relative to the chroot directory, if any
|
||||
directory "/etc/namedb";
|
||||
pid-file "/var/run/named/pid";
|
||||
dump-file "/var/dump/named_dump.db";
|
||||
|
@ -2940,11 +2927,11 @@ options {
|
|||
// an IPv6 address, or the keyword "any".
|
||||
// listen-on-v6 { ::1; };
|
||||
|
||||
// In addition to the "forwarders" clause, you can force your name
|
||||
// server to never initiate queries of its own, but always ask its
|
||||
// forwarders only, by enabling the following line:
|
||||
//
|
||||
// forward only;
|
||||
// These zones are already covered by the empty zones listed below.
|
||||
// If you remove the related empty zones below, comment these lines out.
|
||||
disable-empty-zone "255.255.255.255.IN-ADDR.ARPA";
|
||||
disable-empty-zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA";
|
||||
disable-empty-zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA";
|
||||
|
||||
// If you've got a DNS server around at your upstream provider, enter
|
||||
// its IP address here, and enable the line below. This will make you
|
||||
|
@ -2953,7 +2940,20 @@ options {
|
|||
forwarders {
|
||||
127.0.0.1;
|
||||
};
|
||||
*/</programlisting>
|
||||
*/
|
||||
|
||||
// If the 'forwarders' clause is not empty the default is to 'forward first'
|
||||
// which will fall back to sending a query from your local server if the name
|
||||
// servers in 'forwarders' do not have the answer. Alternatively you can
|
||||
// force your name server to never initiate queries of its own by enabling the
|
||||
// following line:
|
||||
// forward only;
|
||||
|
||||
// If you wish to have forwarding configured automatically based on
|
||||
// the entries in /etc/resolv.conf, uncomment the following line and
|
||||
// set named_auto_forward=yes in /etc/rc.conf. You can also enable
|
||||
// named_auto_forward_only (the effect of which is described above).
|
||||
// include "/etc/namedb/auto_forward.conf";</programlisting>
|
||||
|
||||
<para>正如注释所言, 如果希望从上级缓存中受益,
|
||||
可以在此处启用 <literal>forwarders</literal>。
|
||||
|
@ -2969,34 +2969,187 @@ options {
|
|||
</warning>
|
||||
|
||||
<programlisting> /*
|
||||
* If there is a firewall between you and nameservers you want
|
||||
* to talk to, you might need to uncomment the query-source
|
||||
* directive below. Previous versions of BIND always asked
|
||||
* questions using port 53, but BIND versions 8 and later
|
||||
* use a pseudo-random unprivileged UDP port by default.
|
||||
*/
|
||||
// query-source address * port 53;
|
||||
Modern versions of BIND use a random UDP port for each outgoing
|
||||
query by default in order to dramatically reduce the possibility
|
||||
of cache poisoning. All users are strongly encouraged to utilize
|
||||
this feature, and to configure their firewalls to accommodate it.
|
||||
|
||||
AS A LAST RESORT in order to get around a restrictive firewall
|
||||
policy you can try enabling the option below. Use of this option
|
||||
will significantly reduce your ability to withstand cache poisoning
|
||||
attacks, and should be avoided if at all possible.
|
||||
|
||||
Replace NNNNN in the example with a number between 49160 and 65530.
|
||||
*/
|
||||
// query-source address * port NNNNN;
|
||||
};
|
||||
|
||||
// If you enable a local name server, don't forget to enter 127.0.0.1
|
||||
// first in your /etc/resolv.conf so this server will be queried.
|
||||
// Also, make sure to enable it in /etc/rc.conf.
|
||||
|
||||
// The traditional root hints mechanism. Use this, OR the slave zones below.
|
||||
zone "." { type hint; file "named.root"; };
|
||||
|
||||
/* Slaving the following zones from the root name servers has some
|
||||
significant advantages:
|
||||
1. Faster local resolution for your users
|
||||
2. No spurious traffic will be sent from your network to the roots
|
||||
3. Greater resilience to any potential root server failure/DDoS
|
||||
|
||||
On the other hand, this method requires more monitoring than the
|
||||
hints file to be sure that an unexpected failure mode has not
|
||||
incapacitated your server. Name servers that are serving a lot
|
||||
of clients will benefit more from this approach than individual
|
||||
hosts. Use with caution.
|
||||
|
||||
To use this mechanism, uncomment the entries below, and comment
|
||||
the hint zone above.
|
||||
*/
|
||||
/*
|
||||
zone "." {
|
||||
type hint;
|
||||
file "named.root";
|
||||
type slave;
|
||||
file "slave/root.slave";
|
||||
masters {
|
||||
192.5.5.241; // F.ROOT-SERVERS.NET.
|
||||
};
|
||||
notify no;
|
||||
};
|
||||
zone "arpa" {
|
||||
type slave;
|
||||
file "slave/arpa.slave";
|
||||
masters {
|
||||
192.5.5.241; // F.ROOT-SERVERS.NET.
|
||||
};
|
||||
notify no;
|
||||
};
|
||||
zone "in-addr.arpa" {
|
||||
type slave;
|
||||
file "slave/in-addr.arpa.slave";
|
||||
masters {
|
||||
192.5.5.241; // F.ROOT-SERVERS.NET.
|
||||
};
|
||||
notify no;
|
||||
};
|
||||
*/
|
||||
|
||||
zone "0.0.127.IN-ADDR.ARPA" {
|
||||
type master;
|
||||
file "master/localhost.rev";
|
||||
};
|
||||
/* Serving the following zones locally will prevent any queries
|
||||
for these zones leaving your network and going to the root
|
||||
name servers. This has two significant advantages:
|
||||
1. Faster local resolution for your users
|
||||
2. No spurious traffic will be sent from your network to the roots
|
||||
*/
|
||||
// RFC 1912
|
||||
zone "localhost" { type master; file "master/localhost-forward.db"; };
|
||||
zone "127.in-addr.arpa" { type master; file "master/localhost-reverse.db"; };
|
||||
zone "255.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
|
||||
// RFC 3152
|
||||
zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA" {
|
||||
type master;
|
||||
file "master/localhost-v6.rev";
|
||||
};
|
||||
// RFC 1912-style zone for IPv6 localhost address
|
||||
zone "0.ip6.arpa" { type master; file "master/localhost-reverse.db"; };
|
||||
|
||||
// "This" Network (RFCs 1912 and 3330)
|
||||
zone "0.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
|
||||
// Private Use Networks (RFC 1918)
|
||||
zone "10.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
zone "16.172.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
zone "17.172.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
zone "18.172.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
zone "19.172.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
zone "20.172.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
zone "21.172.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
zone "22.172.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
zone "23.172.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
zone "24.172.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
zone "25.172.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
zone "26.172.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
zone "27.172.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
zone "28.172.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
zone "29.172.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
zone "30.172.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
zone "31.172.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
zone "168.192.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
|
||||
// Link-local/APIPA (RFCs 3330 and 3927)
|
||||
zone "254.169.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
|
||||
// TEST-NET for Documentation (RFC 3330)
|
||||
zone "2.0.192.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
|
||||
// Router Benchmark Testing (RFC 3330)
|
||||
zone "18.198.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
zone "19.198.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
|
||||
// IANA Reserved - Old Class E Space
|
||||
zone "240.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
zone "241.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
zone "242.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
zone "243.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
zone "244.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
zone "245.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
zone "246.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
zone "247.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
zone "248.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
zone "249.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
zone "250.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
zone "251.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
zone "252.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
zone "253.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
zone "254.in-addr.arpa" { type master; file "master/empty.db"; };
|
||||
|
||||
// IPv6 Unassigned Addresses (RFC 4291)
|
||||
zone "1.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "3.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "4.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "5.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "6.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "7.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "8.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "9.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "a.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "b.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "c.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "d.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "e.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "0.f.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "1.f.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "2.f.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "3.f.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "4.f.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "5.f.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "6.f.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "7.f.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "8.f.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "9.f.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "a.f.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "b.f.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "0.e.f.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "1.e.f.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "2.e.f.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "3.e.f.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "4.e.f.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "5.e.f.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "6.e.f.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "7.e.f.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
|
||||
// IPv6 ULA (RFC 4193)
|
||||
zone "c.f.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "d.f.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
|
||||
// IPv6 Link Local (RFC 4291)
|
||||
zone "8.e.f.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "9.e.f.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "a.e.f.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "b.e.f.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
|
||||
// IPv6 Deprecated Site-Local Addresses (RFC 3879)
|
||||
zone "c.e.f.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "d.e.f.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "e.e.f.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
zone "f.e.f.ip6.arpa" { type master; file "master/empty.db"; };
|
||||
|
||||
// IP6.INT is Deprecated (RFC 4159)
|
||||
zone "ip6.int" { type master; file "master/empty.db"; };
|
||||
|
||||
// NB: Do not use the IP addresses below, they are faked, and only
|
||||
// serve demonstration/documentation purposes!
|
||||
|
@ -3004,26 +3157,19 @@ zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA"
|
|||
// Example slave zone config entries. It can be convenient to become
|
||||
// a slave at least for the zone your own domain is in. Ask
|
||||
// your network administrator for the IP address of the responsible
|
||||
// primary.
|
||||
// master name server.
|
||||
//
|
||||
// Never forget to include the reverse lookup (IN-ADDR.ARPA) zone!
|
||||
// (This is named after the first bytes of the IP address, in reverse
|
||||
// order, with ".IN-ADDR.ARPA" appended.)
|
||||
// Do not forget to include the reverse lookup zone!
|
||||
// This is named after the first bytes of the IP address, in reverse
|
||||
// order, with ".IN-ADDR.ARPA" appended, or ".IP6.ARPA" for IPv6.
|
||||
//
|
||||
// Before starting to set up a primary zone, make sure you fully
|
||||
// understand how DNS and BIND works. There are sometimes
|
||||
// non-obvious pitfalls. Setting up a slave zone is simpler.
|
||||
// Before starting to set up a master zone, make sure you fully
|
||||
// understand how DNS and BIND work. There are sometimes
|
||||
// non-obvious pitfalls. Setting up a slave zone is usually simpler.
|
||||
//
|
||||
// NB: Don't blindly enable the examples below. :-) Use actual names
|
||||
// and addresses instead.
|
||||
|
||||
/* An example master zone
|
||||
zone "example.net" {
|
||||
type master;
|
||||
file "master/example.net";
|
||||
};
|
||||
*/
|
||||
|
||||
/* An example dynamic zone
|
||||
key "exampleorgkey" {
|
||||
algorithm hmac-md5;
|
||||
|
@ -3038,14 +3184,7 @@ zone "example.org" {
|
|||
};
|
||||
*/
|
||||
|
||||
/* Examples of forward and reverse slave zones
|
||||
zone "example.com" {
|
||||
type slave;
|
||||
file "slave/example.com";
|
||||
masters {
|
||||
192.168.1.1;
|
||||
};
|
||||
};
|
||||
/* Example of a slave reverse zone
|
||||
zone "1.168.192.in-addr.arpa" {
|
||||
type slave;
|
||||
file "slave/1.168.192.in-addr.arpa";
|
||||
|
@ -3089,18 +3228,18 @@ zone "1.168.192.in-addr.arpa" {
|
|||
<primary>BIND</primary>
|
||||
<secondary>zone files (域文件)</secondary>
|
||||
</indexterm>
|
||||
|
||||
|
||||
<para>下面的例子展示了用于 <hostid
|
||||
role="domainname">example.org</hostid> 的主域文件 (存放于
|
||||
<filename>/etc/namedb/master/example.org</filename>):</para>
|
||||
|
||||
<programlisting>$TTL 3600 ; 1 hour
|
||||
<programlisting>$TTL 3600 ; 1 hour default TTL
|
||||
example.org. IN SOA ns1.example.org. admin.example.org. (
|
||||
2006051501 ; Serial
|
||||
10800 ; Refresh
|
||||
3600 ; Retry
|
||||
604800 ; Expire
|
||||
86400 ; Minimum TTL
|
||||
300 ; Negative Reponse TTL
|
||||
)
|
||||
|
||||
; DNS Servers
|
||||
|
@ -3121,30 +3260,23 @@ mx IN A 192.168.1.4
|
|||
mail IN A 192.168.1.5
|
||||
|
||||
; Aliases
|
||||
www IN CNAME @</programlisting>
|
||||
www IN CNAME example.org.</programlisting>
|
||||
|
||||
<para>
|
||||
请注意以 <quote>.</quote> 结尾的主机名是全称主机名, 而结尾没有
|
||||
<para>请注意以 <quote>.</quote> 结尾的主机名是全称主机名, 而结尾没有
|
||||
<quote>.</quote> 的则是相对于原点的主机名。 例如,
|
||||
<literal>www</literal> 将被转换为
|
||||
<literal>www.<replaceable>原点</replaceable></literal>.
|
||||
在这个假想的域信息文件中, 我们的原点是
|
||||
<hostid>example.org.</hostid>, 因此 <literal>www</literal>
|
||||
将被当作 <hostid>www.example.org.</hostid>。
|
||||
</para>
|
||||
<literal>ns1</literal> 将被转换为
|
||||
<literal>ns1.<replaceable>example.org.</replaceable></literal></para>
|
||||
|
||||
<para>域信息文件的格式如下:</para>
|
||||
|
||||
<para>
|
||||
域信息文件的格式如下:
|
||||
</para>
|
||||
<programlisting>记录名 IN 记录类型 值</programlisting>
|
||||
|
||||
<indexterm>
|
||||
<primary>DNS</primary>
|
||||
<secondary>记录</secondary>
|
||||
</indexterm>
|
||||
<para>
|
||||
最常用的 DNS 记录:
|
||||
</para>
|
||||
|
||||
<para>最常用的 DNS 记录:</para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
|
@ -3185,35 +3317,37 @@ www IN CNAME @</programlisting>
|
|||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
<programlisting>
|
||||
example.org. IN SOA ns1.example.org. admin.example.org. (
|
||||
<programlisting>example.org. IN SOA ns1.example.org. admin.example.org. (
|
||||
2006051501 ; Serial
|
||||
10800 ; Refresh after 3 hours
|
||||
3600 ; Retry after 1 hour
|
||||
604800 ; Expire after 1 week
|
||||
86400 ) ; Minimum TTL of 1 day</programlisting>
|
||||
|
||||
|
||||
300 ) ; Negative Reponse TTL</programlisting>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><hostid role="domainname">example.org.</hostid></term>
|
||||
|
||||
<listitem><para>域名, 同时也是这个域信息文件的原点。</para></listitem>
|
||||
<listitem>
|
||||
<para>域名, 同时也是这个域信息文件的原点。</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><hostid role="fqdn">ns1.example.org.</hostid></term>
|
||||
|
||||
<listitem><para>该域的主/权威域名服务器。</para></listitem>
|
||||
<listitem>
|
||||
<para>该域的主/权威域名服务器。</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><literal>admin.example.org.</literal></term>
|
||||
|
||||
<listitem><para>此域的负责人的电子邮件地址,
|
||||
其中 <quote>@</quote> 被换掉了。
|
||||
(<email>admin@example.org</email> 对应
|
||||
<listitem>
|
||||
<para>此域的负责人的电子邮件地址,
|
||||
其中 <quote>@</quote>
|
||||
需要换掉 (<email>admin@example.org</email> 对应
|
||||
<literal>admin.example.org</literal>)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -3221,82 +3355,66 @@ example.org. IN SOA ns1.example.org. admin.example.org. (
|
|||
<varlistentry>
|
||||
<term><literal>2006051501</literal></term>
|
||||
|
||||
<listitem><para>文件的序号。 每次修改域文件时都必须增加这个数字。
|
||||
现今, 许多管理员会考虑使用
|
||||
<literal>yyyymmddrr</literal> 这样的格式来表示序号。
|
||||
<literal>2006051501</literal> 通常表示上次修改于
|
||||
05/15/2006, 而后面的
|
||||
<literal>01</literal> 则表示在那天的第一次修改。
|
||||
序号非常重要, 它用于通知从域服务器更新数据。</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>文件的序号。 每次修改域文件时都必须增加这个数字。
|
||||
现今, 许多管理员会考虑使用
|
||||
<literal>yyyymmddrr</literal> 这样的格式来表示序号。
|
||||
<literal>2006051501</literal> 通常表示上次修改于
|
||||
05/15/2006, 而后面的
|
||||
<literal>01</literal> 则表示在那天的第一次修改。
|
||||
序号非常重要, 它用于通知从域服务器更新数据。</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
<programlisting>
|
||||
IN NS ns1.example.org.</programlisting>
|
||||
<programlisting> IN NS ns1.example.org.</programlisting>
|
||||
|
||||
<para>
|
||||
这是一个 NS 项。 每个准备提供权威应答的服务器都必须有一个对应项。
|
||||
</para>
|
||||
<para>这是一个 NS 项。 每个准备提供权威应答的服务器都必须有一个对应项。</para>
|
||||
|
||||
<programlisting>
|
||||
localhost IN A 127.0.0.1
|
||||
<programlisting>localhost IN A 127.0.0.1
|
||||
ns1 IN A 192.168.1.2
|
||||
ns2 IN A 192.168.1.3
|
||||
mx IN A 192.168.1.4
|
||||
mail IN A 192.168.1.5</programlisting>
|
||||
|
||||
<para>
|
||||
A 记录指明了机器名。 正如在前面所按倒的,
|
||||
<para>A 记录指明了机器名。 正如在前面所看到的,
|
||||
<hostid role="fqdn">ns1.example.org</hostid> 将解析为
|
||||
<hostid role="ipaddr">192.168.1.2</hostid>。
|
||||
</para>
|
||||
<hostid role="ipaddr">192.168.1.2</hostid>。</para>
|
||||
|
||||
<programlisting>
|
||||
IN A 192.168.1.1</programlisting>
|
||||
<programlisting> IN A 192.168.1.1</programlisting>
|
||||
|
||||
<para>这一行把当前原点 <hostid role="domainname">example.org</hostid>
|
||||
指定为使用 IP 地址
|
||||
<hostid role="ipaddr">192.168.1.1</hostid>。</para>
|
||||
|
||||
<programlisting>
|
||||
www IN CNAME @</programlisting>
|
||||
<programlisting>www IN CNAME @</programlisting>
|
||||
|
||||
<para>
|
||||
正规名 (CNAME) 记录通常用于为某台机器指定别名。
|
||||
<para>正规名 (CNAME) 记录通常用于为某台机器指定别名。
|
||||
在这个例子中, 将 <hostid>www</hostid>
|
||||
指定成了 <quote>主</quote> 机器的一个别名,
|
||||
后者的名字与域名 <hostid role="domainname">example.org</hostid> 相同
|
||||
(<hostid role="ipaddr">192.168.1.1</hostid>)。
|
||||
CNAME 也可以用来提供主机别名,
|
||||
或将一个主机名以轮转 (round robin) 方式指定到多台服务器。
|
||||
</para>
|
||||
后者的名字与域名
|
||||
<hostid role="domainname">example.org</hostid>
|
||||
(<hostid role="ipaddr">192.168.1.1</hostid>) 相同。
|
||||
CNAME 不能同与之有相同名字的任何其它记录并存。</para>
|
||||
|
||||
<indexterm>
|
||||
<primary>MX 记录</primary>
|
||||
</indexterm>
|
||||
|
||||
<programlisting>
|
||||
IN MX 10 mail.example.org.</programlisting>
|
||||
<programlisting> IN MX 10 mail.example.org.</programlisting>
|
||||
|
||||
<para>
|
||||
MX 记录表示哪个邮件服务器负责接收发到这个域的邮件。
|
||||
<para>MX 记录表示哪个邮件服务器负责接收发到这个域的邮件。
|
||||
<hostid role="fqdn">mail.example.org</hostid> 是邮件服务器的主机名,
|
||||
而 10 则是它的优先级。
|
||||
</para>
|
||||
而 10 则是它的优先级。</para>
|
||||
|
||||
<para>
|
||||
可以有多台邮件服务器, 其优先级分别是 10、
|
||||
<para>可以有多台邮件服务器, 其优先级分别是 10、
|
||||
20 等等。 尝试向 <hostid
|
||||
role="domainname">example.org</hostid> 投递邮件的服务器,
|
||||
会首先尝试优先级最高的 MX (优先级数值最低的记录)、
|
||||
接着尝试次高的, 并重复这一过程直到邮件递送到达为止。
|
||||
</para>
|
||||
role="domainname">example.org</hostid> 投递邮件的服务器,
|
||||
会首先尝试优先级最高的 MX (优先级数值最小的记录)、
|
||||
接着尝试次高的, 并重复这一过程直到邮件递达为止。</para>
|
||||
|
||||
<para>
|
||||
对于 in-addr.arpa 域名信息文件 (反向 DNS), 使用了同样的格式,
|
||||
只是 PTR 项代替了 A 或 CNAME 的位置。
|
||||
</para>
|
||||
<para>in-addr.arpa 域名信息文件 (反向 DNS), 采用的格式是同样的,
|
||||
只是 PTR 项代替了 A 或 CNAME 的位置。</para>
|
||||
|
||||
<programlisting>$TTL 3600
|
||||
|
||||
|
@ -3305,7 +3423,7 @@ www IN CNAME @</programlisting>
|
|||
10800 ; Refresh
|
||||
3600 ; Retry
|
||||
604800 ; Expire
|
||||
3600 ) ; Minimum
|
||||
300 ) ; Negative Reponse TTL
|
||||
|
||||
IN NS ns1.example.org.
|
||||
IN NS ns2.example.org.
|
||||
|
@ -3317,6 +3435,9 @@ www IN CNAME @</programlisting>
|
|||
5 IN PTR mail.example.org.</programlisting>
|
||||
|
||||
<para>这个文件给出了上述假想域中 IP 地址到域名的映射关系。</para>
|
||||
|
||||
<para>需要说明的是, 在 PTR 记录右侧的名字必须是全称域名
|
||||
(也就是必须以 <quote>.</quote> 结束)。</para>
|
||||
</sect3>
|
||||
</sect2>
|
||||
|
||||
|
@ -3327,10 +3448,8 @@ www IN CNAME @</programlisting>
|
|||
<secondary>缓存域名服务器</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>缓存域名服务器是对任何域都不提供权威解析的域名服务器。
|
||||
它自己简单地完成查询, 并记住这些查询以备后续使用。
|
||||
要建立这样的服务器, 只需像平时一样配置一个域名服务器,
|
||||
而不配置域就可以了。</para>
|
||||
<para>缓存域名服务器是一种主要承担解析递归查询角色的域名服务器。
|
||||
它简单地自行进行查询, 并将查询结果记住以备后续使用。</para>
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
|
@ -3365,22 +3484,16 @@ www IN CNAME @</programlisting>
|
|||
<itemizedlist>
|
||||
<listitem>
|
||||
<para><ulink
|
||||
url="http://www.isc.org/products/BIND/">官方的 ISC BIND
|
||||
url="https://www.isc.org/software/bind">官方的 ISC BIND
|
||||
页面</ulink></para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><ulink
|
||||
url="http://www.isc.org/sw/guild/bf/">Official ISC BIND
|
||||
url="https://www.isc.org/software/guild">Official ISC BIND
|
||||
Forum</ulink></para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><ulink
|
||||
url="http://www.isc.org/index.pl?/sw/bind/FAQ.php">
|
||||
BIND9 FAQ</ulink></para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><ulink url="http://www.oreilly.com/catalog/dns5/">O'Reilly
|
||||
DNS 和 BIND 第 5 版</ulink></para>
|
||||
|
@ -3388,13 +3501,13 @@ www IN CNAME @</programlisting>
|
|||
|
||||
<listitem>
|
||||
<para><ulink
|
||||
url="ftp://ftp.isi.edu/in-notes/rfc1034.txt">RFC1034
|
||||
url="http://www.rfc-editor.org/rfc/rfc1034.txt">RFC1034
|
||||
- 域名 - 概念和工具</ulink></para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><ulink
|
||||
url="ftp://ftp.isi.edu/in-notes/rfc1035.txt">RFC1035
|
||||
url="http://www.rfc-editor.org/rfc/rfc1035.txt">RFC1035
|
||||
- 域名 - 实现及其标准</ulink></para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
@ -3728,7 +3841,7 @@ DocumentRoot /www/someotherdomain.tld
|
|||
它能非常容易的从 posts 系统安装。</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>cd /usr/ports/www/rubygem-rails; make all install clean</userinput></screen>
|
||||
</sect3>
|
||||
</sect3>
|
||||
|
||||
<sect3>
|
||||
<title>mod_perl</title>
|
||||
|
@ -4578,8 +4691,8 @@ syslogd_flags="-a logclient.example.com -vv"</programlisting>
|
|||
<para>日志客户端是一台发送日志信息到日志服务器的机器,
|
||||
并在本地保存拷贝。</para>
|
||||
|
||||
<para>类似于日志服务器, 客户端也必须满足一些最基本的条件:</para>
|
||||
|
||||
<para>与日志服务器类似, 客户端也需要满足一些最基本的条件:</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>&man.syslogd.8;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
For the FreeBSD Documentation Project
|
||||
The FreeBSD Simplified Chinese Project
|
||||
|
||||
Original Revision: 1.46
|
||||
Original Revision: 1.47
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -47,7 +47,7 @@
|
|||
<para>针对这些问题, 人们提出并实现了许多不同的解决方案。
|
||||
为了应对这些问题, 一些用户采用了多个, 有时甚至是冗余的磁盘这类方法。
|
||||
除了支持许多种不同的硬件 RAID 控制器之外,
|
||||
FreeBSD 的基本系统中包括了 Vinum 卷管理器, 它是一个用以实现虚拟磁盘驱动器的块设备。
|
||||
&os; 的基本系统中包括了 Vinum 卷管理器, 它是一个用以实现虚拟磁盘驱动器的块设备。
|
||||
<emphasis>Vinum</emphasis> 是一种称为 <emphasis>卷管理器</emphasis>,
|
||||
或者说用于解决前面这三种问题的虚拟磁盘驱动程序。 Vinum 能够提供比传统磁盘系统更好的灵活性、
|
||||
性能和可靠性, 并实现了能够单独或配合使用 RAID-0、 RAID-1 和 RAID-5 模型。</para>
|
||||
|
@ -55,7 +55,7 @@
|
|||
<para>这一章对传统磁盘存储的潜在问题进行了简要说明,并介绍了 Vinum 卷管理器。</para>
|
||||
|
||||
<note>
|
||||
<para>从 FreeBSD 5 开始, 对 Vinum 进行了重写,
|
||||
<para>从 &os; 5 开始, 对 Vinum 进行了重写,
|
||||
以便使其符合 GEOM 架构 (<xref linkend="GEOM">),
|
||||
同时保留其原有的设计创意、 术语, 以及保存在磁盘上的元数据格式。
|
||||
这一重写的版本称为 <emphasis>gvinum</emphasis>
|
||||
|
@ -65,9 +65,9 @@
|
|||
而对应的内核模块的名字, 也由
|
||||
<filename>vinum.ko</filename> 改为了
|
||||
<filename>geom_vinum.ko</filename>, 而在
|
||||
<filename>/dev/vinum</filename> 中的所有设备节点,
|
||||
也改为放到了 <filename>/dev/gvinum</filename>。
|
||||
从 FreeBSD 6 开始, 旧版的 Vinum 实现已不再提供。</para>
|
||||
<filename class="directory">/dev/vinum</filename> 中的所有设备节点,
|
||||
也改为放到了 <filename class="directory">/dev/gvinum</filename>。
|
||||
从 &os; 6 开始, 旧版的 Vinum 实现已不再提供。</para>
|
||||
</note>
|
||||
|
||||
</sect1>
|
||||
|
@ -340,7 +340,7 @@
|
|||
|
||||
<sect2>
|
||||
<title>哪种plex 组织更有效?</title>
|
||||
<para>FreeBSD &rel.current提供的Vinum 版本能实现两种plex:</para>
|
||||
<para>&os; &rel.current提供的Vinum 版本能实现两种plex:</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
|
@ -673,7 +673,7 @@
|
|||
32 个字符。</para>
|
||||
|
||||
<para>Vinum 对象会在
|
||||
<filename>/dev/gvinum</filename> 之下生成设备节点。
|
||||
<filename class="directory">/dev/gvinum</filename> 之下生成设备节点。
|
||||
前述的配置将使 Vinum 创建以下设备节点:</para>
|
||||
|
||||
<itemizedlist>
|
||||
|
@ -682,38 +682,39 @@
|
|||
实现。</para></note>
|
||||
|
||||
<para>控制设备
|
||||
<filename>/dev/vinum/control</filename> 和
|
||||
<filename>/dev/vinum/controld</filename>,
|
||||
<filename class="devicefile">/dev/vinum/control</filename> 和
|
||||
<filename class="devicefile">/dev/vinum/controld</filename>,
|
||||
分别由 &man.gvinum.8; 和 Vinum 服务使用。</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>每个卷对应的设备项。 这些是 Vinum 使用的主要设备。
|
||||
因此, 前述配置包括下列设备:
|
||||
<filename>/dev/gvinum/myvol</filename>、
|
||||
<filename>/dev/gvinum/mirror</filename>、
|
||||
<filename>/dev/gvinum/striped</filename>、
|
||||
<filename>/dev/gvinum/raid5</filename> 以及
|
||||
<filename>/dev/gvinum/raid10</filename>。</para>
|
||||
<filename class="devicefile">/dev/gvinum/myvol</filename>、
|
||||
<filename class="devicefile">/dev/gvinum/mirror</filename>、
|
||||
<filename class="devicefile">/dev/gvinum/striped</filename>、
|
||||
<filename class="devicefile">/dev/gvinum/raid5</filename> 以及
|
||||
<filename class="devicefile">/dev/gvinum/raid10</filename>。</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<note><para>这些内容仅适用于旧式的 Vinum
|
||||
实现。</para></note>
|
||||
|
||||
<para>一个包含每个驱动器对应设备的 <filename>/dev/vinum/drive</filename>
|
||||
<para>一个包含每个驱动器对应设备的
|
||||
<filename class="directory">/dev/vinum/drive</filename>
|
||||
目录。 这些项事实上是指向对应磁盘节点的符号连接。</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>所有卷的直接项都存放在
|
||||
<filename>/dev/gvinum/</filename> 中。</para>
|
||||
<filename class="directory">/dev/gvinum/</filename> 中。</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>目录
|
||||
<filename>/dev/gvinum/plex</filename>, 以及
|
||||
<filename>/dev/gvinum/sd</filename> 中相应地存放了每个 plex
|
||||
<filename class="directory">/dev/gvinum/plex</filename>, 以及
|
||||
<filename class="directory">/dev/gvinum/sd</filename> 中相应地存放了每个 plex
|
||||
以及子盘的设备节点。</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
@ -732,7 +733,7 @@
|
|||
sd length 100m drive drive4</programlisting>
|
||||
|
||||
<para>处理这个文件之后, &man.gvinum.8; 将在
|
||||
<filename>/dev/gvinum</filename> 中建立下面的结构:</para>
|
||||
<filename class="directory">/dev/gvinum</filename> 中建立下面的结构:</para>
|
||||
|
||||
<programlisting>
|
||||
drwxr-xr-x 2 root wheel 512 Apr 13 16:46 plex
|
||||
|
@ -762,14 +763,15 @@
|
|||
唯一的例外是, 与 &unix; 驱动器不同, Vinum 并不对卷进行分区,
|
||||
因而它也就不包含分区表。 这要求修改某些磁盘工具,
|
||||
特别是 &man.newfs.8;, 它会试图将 Vinum 卷名当作分区标识。
|
||||
例如, 磁盘驱动器的名字可能是 <filename>/dev/ad0a</filename> 或
|
||||
<filename>/dev/da2h</filename>。
|
||||
例如, 磁盘驱动器的名字可能是
|
||||
<filename class="devicefile">/dev/ad0a</filename> 或
|
||||
<filename class="devicefile">/dev/da2h</filename>。
|
||||
这些名字分别表达在第一个 (0) IDE (<devicename>ad</devicename>)
|
||||
磁盘上的第一个分区 (<devicename>a</devicename>),
|
||||
以及第三个 (2) SCSI 磁盘 (<devicename>da</devicename>)
|
||||
上的第八个分区 (<devicename>h</devicename>)。
|
||||
而相比而言, Vinum 卷可能叫做
|
||||
<filename>/dev/gvinum/concat</filename>,
|
||||
<filename class="devicefile">/dev/gvinum/concat</filename>,
|
||||
这个名字和分区名没有什么关系。</para>
|
||||
|
||||
<para>一般而言, &man.newfs.8; 会试图解释磁盘的名字,
|
||||
|
@ -784,9 +786,9 @@ newfs: /dev/gvinum/concat: can't figure out file system partition</screen>
|
|||
<screen>&prompt.root; <userinput>newfs /dev/gvinum/concat</userinput></screen>
|
||||
|
||||
<note><para>对于 &os; 5.0 之前的版本, &man.newfs.8; 还需要指定一个
|
||||
-v 参数, 而且其设备命名方式也是旧式的:</para></note>
|
||||
<option>-v</option> 参数, 而且其设备命名方式也是旧式的:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>newfs -v /dev/vinum/concat</userinput></screen>
|
||||
<screen>&prompt.root; <userinput>newfs -v /dev/vinum/concat</userinput></screen></note>
|
||||
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
@ -937,7 +939,7 @@ sd name bigraid.p0.s4 drive e plex bigraid.p0 state initializing len 4194304b dr
|
|||
(或者某个启动脚本) 来执行 <command>vinum
|
||||
start</command> 命令。</para>
|
||||
|
||||
<note><para>下面介绍的是 FreeBSD 所需的配置。</para></note>
|
||||
<note><para>下面介绍的是 &os; 所需的配置。</para></note>
|
||||
|
||||
<para>通过将下面的配置:</para>
|
||||
|
||||
|
@ -959,7 +961,7 @@ sd name bigraid.p0.s4 drive e plex bigraid.p0 state initializing len 4194304b dr
|
|||
<sect2>
|
||||
<title>让基于 Vinum 的卷在引导时可以访问</title>
|
||||
|
||||
<para>因为目前的 FreeBSD 引导程序只有 7.5 KB 的代码,
|
||||
<para>因为目前的 &os; 引导程序只有 7.5 KB 的代码,
|
||||
并且已经承担了从 UFS 文件系统中读取文件 (例如
|
||||
<filename>/boot/loader</filename>) 的重任,
|
||||
因此完全没有办法再让它去分析 Vinum 配置数据中的 Vinum 结构,
|
||||
|
@ -1088,9 +1090,11 @@ Subdisk root.p1.s0:
|
|||
|
||||
<para>需要注意的值是 <literal>135680</literal>,
|
||||
也就是偏移量 (相对于
|
||||
<filename>/dev/da0h</filename> 分区)。 这相当于 <command>bsdlabel</command>
|
||||
<filename class="devicefile">/dev/da0h</filename> 分区)。
|
||||
这相当于 <command>bsdlabel</command>
|
||||
记法中的 265 个 512-字节的磁盘块。 类似地, 根卷的尺寸是 245760
|
||||
个 512-字节的磁盘块。 <filename>/dev/da1h</filename> 中,
|
||||
个 512-字节的磁盘块。
|
||||
<filename class="devicefile">/dev/da1h</filename> 中,
|
||||
包含了根卷的第二个副本, 采用了同样的配置。</para>
|
||||
|
||||
<para>这些设备的 bsdlabel 类似下面的样子:</para>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Simplified Chinese Project
|
||||
|
||||
Original Revision: 1.17
|
||||
Original Revision: 1.19
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -864,10 +864,104 @@ xenbr1 8000.feffffffffff no vif0.1
|
|||
<sect1 id="virtualization-host">
|
||||
<title>作为宿主 OS 的 FreeBSD</title>
|
||||
|
||||
<para>目前, 还没有任何一种虚拟化软件包官方支持 FreeBSD 作为宿主操作系统,
|
||||
但很多人使用较早版本的 <application>VMware</application> 提供的这项能力。 目前,
|
||||
已经有人在为让 <application>&xen;</application> 能够在 FreeBSD 上作为宿主环境而进行相关的开发工作。</para>
|
||||
<para>在过去的几年中 &os; 并没有任何可用的并被官方支持的虚拟化解决方案。
|
||||
一些用户曾时使用过利用 &linux 二进制兼容层运行的
|
||||
<application>VMware</application> 陈旧并多半已过时的版本 (比如
|
||||
<filename role="package">emulators/vmware3</filename>)。
|
||||
在 &os; 7.2 发布不久, Sun 开源版本 (Open Source Edition
|
||||
<acronym>OSE</acronym>) 的 <application>&virtualbox;</application>
|
||||
作为一个 &os; 原生的程序出现在了 Ports Collection 中。</para>
|
||||
|
||||
<para><application>&virtualbox;</application> 是一个开发非常活跃,
|
||||
完全虚拟化的软件, 并且可在大部份的操作系统上使用, 包括 &windows;,
|
||||
&macos;, &linux; 和 &os;。同样也能把 &windows; 或 &unix;
|
||||
作为客户系统运行。 它有一个开源和一个私有两种版本。 从用户的角度来看,
|
||||
<acronym>OSE</acronym> 版本最主要的限制也许是缺乏 USB 的支持。
|
||||
其他更多的差异可以通过链接
|
||||
<ulink url="http://www.virtualbox.org/wiki/Editions"></ulink>
|
||||
查看 <quote>Editions</quote> 页面。 目前, &os; 上只有 OSE
|
||||
版本可用。</para>
|
||||
|
||||
<sect2 id="virtualization-virtualbox-install">
|
||||
<title>安装 &virtualbox;</title>
|
||||
|
||||
<para><application>&virtualbox;</application> 已作为一个 &os;
|
||||
port 位于 <filename role="package">emulators/virtualbox</filename>,
|
||||
可使用如下的命令安装:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>cd /usr/ports/emulators/virtualbox</userinput>
|
||||
&prompt.root; <userinput>make install clean</userinput></screen>
|
||||
|
||||
<para>在配置对话框中的一个有用的选项是
|
||||
<literal>GusetAdditions</literal> 程序套件。
|
||||
这些在客户操作系统中提供了一些有用的特性,
|
||||
比如集成鼠标指针 (允许在宿主和客户系统间使用鼠标,
|
||||
而不用事先按下某个特定的快捷键来切换) 和更快的视频渲染,
|
||||
特别是在 &windows; 客户系统中。 在安装了客户操作系统之后,
|
||||
客户附加软件可在 <guimenu>Devices</guimenu> 菜单中找到。</para>
|
||||
|
||||
<para>在第一次运行 <application>&virtualbox;</application>
|
||||
之前还需要做一些配置上的修改。port 会安装一个内核模块至
|
||||
<filename class="directory">/boot/modules</filename> 目录,
|
||||
此模块需要事先加载:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>kldload vboxdrv</userinput></screen>
|
||||
|
||||
<para>可以在 <filename>/boot/loader.conf</filename>
|
||||
中加入以下的配置使此模块在机器重启之后能自动加载:</para>
|
||||
|
||||
<programlisting>vboxdrv_load="YES"</programlisting>
|
||||
|
||||
<para><application>&virtualbox;</application> 还需要挂载
|
||||
<filename class="directory">proc</filename> 文件系统:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>mount -t procfs proc /proc</userinput></screen>
|
||||
|
||||
<para>为了使配置能在重启后始终生效, 需要在
|
||||
<filename>/etc/fstab</filename> 中加入以下这行:</para>
|
||||
|
||||
<programlisting>proc /proc procfs rw 0 0</programlisting>
|
||||
|
||||
<note>
|
||||
<para>如果在运行 <application>&virtualbox;</application>
|
||||
的终端中发现了类似如下的错误消息:</para>
|
||||
|
||||
<screen>VirtualBox: supR3HardenedExecDir: couldn't read "", errno=2 cchLink=-1</screen>
|
||||
|
||||
<para>此故障可能是由 <filename class="directory">proc</filename>
|
||||
文件系统导致的。 请使用 <command>mount</command>
|
||||
命令检查文件系统是否正确挂载。</para>
|
||||
</note>
|
||||
|
||||
<para>在安装 <application>&virtualbox;</application>
|
||||
时会自动创建 <groupname>vboxusers</groupname> 组。
|
||||
所有需要使用 <application>&virtualbox;</application>
|
||||
的用户必须被添加为此组中的成员。 可以使用 <command>pw</command>
|
||||
命令添加新的成员:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>pw groupmod vboxusers -m <replaceable>yourusername</replaceable></userinput></screen>
|
||||
|
||||
<para>运行 <application>&virtualbox;</application>,
|
||||
可以通过选择你当前图形环境中的
|
||||
<guimenuitem>Sun VirtualBox</guimenuitem>,
|
||||
也可以在虚拟终端中键入以下的命令:</para>
|
||||
|
||||
<screen>&prompt.user; <userinput>VirtualBox</userinput></screen>
|
||||
|
||||
<para>获得更多有关配置和使用 <application>&virtualbox;</application>
|
||||
的信息, 请访问官方网站 <ulink url="http://www.virtualbox.org"></ulink>。
|
||||
鉴于 &os; port 非常新, 并仍处于开发状态。请查看 &os; wiki
|
||||
上的相关页面 <ulink url="http://wiki.FreeBSD.org/VirtualBox"></ulink>
|
||||
以获取最新的信息和故障排查细则。</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="virtualization-other">
|
||||
<title>其他的虚拟化选项</title>
|
||||
|
||||
<para><application>&xen;</application>在 &os;
|
||||
上作为宿主运行依然处于开发之中。 试验性版本将出现在
|
||||
&os; 8.0。</para>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
</chapter>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Simplified Chinese Project
|
||||
|
||||
Original Revision: 1.190
|
||||
Original Revision: 1.194
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -368,14 +368,26 @@
|
|||
|
||||
<screen>&prompt.user; <userinput>startx</userinput></screen>
|
||||
|
||||
<para>如果这个命令并不能启动 X11,
|
||||
也许是默认的配置文件不适合你机器的配置, 这时候就需要手工配置
|
||||
X11 了。</para>
|
||||
<para>从 <application>&xorg;</application> 7.4 开始, 可以使用
|
||||
<acronym>HAL</acronym> 自动检测键盘和鼠标。Ports
|
||||
<filename role="package">sysutils/hal</filename> 和
|
||||
<filename role="package">devel/dbus</filename> 将被作为
|
||||
<filename role="package">x11/xorg</filename> 所依赖的包安装进系统。
|
||||
并且需要在 <filename>/etc/rc.conf</filename> 文件中启用:</para>
|
||||
|
||||
<programlisting>hald_enable="YES"
|
||||
dbus_enable="YES"</programlisting>
|
||||
|
||||
<para>在更深入的配置 <application>&xorg;</application> 以前,
|
||||
需要运行这些服务 (手工启动或者重启机器)。</para>
|
||||
|
||||
<para>自动配置对于某些硬件可能不起作用或者无法做到期望的配置。
|
||||
在这种情况下就有必要做一些手工配置。</para>
|
||||
|
||||
<note>
|
||||
<para>诸如 <application>GNOME</application>,
|
||||
<application>KDE</application> 或
|
||||
<application>XFce</application> 之类的桌面环境,
|
||||
<application>Xfce</application> 之类的桌面环境,
|
||||
大多都提供了一些允许用户非常易用的工具,
|
||||
来设置像分辨率这样的显示参数。
|
||||
所以如果你觉得默认的配置并不适合,
|
||||
|
@ -399,10 +411,17 @@
|
|||
<para>下一步是测试现存的配置文件,
|
||||
以确认 <application>&xorg;</application>
|
||||
能够同系统上的图形设备正常工作。
|
||||
要完成这个任务,只需:</para>
|
||||
对于 <application>&xorg;</application> 7.3 或者之前的版本,
|
||||
键入:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>Xorg -config xorg.conf.new</userinput></screen>
|
||||
|
||||
<para>从 <application>&xorg;</application> 7.4 和更高的版本开始,
|
||||
这个测试将显示出一个黑色的屏幕,对于判断 X11 是否能正常工作会造成一些困扰。
|
||||
可以通过 <option>retro</option> 选项使用旧的模式:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>Xorg -config xorg.conf.new -retro</userinput></screen>
|
||||
|
||||
<para>如果用户看到一个黑灰的格子和一个 X 形的鼠标指针,那么配置就是成功的。
|
||||
要退出测试, 只要同时按下
|
||||
<keycombo action="simul">
|
||||
|
@ -416,6 +435,84 @@
|
|||
|
||||
<indexterm><primary>X11 调优</primary></indexterm>
|
||||
|
||||
<note>
|
||||
<para>此组合键在 <application>&xorg;</application> 7.3
|
||||
或者之前的版本中默认启用。 在 7.4 或以后的版本中开启此选项,
|
||||
你可以在任何的 X 终端模拟器中键入以下的命令:</para>
|
||||
|
||||
<screen>&prompt.user; <userinput>setxkbmap -option terminate:ctrl_alt_bksp</userinput></screen>
|
||||
|
||||
<para>或者为 <application>hald</application> 创建一个叫作
|
||||
<filename>x11-input.fdi</filename> 的键盘配置文件并保存至
|
||||
<filename class="directory">/usr/local/etc/hal/fdi/policy</filename>
|
||||
目录。 这个文件需包含以下这些:</para>
|
||||
|
||||
<programlisting><?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<deviceinfo version="0.2">
|
||||
<device>
|
||||
<match key="info.capabilities" contains="input.keyboard">
|
||||
<merge key="input.x11_options.XkbOptions" type="string">terminate:ctrl_alt_bksp</merge>
|
||||
</match>
|
||||
</device>
|
||||
</deviceinfo></programlisting>
|
||||
|
||||
<para>你可能需要重启你的机器来使得 <application>hald</application>
|
||||
重新读取这个文件。</para>
|
||||
</note>
|
||||
|
||||
<para>如果鼠标无法正常工作, 在继续深入之前需要先配置它。
|
||||
参阅 &os; 安装一章中的 <xref linkend="mouse">。 另外,
|
||||
从 7.4 版本开始, <filename>xorg.conf</filename> 中的
|
||||
<literal>InputDevice</literal> 部分将被忽略,
|
||||
这有助于自动检测硬件设备。 可以在这个文件中的
|
||||
<literal>ServerLayout</literal> 或者 <literal>ServerFlags</literal>
|
||||
加入以下选项使用旧的模式:</para>
|
||||
|
||||
<programlisting>Option "AutoAddDevices" "false"</programlisting>
|
||||
|
||||
<para>输入设备连同其他需要的选项 (比如, 键盘布局切换)
|
||||
就可以像在之前的版本中的那样配置了。</para>
|
||||
|
||||
<note>
|
||||
<para>正如前面所提到的, 自版本 7.4 开始 <application>hald</application>
|
||||
守护进程默认自动检测你的键盘。 可能检测出你的键盘布局或型号有差异,
|
||||
在桌面环境中, 比如 <application>GNOME</application>,
|
||||
<application>KDE</application> 或者
|
||||
<application>Xfce</application> 提供了工具来配置键盘。
|
||||
另一方面, 也可在 &man.setxkbmap.1; 工具的帮助下或者通过
|
||||
<application>hald</application> 的配置文件来直接设置键盘的属性。</para>
|
||||
|
||||
<para>举例来说, 如果某人想要使用一个 PC 102 键法语布局的键盘,
|
||||
我们就需要为 <application>hald</application> 创建一个配置文件,
|
||||
叫作 <filename>x11-input.fdi</filename> 并保存入 <filename
|
||||
class="directory">/usr/local/etc/hal/fdi/policy</filename>
|
||||
目录。 这个文件需要包含如下这些:</para>
|
||||
|
||||
<programlisting><?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<deviceinfo version="0.2">
|
||||
<device>
|
||||
<match key="info.capabilities" contains="input.keyboard">
|
||||
<merge key="input.x11_options.XkbModel" type="string">pc102</merge>
|
||||
<merge key="input.x11_options.XkbLayout" type="string">fr</merge>
|
||||
</match>
|
||||
</device>
|
||||
</deviceinfo></programlisting>
|
||||
|
||||
<para>如果这个文件已经存在, 只要把键盘配置相关的部分拷贝加入即可。</para>
|
||||
|
||||
<para>你需要重启你的机器使 <application>hald</application>
|
||||
读入此文件。</para>
|
||||
|
||||
<para>也可以在 X 模拟终端或一个脚本中使用以下的命令达到相同的效果:</para>
|
||||
|
||||
<screen>&prompt.user; <userinput>setxkbmap -model pc102 -layout fr</userinput></screen>
|
||||
|
||||
<para><filename>/usr/local/share/X11/xkb/rules/base.lst</filename>
|
||||
列出了各种不同的键盘, 布局和可用的选项。</para>
|
||||
</note>
|
||||
|
||||
<indexterm><primary>X11 tuning</primary></indexterm>
|
||||
|
||||
<para>接下来是调整 <filename>xorg.conf.new</filename>
|
||||
配置文件并作测试。 用文本编辑器如
|
||||
&man.emacs.1; 或 &man.ee.1; 打开这个文件。 要做的第一件事是为当前系统的显示器设置刷新率。
|
||||
|
@ -494,17 +591,6 @@ EndSection</programlisting>
|
|||
可以通过 &man.startx.1; 工具来启动。
|
||||
除此之外, X11 服务器也可以用
|
||||
&man.xdm.1; 来启动。</para>
|
||||
|
||||
<note><para>有一个图形配置工具
|
||||
&man.xorgcfg.1;, 会随 X11 软件包一同安装。
|
||||
它可以通过选择合适的驱动和设置交互式地定义配置。
|
||||
这个程序可以从控制台通过命令 <command>xorgcfg -textmode</command> 来直接启动。
|
||||
欲了解详情, 请参考 &man.xorgcfg.1; 的联机手册。</para>
|
||||
|
||||
<para>另外还有一个叫做 &man.xorgconfig.1; 的文本界面配置工具
|
||||
这是一个控制台工具, 对用户而言不太友好, 但也正因它使用的是纯文本界面,
|
||||
因此当其他工具无法工作时, 您仍可使用这个工具。</para></note>
|
||||
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
|
@ -1438,16 +1524,16 @@ DisplayManager.requestPort: 0</screen>
|
|||
</sect2>
|
||||
|
||||
<sect2 id="x11-wm-xfce">
|
||||
<title>XFce</title>
|
||||
<title>Xfce</title>
|
||||
<sect3 id="x11-wm-xfce-about">
|
||||
<title>有关XFce</title>
|
||||
<title>有关Xfce</title>
|
||||
|
||||
<para><application>XFce</application>是以被<application>GNOME</application>
|
||||
<para><application>Xfce</application>是以被<application>GNOME</application>
|
||||
使用的 GTK+ 工具包为基础的桌面环境,
|
||||
但是更加轻巧,适合于那些需要一个易于使用和配置并且简单而高效的桌面的人。
|
||||
看起来,它非常像使用在商业&unix;系统上的
|
||||
<application>CDE</application>环境。
|
||||
<application>XFce</application>的主要特性有下面这些:</para>
|
||||
<application>Xfce</application>的主要特性有下面这些:</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
|
@ -1477,15 +1563,15 @@ DisplayManager.requestPort: 0</screen>
|
|||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>更多有关<application>XFce</application>
|
||||
的信息可以参考<ulink url="http://www.xfce.org/">XFce
|
||||
<para>更多有关<application>Xfce</application>
|
||||
的信息可以参考<ulink url="http://www.xfce.org/">Xfce
|
||||
网站</ulink>。</para>
|
||||
</sect3>
|
||||
|
||||
<sect3 id="x11-wm-xfce-install">
|
||||
<title>安装XFce</title>
|
||||
<title>安装Xfce</title>
|
||||
|
||||
<para>有一个二进制的<application>XFce</application>
|
||||
<para>有一个二进制的<application>Xfce</application>
|
||||
软件包存在(在写作的时候)。要安装的话,执行下面的命令:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>pkg_add -r xfce4</userinput></screen>
|
||||
|
@ -1496,13 +1582,13 @@ DisplayManager.requestPort: 0</screen>
|
|||
&prompt.root; <userinput>make install clean</userinput></screen>
|
||||
|
||||
<para>现在,要告诉X服务器在下次X启动时执行
|
||||
<application>XFce</application>。
|
||||
<application>Xfce</application>。
|
||||
只要执行下面的命令:</para>
|
||||
|
||||
<screen>&prompt.user; <userinput>echo "/usr/local/bin/startxfce4" > ~/.xinitrc</userinput></screen>
|
||||
|
||||
<para>接下来就是启动 X,
|
||||
<application>XFce</application>将成为您的桌面。
|
||||
<application>Xfce</application>将成为您的桌面。
|
||||
与以前一样,如果使用像
|
||||
<filename>XDM</filename> 这样的显示管理器,需要创建一个
|
||||
<filename>.xsession</filename>文件,就像有关
|
||||
|
|
Loading…
Reference in a new issue