MFen:
handbook: disks/chapter.sgml 1.281 -> 1.282 geom/chapter.sgml 1.40 -> 1.41 jails/chapter.sgml 1.14 -> 1.15 network-servers/chapter.sgml 1.102 -> 1.103 ports/chapter.sgml 1.274 -> 1.279 printing/chapter.sgml 1.102 -> 1.111 Obtained from: The FreeBSD Simplified Chinese Project
This commit is contained in:
parent
debb7a1298
commit
705126934b
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=31800
6 changed files with 284 additions and 130 deletions
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Simplified Chinese Project
|
||||
|
||||
Original Revision: 1.281
|
||||
Original Revision: 1.282
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -292,7 +292,7 @@
|
|||
<screen>&prompt.root; <userinput>dd if=/dev/zero of=/dev/da1 bs=1k count=1</userinput>
|
||||
&prompt.root; <userinput>bsdlabel -Bw da1 auto</userinput>
|
||||
&prompt.root; <userinput>bsdlabel -e da1</userinput> # 创建 `e' 分区
|
||||
&prompt.root; <userinput>newfs -d0 /dev/da1e</userinput>
|
||||
&prompt.root; <userinput>newfs /dev/da1e</userinput>
|
||||
&prompt.root; <userinput>mkdir -p /1</userinput>
|
||||
&prompt.root; <userinput>vi /etc/fstab</userinput> # 为 /dev/da1e添加一个记录
|
||||
&prompt.root; <userinput>mount /1</userinput></screen>
|
||||
|
@ -1632,7 +1632,7 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c
|
|||
首次使用它之前, 应首先 <quote>初始化</quote> DVD-RAM。
|
||||
在下面的例子中, 我们将在全部空间上使用标准的 UFS2 文件系统:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>dd if=/dev/zero of=<replaceable>/dev/acd0</replaceable> count=2</userinput>
|
||||
<screen>&prompt.root; <userinput>dd if=/dev/zero of=<replaceable>/dev/acd0</replaceable> bs=2k count=1</userinput>
|
||||
&prompt.root; <userinput>bsdlabel -Bw <replaceable>acd0</replaceable></userinput>
|
||||
&prompt.root; <userinput>newfs <replaceable>/dev/acd0</replaceable></userinput></screen>
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Simplified Chinese Project
|
||||
|
||||
Original Revision: 1.40
|
||||
Original Revision: 1.41
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -468,7 +468,7 @@ ggate0
|
|||
<filename class="directory">/dev</filename> 中的特殊目录中,
|
||||
这些目录的名字取决于文件系统类型。 例如,
|
||||
<acronym>UFS</acronym>2 文件系统的标签会创建到
|
||||
<filename class="directory">/dev/ufs2</filename>
|
||||
<filename class="directory">/dev/ufs</filename>
|
||||
目录中。</para>
|
||||
|
||||
<para>普通标签在系统下次重启时会消失, 这些标签会创建到
|
||||
|
@ -492,10 +492,10 @@ ggate0
|
|||
</warning>
|
||||
|
||||
<para>现在, 您应可以在
|
||||
<filename class="directory">/dev/ufs2</filename> 目录中看到标签,
|
||||
<filename class="directory">/dev/ufs</filename> 目录中看到标签,
|
||||
并将其加入 <filename>/etc/fstab</filename>:</para>
|
||||
|
||||
<programlisting>/dev/ufs2/home /home ufs rw 2 2</programlisting>
|
||||
<programlisting>/dev/ufs/home /home ufs rw 2 2</programlisting>
|
||||
|
||||
<note>
|
||||
<para>当运行 <command>tunefs</command> 时, 应首先卸下文件系统。</para>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Simplified Chinese Project
|
||||
|
||||
Original Revision: 1.14
|
||||
Original Revision: 1.15
|
||||
$FreeBSD$
|
||||
-->
|
||||
<chapter id="jails">
|
||||
|
@ -207,7 +207,7 @@
|
|||
&prompt.root; <userinput>cd etc/</userinput> <footnote><para>在 &os; 6.0 及
|
||||
之后的版本中不必须进行这个步骤。</para></footnote>
|
||||
&prompt.root; <userinput>make distribution DESTDIR=$D</userinput> <co id="jaildistrib">
|
||||
&prompt.root; <userinput>mount_devfs devfs $D/dev</userinput> <co id="jaildevfs"></screen>
|
||||
&prompt.root; <userinput>mount -t devfs devfs $D/dev</userinput> <co id="jaildevfs"></screen>
|
||||
|
||||
<calloutlist>
|
||||
<callout arearefs="jailpath">
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Simplified Chinese Project
|
||||
|
||||
Original Revision: 1.102
|
||||
Original Revision: 1.103
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -3641,17 +3641,91 @@ DocumentRoot /www/someotherdomain.tld
|
|||
</sect3>
|
||||
|
||||
<sect3>
|
||||
<title>使用 Perl & PHP 的动态网站</title>
|
||||
<para>在过去几年中, 越来越多的企业开始通过
|
||||
Internet 以期扩大它们的收入和影响。 这也为交互式
|
||||
web 内容提出了更多的要求。 尽管一些公司, 如 µsoft;,
|
||||
提供了基于它们专有产品的解决方案,
|
||||
但开源社区也给出了自己的答案。 目前, 最为常用的动态 web
|
||||
内容实现两种方法是
|
||||
<application>mod_perl</application> &
|
||||
<application>mod_php</application>。</para>
|
||||
<title>语言绑定</title>
|
||||
|
||||
<sect4>
|
||||
<para>Apache对于一些主要的脚本语言都有相应的模块。
|
||||
这些模块使得完全使用某种脚本语言来写
|
||||
<application>Apache</application> 模块成为可能。
|
||||
他们通常也被嵌入到服务器作为一个常驻内存的解释器,
|
||||
以避免启动一个外部解释器对于下一节将描述的动态网站所需时间和资源上的开销。
|
||||
</para>
|
||||
</sect3>
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<title>动态网站</title>
|
||||
|
||||
<indexterm><primary>web servers</primary>
|
||||
<secondary>dynamic</secondary></indexterm>
|
||||
|
||||
<para>在过去的十年里,越来越多的企业为了增加收益和暴光率而转向了互联网。
|
||||
这也同时增进了对于互动网页内容的需求。有些公司,比如 µsoft;
|
||||
推出了基于他们专有产品的解决方案,开源社区也做出了积极的回应。
|
||||
比较时尚的选择包括 Django,Ruby on Rails,
|
||||
<application>mod_perl</application>, and
|
||||
<application>mod_php</application>.</para>
|
||||
|
||||
<sect3>
|
||||
<title>Django</title>
|
||||
|
||||
<indexterm><primary>Python</primary></indexterm>
|
||||
<indexterm><primary>Django</primary></indexterm>
|
||||
|
||||
<para>Django 是一个以 BSD 许可证发布的 framework,
|
||||
能让开发者快速写出高性能高品质的 web 应用程序。
|
||||
它提供给一个对象关系映射组件,数据类型可以被当 Python
|
||||
中的对象,和一组丰富的动态数据库访问 API,
|
||||
使开发者避免了写 SQL 语句。它同时还提供了可扩展的模板系统,
|
||||
让应用程序的逻辑部分与 HTML 的表现层分离。</para>
|
||||
|
||||
<para>Django 依赖与 <application>mod_python</application>,
|
||||
<application>Apache</application>, and 一个可选的 SQL
|
||||
数据库引擎。 在设置了一些恰当的标志后,FreeBSD 的 Port
|
||||
系统将会帮助你安装这些必需的依赖库。</para>
|
||||
|
||||
<example id="network-www-django-install">
|
||||
<title>安装 Django,Apache2, mod_python3,和 PostgreSQL</title>
|
||||
|
||||
<screen>&prompt.root; <userinput>cd /usr/ports/www/py-django; make all install clean -DWITH_MOD_PYTHON3 -DWITH_POSTGRESQL</userinput></screen>
|
||||
</example>
|
||||
|
||||
<para>在安装了 Django 和那些依赖的软件之后,
|
||||
你需要创建一个 Django 项目的目录,然后配置
|
||||
Apache,当有对于你网站上应用程序的某些指定的 URL
|
||||
时调用内嵌的 Python 解释器。</para>
|
||||
|
||||
<example id="network-www-django-apache-config">
|
||||
<title>Django/mod_python 有关 Apache 部分的配置</title>
|
||||
|
||||
<para>你需要在 Apache 的配置文件
|
||||
<filename>httpd.conf</filename> 加入以下这几行,
|
||||
把对某些 URL 的请求传给你的 web 应用程序:</para>
|
||||
|
||||
<screen><Location "/">
|
||||
SetHandler python-program
|
||||
PythonPath "['/dir/to/your/django/packages/'] + sys.path"
|
||||
PythonHandler django.core.handlers.modpython
|
||||
SetEnv DJANGO_SETTINGS_MODULE mysite.settings
|
||||
PythonAutoReload On
|
||||
PythonDebug On
|
||||
</Location></screen>
|
||||
</example>
|
||||
</sect3>
|
||||
|
||||
<sect3>
|
||||
<title>Ruby on Rails</title>
|
||||
|
||||
<indexterm><primary>Ruby on Rails</primary></indexterm>
|
||||
|
||||
<para>Ruby on Rails 是另外一个开源的 web framework,
|
||||
提供了一个全面的开发框架,能帮助 web
|
||||
开发者工作更有成效和快速写出强大的应用。
|
||||
它能非常容易的从 posts 系统安装。</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>cd /usr/ports/www/rubygem-rails; make all install clean</userinput></screen>
|
||||
</sect3>
|
||||
|
||||
<sect3>
|
||||
<title>mod_perl</title>
|
||||
|
||||
<indexterm>
|
||||
|
@ -3680,10 +3754,10 @@ DocumentRoot /www/someotherdomain.tld
|
|||
来安装。
|
||||
<application>mod_perl</application> 2.0 则可以通过
|
||||
<filename role="package">www/mod_perl2</filename> 安装。</para>
|
||||
</sect4>
|
||||
</sect3>
|
||||
|
||||
<sect4>
|
||||
<sect4info>
|
||||
<sect3>
|
||||
<sect3info>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<firstname>Tom</firstname>
|
||||
|
@ -3691,7 +3765,7 @@ DocumentRoot /www/someotherdomain.tld
|
|||
<contrib>Written by </contrib>
|
||||
</author>
|
||||
</authorgroup>
|
||||
</sect4info>
|
||||
</sect3info>
|
||||
<title>mod_php</title>
|
||||
|
||||
<indexterm>
|
||||
|
@ -3780,7 +3854,6 @@ DocumentRoot /www/someotherdomain.tld
|
|||
来令其适应新的配置变更:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>apachectl graceful</userinput></screen>
|
||||
</sect4>
|
||||
</sect3>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Simplified Chinese Documentation Project
|
||||
|
||||
Original Revision: 1.274
|
||||
Original Revision: 1.279
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -109,8 +109,8 @@
|
|||
使用哪一种完全取决于您自己的喜好。</para>
|
||||
|
||||
<itemizedlist>
|
||||
<title>Package的优点</title>
|
||||
|
||||
<title>Package Benefits</title>
|
||||
|
||||
<listitem>
|
||||
<para>一个压缩的 package 通常要比一个压缩的包含源代码的应用程序小得多。</para>
|
||||
</listitem>
|
||||
|
@ -128,8 +128,8 @@
|
|||
</itemizedlist>
|
||||
|
||||
<itemizedlist>
|
||||
<title>Ports 的优点</title>
|
||||
|
||||
<title>Ports Benefits</title>
|
||||
|
||||
<listitem>
|
||||
<para>package 在编译时通常使用比较保守的选项,
|
||||
这是为了保证它们能够运行在大多数的系统上。 通过从 port 安装,
|
||||
|
@ -289,7 +289,7 @@ R-deps: </screen>
|
|||
</sect1>
|
||||
|
||||
<sect1 id="packages-using">
|
||||
<sect1info>
|
||||
<sect1info>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<firstname>Chern</firstname>
|
||||
|
@ -308,7 +308,7 @@ R-deps: </screen>
|
|||
<primary>packages</primary>
|
||||
<secondary>installing</secondary>
|
||||
</indexterm>
|
||||
|
||||
|
||||
<indexterm>
|
||||
<primary><command>pkg_add</command></primary>
|
||||
</indexterm>
|
||||
|
@ -436,7 +436,7 @@ docbook =
|
|||
<row>
|
||||
<entry>=</entry> <entry>在本地ports树中与已安装的软件包版本相匹配。</entry>
|
||||
</row>
|
||||
|
||||
|
||||
<row><entry><</entry>
|
||||
<entry>已安装的版本要比在ports树中的版本旧。</entry>
|
||||
</row>
|
||||
|
@ -494,7 +494,7 @@ docbook =
|
|||
</para>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
|
||||
<sect1 id="ports-using">
|
||||
<title>使用Ports Collection</title>
|
||||
|
||||
|
@ -518,42 +518,33 @@ docbook =
|
|||
<title>CVSup 方法</title>
|
||||
|
||||
<para>保持您本地 Ports 套件最新的一种快捷的方法,
|
||||
是使用 <application>CVSup</application> 来进行更新。
|
||||
是使用 <application>CVSup</application> 协议来进行更新。
|
||||
如果您希望了解更多关于 <application>CVSup</application> 的细节, 请参见
|
||||
<link linkend="cvsup">使用 CVSup</link>。</para>
|
||||
|
||||
<note>
|
||||
<para><application>csup</application> 是用 C 语言对
<application>CVSup</application> 软件的重写, 在 &os; 6.2
|
||||
和更高版本中, 作为系统的一部分提供。 您可以直接使用系统附带的
|
||||
<application>csup</application> 而跳过 #1 这一步,
|
||||
并将这份文档余下部分中的
|
||||
<command>cvsup</command> 命令改为
|
||||
<command>csup</command>。 对于较早版本而言,
|
||||
可以使用 <filename role="package">net/csup</filename>
|
||||
port 或预编译包来安装 <application>csup</application>。</para>
|
||||
<para>The implementation of <application>CVSup</application> protocol
|
||||
included with the &os; system is called <application>csup</application>.
|
||||
It first appeared in &os; 6.2. Users of older &os; releases can install
|
||||
it via the <filename role="package">net/csup</filename>
|
||||
port/package.</para>
|
||||
<para>在 &os; 系统里对 <application>CVSup</application>
|
||||
的实现叫作 <application>csup</application>。
|
||||
它首次出现在 &os; 6.2中。 对于旧版本的 &os;
|
||||
用户而言可以通过 port/package 安装
|
||||
<filename role="package">net/csup</filename>。</para>
|
||||
</note>
|
||||
|
||||
<para>在首次运行 <application>CVSup</application> 之前,
|
||||
<para>在首次运行 <application>csup</application> 之前,
|
||||
务必确认 <filename role="directory">/usr/ports</filename>
|
||||
是空的! 如果您之前已经用其他地方安装了一份 Ports 套件,
|
||||
则 <application>CVSup</application>
|
||||
则 <application>csup</application>
|
||||
可能不会自动删除已经在上游服务器上删除掉的补丁文件。</para>
|
||||
|
||||
<step>
|
||||
<para>安装 <filename
|
||||
role="package">net/cvsup-without-gui</filename> 软件包:</para>
|
||||
<para>运行 <command>csup</command>:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>pkg_add -r cvsup-without-gui</userinput></screen>
|
||||
|
||||
<para>请参见 <link
|
||||
linkend="cvsup-install">如何安装 CVSup</link> (<xref
|
||||
linkend="cvsup-install">) 以了解更多细节。</para>
|
||||
</step>
|
||||
|
||||
<step>
|
||||
<para>运行 <command>cvsup</command>:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>cvsup -L 2 -h <replaceable>cvsup.FreeBSD.org</replaceable> /usr/share/examples/cvsup/ports-supfile</userinput></screen>
|
||||
<screen>&prompt.root; <userinput>csup -L 2 -h <replaceable>cvsup.FreeBSD.org</replaceable> /usr/share/examples/cvsup/ports-supfile</userinput></screen>
|
||||
|
||||
<para>将
|
||||
<replaceable>cvsup.FreeBSD.org</replaceable> 改为离您较近的
|
||||
|
@ -589,16 +580,16 @@ docbook =
|
|||
</step>
|
||||
|
||||
<step>
|
||||
<para>接下来按如下的方式运行 <command>cvsup</command>:</para>
|
||||
<para>接下来按如下的方式运行 <command>csup</command>:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>cvsup -L 2 <replaceable>/root/ports-supfile</replaceable></userinput></screen>
|
||||
<screen>&prompt.root; <userinput>csup -L 2 <replaceable>/root/ports-supfile</replaceable></userinput></screen>
|
||||
</step>
|
||||
</procedure>
|
||||
</note>
|
||||
</step>
|
||||
|
||||
<step>
|
||||
<para>此后运行 &man.cvsup.1; 命令将下载最近所进行的改动,
|
||||
<para>此后运行 &man.csup.1; 命令将下载最近所进行的改动,
|
||||
并将它们应用到您的 Ports Collection 上,
|
||||
不过这一过程并不重新联编您系统上的 ports。</para>
|
||||
</step>
|
||||
|
@ -735,7 +726,7 @@ docbook =
|
|||
来确保在下载过程中文件没有被破坏。
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
|
||||
<listitem>
|
||||
<para>一个 <filename>files</filename> 目录。 这个目录包括在
|
||||
FreeBSD 系统上编译和安装程序需要用到的补丁。
|
||||
|
@ -754,7 +745,7 @@ docbook =
|
|||
<para>一个 <filename>pkg-descr</filename> 文件。
|
||||
这是一个提供更多细节,有软件的多行描述。</para>
|
||||
</listitem>
|
||||
|
||||
|
||||
<listitem>
|
||||
<para>一个 <filename>pkg-plist</filename> 文件。
|
||||
这是即将被安装的所有文件的列表。它告诉 ports
|
||||
|
@ -843,7 +834,7 @@ docbook =
|
|||
===> Generating temporary packing list
|
||||
===> Compressing manual pages for lsof-4.57
|
||||
===> Registering installation for lsof-4.57
|
||||
===> SECURITY NOTE:
|
||||
===> SECURITY NOTE:
|
||||
This port has installed the following binaries which execute with
|
||||
increased privileges.
|
||||
&prompt.root;</screen>
|
||||
|
@ -1128,6 +1119,98 @@ ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/ fetch</userinput></screen>
|
|||
|
||||
<para>要了解更多信息, 请参见 &man.portmanager.1;。</para>
|
||||
</sect3>
|
||||
|
||||
<sect3 id="portmaster">
|
||||
<title>使用 Portmaster 升级 Ports</title>
|
||||
|
||||
<indexterm>
|
||||
<primary>portmaster</primary>
|
||||
</indexterm>
|
||||
|
||||
<para><application>Portmaster</application>
|
||||
是另外一个用来升级已安装的 ports 的工具。
|
||||
<application>Portmaster</application> 被设计成尽可能使用
|
||||
<quote>基本</quote> 系统中能找到的工具
|
||||
(它不依赖于其他的 ports) 和
|
||||
<filename class="directory">/var/db/pkg/</filename>
|
||||
中的信息来检测出需要升级的 ports。你可以在
|
||||
<filename role="package">ports-mgmt/portmaster</filename>
|
||||
找到它:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>cd <filename role="directory">/usr/ports/ports-mgmt/portmaster</filename></userinput>
|
||||
&prompt.root; <userinput>make install clean</userinput></screen>
|
||||
|
||||
<para><application>Portmaster</application> groups ports into four
|
||||
categories:</para>
|
||||
<para><application>Portmaster</application> 把 ports
|
||||
分成4类:</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>Root ports (不依赖其他的 ports,也不被依赖)</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Trunk ports (不依赖其他的 ports,但是被其他的 ports 依赖)</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Branch ports (依赖于其他的 ports,同时也被依赖)</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Leaf ports (依赖于其他的 ports,但不被依赖)</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>你可以使用 <option>-L</option>
|
||||
选项列出所有已安装的 ports 和查找存在更新的 ports:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>portmaster -L</userinput>
|
||||
===>>> Root ports (No dependencies, not depended on)
|
||||
===>>> ispell-3.2.06_18
|
||||
===>>> screen-4.0.3
|
||||
===>>> New version available: screen-4.0.3_1
|
||||
===>>> tcpflow-0.21_1
|
||||
===>>> 7 root ports
|
||||
...
|
||||
===>>> Branch ports (Have dependencies, are depended on)
|
||||
===>>> apache-2.2.3
|
||||
===>>> New version available: apache-2.2.8
|
||||
...
|
||||
===>>> Leaf ports (Have dependencies, not depended on)
|
||||
===>>> automake-1.9.6_2
|
||||
===>>> bash-3.1.17
|
||||
===>>> New version available: bash-3.2.33
|
||||
...
|
||||
===>>> 32 leaf ports
|
||||
|
||||
===>>> 137 total installed ports
|
||||
===>>> 83 have new versions available
|
||||
</screen>
|
||||
|
||||
<para>可以使用这个简单的命令升级所有已安装的 ports:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>portmaster -a</userinput></screen>
|
||||
|
||||
<note><para><application>Portmaster</application> 默认在删除一个现有的
|
||||
port 前会做一个备份包。如果新的版本能够被成功安装,
|
||||
<application>Portmaster</application> 将删除备份。
|
||||
使用 <option>-b</option> 后 <application>Portmaster</application>
|
||||
便不会自动删除备份。加上 <option>-i</option> 选项之后
|
||||
<application>Portmaster</application> 将进入互动模式,
|
||||
在升级每个 port 以前提示你给予确认。</para></note>
|
||||
|
||||
<para>如果你在升级的过程中发现了错误,你可以使用
|
||||
<option>-f</option> 选项升级/重新编译所有的 ports:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>portmaster -af</userinput></screen>
|
||||
|
||||
<para>同样你也可以使用 <application>Portmaster</application>
|
||||
往系统里安装新的 ports,升级所有的依赖关系之后并安装新的
|
||||
port:</para
|
||||
|
||||
<screen>&prompt.root; <userinput>portmaster <replaceable>shells/bash</replaceable></userinput></screen>
|
||||
|
||||
<para>更多的详细信息请参阅 &man.portmaster.8;</para>
|
||||
</sect3>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="ports-disk-space">
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Simplified Chinese Project
|
||||
|
||||
Original Revision: 1.102
|
||||
Original Revision: 1.111
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -1367,26 +1367,20 @@ $%&'()*+,-./01234567
|
|||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para><link linkend="printing-advanced-filters">过滤器是怎样
|
||||
工作的</link>, 设法给出一个过滤器在打印过程中的
|
||||
大致角色。 您应该阅读这节来理解
|
||||
在 <application>LPD</application> 使用过滤器时
|
||||
<quote> 表面上看不到 </quote> 的事情。 这个知识
|
||||
能够帮您预期
|
||||
并调试您在为每个打印机安装越来越多的过滤器
|
||||
时可能遇到的问题。</para>
|
||||
<para>在 <link linkend="printing-advanced-filters">过滤器是如何工作的</link>
|
||||
小节中将介绍在打印过程中过滤器的作用。
|
||||
如果希望了解在 <application>LPD</application> 使用过滤器时,
|
||||
在 <quote>幕后</quote> 发生的事情, 便应阅读这一小节。
|
||||
了解这些知识能够帮助您在为打印机安装过滤器时更快地排查可能会遇到的各种问题。</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><application>LPD</application> 默认每个打印机都能
|
||||
打印
|
||||
纯文本。 这就出现一个问题在 &postscript; (或者基于其他
|
||||
语言的打印机) 以及所有无法直接打印纯文本的打印机。
|
||||
<link
|
||||
linkend="printing-advanced-if-conversion">让
|
||||
&postscript; 打印机适应纯文本任务 </link> 这节将告诉您
|
||||
要解决这个问题应该做些什么。 如果您使用一台
|
||||
&postscript; 打印机, 那么您应该阅读这个小节。</para>
|
||||
<para><application>LPD</application> 假定任何打印机在默认状态下均能打印纯文本内容。
|
||||
对于不能直接打印纯文本的 &postscript; 打印机 (以及其他基于打印语言的打印机)
|
||||
而言这会带来问题。 在 <link
|
||||
linkend="printing-advanced-if-conversion">在 &postscript; 打印机上使用纯文本任务</link>
|
||||
这节中将会介绍如何解决这个问题的方法。 如果您使用
|
||||
&postscript; 打印机, 就应阅读这节内容。</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
|
@ -1402,15 +1396,13 @@ $%&'()*+,-./01234567
|
|||
|
||||
<listitem>
|
||||
<para><link
|
||||
linkend="printing-advanced-convfilters">转换
|
||||
过滤器</link> 这节讲述了一个自动把
|
||||
指定格式文件, 比如图像或排版数据,
|
||||
转换成您打印机可以理解的格式。 在阅读了这节
|
||||
之后, 您应该可以设置好您的打印机使得用户可以
|
||||
输入 <command>lpr -t</command> 来打印带有不同宏定义库的文本, 或者用
|
||||
<command>lpr -d</command> 来打印 &tex; DVI 数据, 用 <command>lpr
|
||||
-v</command> 来打印光栅图像数据, 等等。 我推荐您
|
||||
阅读这节。</para>
|
||||
linkend="printing-advanced-convfilters">转换过滤器</link>
|
||||
这节讲述了一个自动把指定格式文件, 比如图像或排版数据,
|
||||
转换成您打印机可以理解的格式的方法。 在阅读了这节之后,
|
||||
您就应该可以配置打印机, 让用户可以用 <command>lpr -t</command>
|
||||
来打印 troff 数据、 用
|
||||
<command>lpr -d</command> 来打印 &tex; DVI 数据, 或用 <command>lpr
|
||||
-v</command> 来打印光栅图像数据等工作了。 建议您阅读这节。</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
|
@ -1481,14 +1473,13 @@ $%&'()*+,-./01234567
|
|||
, 处理
|
||||
常规的文本打印。 可以把它想象成默认过滤器。
|
||||
<application>LPD</application>
|
||||
默认每台打印机都可以打印纯文本,
|
||||
而文本过滤器的任务就是来搞定退格、跳格,
|
||||
或者其他在某种打印机上容易错误的特殊字符。 如果您
|
||||
所在的环境对打印机的使用情况进行
|
||||
记帐, 那么文本过滤器必须也对打印进行统计,
|
||||
统计通常是通过对打印的行数进行计数然后与打印机所支持的每页的行数做比较后
|
||||
得出的。 文本过滤器
|
||||
的启动命令为:
|
||||
假定每台打印机默认情况下都可以打印纯文本,
|
||||
而文本过滤器的任务就是来搞定退格、 跳格,
|
||||
或者其他在某种打印机上容易错误的特殊字符。
|
||||
如果您所在的环境对打印机的使用情况进行记帐,
|
||||
那么文本过滤器必须也对打印的页数进行统计,
|
||||
通常是根据打印的行数和打印机在每页上能打印的行数进行计算得出。
|
||||
文本过滤器的启动命令为:</para>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>filter-name</command>
|
||||
|
@ -1501,8 +1492,8 @@ $%&'()*+,-./01234567
|
|||
<arg choice="plain"><replaceable>acct-file</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
where
|
||||
|
||||
<para>这里</para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><option>-c</option></term>
|
||||
|
@ -1565,7 +1556,6 @@ $%&'()*+,-./01234567
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<indexterm>
|
||||
|
@ -1580,7 +1570,7 @@ $%&'()*+,-./01234567
|
|||
文件转换成一种打印机可以识别和打印的形式。 请参见 <link
|
||||
linkend="printing-advanced-convfilters">转换过滤器</link>
|
||||
这一节来了解更多细节。 如果您需要对打印进行记帐,
|
||||
那么转换过滤器也必须完成记帐工作。 转换过虑器的启动命令为:
|
||||
那么转换过滤器也必须完成记帐工作。 转换过虑器的启动命令为:</para>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>filter-name</command>
|
||||
|
@ -1592,18 +1582,18 @@ $%&'()*+,-./01234567
|
|||
<arg choice="plain"><replaceable>acct-file</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<replaceable>pixel-width</replaceable> 的值来自
|
||||
<literal>px</literal> 标签 (默认为 0),
|
||||
<para>这其中 <replaceable>pixel-width</replaceable> 的值来自
|
||||
<literal>px</literal> 标签 (默认为 0), 而
|
||||
<replaceable>pixel-height</replaceable> 的值来自
|
||||
<literal>py</literal> 标签 (默认为 0)。</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><emphasis> 输出过滤器 </emphasis> 仅在没有文本过滤器
|
||||
时, 或者报头页被打开时使用. 就我的
|
||||
经验而言, 输出过滤器是很少用到的. 在<link
|
||||
linkend="printing-advanced-of"> 输出过滤器 </link> 这节中会
|
||||
介绍它们. 启动输出过滤器的命令行只有两个参数:
|
||||
<para><emphasis> 输出过滤器 </emphasis> 仅在没有文本过滤器时,
|
||||
或者报头页被打开时使用。 就我们的经验而言,
|
||||
输出过滤器是很少用到的. 在 <link
|
||||
linkend="printing-advanced-of">输出过滤器</link> 这节中会介绍它们。
|
||||
启动输出过滤器的命令行只有两个参数:</para>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>filter-name</command>
|
||||
|
@ -1611,8 +1601,8 @@ $%&'()*+,-./01234567
|
|||
<arg choice="plain">-l <replaceable>length</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<option>-w</option> 和
|
||||
<option>-l</option> 参数的意义和文本过滤器中的一样。</para>
|
||||
<para>它们的作用与文本过滤器的 <option>-w</option> 和
|
||||
<option>-l</option> 参数是一样的。</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
|
@ -1701,8 +1691,10 @@ $%&'()*+,-./01234567
|
|||
|
||||
<para><command>lprps</command> 可以在 FreeBSD Ports Collection
|
||||
(详见 <link linkend="ports">The Ports Collection</link>) 中找到。
|
||||
您当然可以自己获取, 构建并安装它。 在安装之后
|
||||
<command>lprps</command>, 只需指定
|
||||
你可以根据页面的尺寸选择安装
|
||||
<filename role="package">print/lprps-a4</filename>
|
||||
和 <filename role="package">print/lprps-letter</filename>。
|
||||
在安装了 <command>lprps</command> 之后, 只需指定
|
||||
<command>psif</command> 这个程序的路径, 这也是包含在
|
||||
<command>lprps</command> 中的一个程序。 如果您已经用 ports 安装好了
|
||||
<command>lprps</command>, 将下面的内容添加到
|
||||
|
@ -1758,28 +1750,34 @@ fi</programlisting>
|
|||
</indexterm>
|
||||
<indexterm>
|
||||
<primary>Ghostscript</primary></indexterm>
|
||||
|
||||
<para>&postscript; 是高质量排版和打印 <emphasis>事实上的</emphasis>
|
||||
标准。 而 &postscript; 也是一个
|
||||
<emphasis> 昂贵 </emphasis> 的标准。 幸好, Aladdin
|
||||
开发了一个和 &postscript; 类似的叫做
|
||||
<application>Ghostscript</application> 的程序可以用在 FreeBSD 上。
|
||||
Ghostscript 可以读取大多数 &postscript; 的文件并处理其中的页面交给多种设备,
|
||||
包括许多品牌的非
|
||||
PostScript 打印机。 通过安装 Ghostscript 并使用一个特殊的文本过滤器,
|
||||
则可以使一台非 &postscript; 打印机用起来就像真的 &postscript; 打印机一样。</para>
|
||||
<application>Ghostscript</application> 可以读取大多数 &postscript;
|
||||
的文件并处理其中的页面交给多种设备,包括许多品牌的非 &postscript;
|
||||
打印机。 通过安装 <application>Ghostscript</application>
|
||||
并使用一个特殊的文本过滤器,则可以使一台非 &postscript;
|
||||
打印机用起来就像真的 &postscript; 打印机一样。</para>
|
||||
|
||||
<para>Ghostscript 也包括在 FreeBSD Ports Collection 中,
|
||||
如果您想要从这里安装。 您同样可以很容易地获取, 构建, 并安装它。</para>
|
||||
<para><application>Ghostscript</application> 被收录在
|
||||
FreeBSD Ports Collection 中,有许多可用的版本,
|
||||
比较常用的版本是
|
||||
<filename role="package">print/ghostscript-gpl</filename>。</para>
|
||||
|
||||
<para>要模拟 &postscript;, 文本过滤器要检测是否要打印一个
|
||||
&postscript; 文件。 如果不是, 那么过滤器将直接将文件发送到打印机;
|
||||
否则, 它会用 Ghostscript 先将文件转换成打印机可以理解的格式。</para>
|
||||
否则, 它会用 <application>Ghostscript</application>
|
||||
先将文件转换成打印机可以理解的格式。</para>
|
||||
|
||||
<para>这里有一个例子: 下面的脚本是一个针对
|
||||
Hewlett Packard DeskJet 500 打印机的文本过滤器。 对于其他打印机,
|
||||
替换 <command>gs</command> (Ghostscript) 命令中的 <option>-sDEVICE</option> 参数
|
||||
就可以了。 (输入 <command>gs
|
||||
-h</command> 来获得当前安装的 Ghostscript 所支持的设备列表。)</para>
|
||||
替换 <command>gs</command> (<application>Ghostscript</application>)
|
||||
命令中的 <option>-sDEVICE</option> 参数就可以了。 (输入
|
||||
<command>gs -h</command> 来获得当前安装的
|
||||
<application>Ghostscript</application> 所支持的设备列表。)</para>
|
||||
|
||||
<programlisting>#!/bin/sh
|
||||
#
|
||||
|
@ -1981,7 +1979,7 @@ exit 2</programlisting>
|
|||
一台叫做 <literal>bamboo</literal> 的打印机添加一个转换过滤器。
|
||||
下面是这个例子的 <filename>/etc/printcap</filename> 文件,
|
||||
其中使用新变量 <literal>df</literal> 来为打印机
|
||||
<literal>bamboo</literal> 设置转换过滤器.</para>
|
||||
<literal>bamboo</literal> 设置转换过滤器:</para>
|
||||
|
||||
<programlisting>#
|
||||
# /etc/printcap for host rose - added df filter for bamboo
|
||||
|
@ -2018,14 +2016,14 @@ exec /usr/local/bin/dvips -f | /usr/local/libexec/lprps "$@"</programlisting>
|
|||
&postscript; 打印机上打印纯文本任务</link> 这一节), 并且带着
|
||||
<application>LPD</application>
|
||||
传给脚本的全部参数。 <command>lprps</command>
|
||||
将利用这些参数来为打印进行记帐。</para>
|
||||
工具将利用这些参数来为打印进行记帐。</para>
|
||||
</sect4>
|
||||
|
||||
<sect4>
|
||||
<title>更多转换过滤器应用实例</title>
|
||||
|
||||
<para>因为安装转换过滤器的步骤并不是固定的,
|
||||
所以这里会多给出一些例子。
|
||||
所以这节介绍了一些可行的例子。
|
||||
在以后的安装配置过程中可以以这些例子为参考。
|
||||
甚至如果合适的话, 可以完全照搬过去。</para>
|
||||
|
||||
|
@ -2117,12 +2115,12 @@ exit 2</programlisting>
|
|||
<para>现在, 该困难的部分了: 编写过滤器。 为了实现过滤器, 我们需要一个
|
||||
DVI-到-LaserJet/PCL 转换程序。 FreeBSD Ports
|
||||
Collection (详见 <link linkend="ports">Ports Collection</link> 这一节)
|
||||
中有一个包: <command>dvi2xx</command> 是这个包的名称。
|
||||
安装这个包就会得到我们需要的程序,
|
||||
中有一个: <filename role="package">print/dvi2xx</filename>。
|
||||
安装这个 port 就会得到我们需要的程序,
|
||||
<command>dvilj2p</command> , 它可以将 DVI 数据转换成 LaserJet IIp,
|
||||
LaserJet III, 和 LaserJet 2000 兼容的数据。</para>
|
||||
|
||||
<para><command>dvilj2p</command> 使得过滤器
|
||||
<para><command>dvilj2p</command> 工具使得过滤器
|
||||
<command>hpdf</command> 变得十分复杂, 因为
|
||||
<command>dvilj2p</command> 不能读取标准输入。
|
||||
它需要从文件中读取数据。 更糟糕的是, 这个文件的名字必须以
|
||||
|
|
Loading…
Reference in a new issue