English Chinese (Traditional) (zh_TW)
Part III. System Administration
Chapter 12. Configuration and Tuning
Configuration and Tuning 設定與調校
Synopsis 概述
One of the important aspects of FreeBSD is proper system configuration. This chapter explains much of the FreeBSD configuration process, including some of the parameters which can be set to tune a FreeBSD system. 在 FreeBSD 使用過程中,相當重要的環節之一就是如何正確設定系統。 本章著重於介紹 FreeBSD 的設定流程,包括一些可以調整 FreeBSD 效能的參數設定。
After reading this chapter, you will know: 讀完這章,您將了解:
The basics of [.filename]#rc.conf# configuration and [.filename]#/usr/local/etc/rc.d# startup scripts.
How to configure and test a network card. 如何設定並測試網路卡。
How to configure virtual hosts on network devices. 如何在網路裝置上設定虛擬主機。
How to use the various configuration files in [.filename]#/etc#.
How to tune FreeBSD using man:sysctl[8] variables.
How to tune disk performance and modify kernel limitations. 如何調校磁碟效能及修改核心限制。
Before reading this chapter, you should: 在開始閱讀這章之前,您需要:
Understand UNIX(R) and FreeBSD basics (crossref:basics[basics,FreeBSD Basics]).
Be familiar with the basics of kernel configuration and compilation (crossref:kernelconfig[kernelconfig,Configuring the FreeBSD Kernel]).
Starting Services 啟動服務
Many users install third party software on FreeBSD from the Ports Collection and require the installed services to be started upon system initialization. Services, such as package:mail/postfix[] or package:www/apache22[] are just two of the many software packages which may be started during system initialization. This section explains the procedures available for starting third party software. 許多使用者會使用 Port 套件集安裝第三方軟體到 FreeBSD 且需要安裝服務在系統初始化時可啟動該軟體。服務,例如 <package>mail/postfix</package> 或 <package>www/apache22</package> 僅只是在眾多需要在系統初始化時啟動的軟體之中的兩個。本章節將說明可用來啟動第三方軟體的程序。
In FreeBSD, most included services, such as man:cron[8], are started through the system startup scripts.
Extended Application Configuration 延伸應用程式設定
Now that FreeBSD includes [.filename]#rc.d#, configuration of application startup is easier and provides more features. Using the key words discussed in <<configtuning-rcd>>, applications can be set to start after certain other services and extra flags can be passed through [.filename]#/etc/rc.conf# in place of hard coded flags in the startup script. A basic script may look similar to the following: