在我本機配置時間不長,不過花了好長的時間寫了份配置文檔,和大家分享一下,希望對大家有用
LINUX發(fā)行版本:Fedora 14 , Apache .2.2
安裝就不說了!依然采用rpm包安裝方式 ,下面進入正題:
httpd.conf配置文件介紹
1、與Apache網(wǎng)絡(luò)和系統(tǒng)相關(guān)的選項
#使用ServerRoot參數(shù)設(shè)置Apache安裝目錄
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
# you will save yourself a lot of trouble.
# Do NOT add a slash at the end of the directory path.
#
ServerRoot "/etc/httpd"
#使用Listen參數(shù)設(shè)置Apache監(jiān)聽端口,Apache默認是80
Listen 80
#使用User參數(shù)設(shè)置Apache進程的執(zhí)行者
User apache
#使用Group參數(shù)設(shè)置Apache進程執(zhí)行者所屬的用戶組
Group apache
#使用ServerAdmin參數(shù)設(shè)置網(wǎng)站管理員的郵箱地址
2、與Apache文件和目錄權(quán)限相關(guān)選項
#使用DocumentRoot參數(shù)設(shè)置網(wǎng)站根目錄
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/var/www/html"
#使用Directory段設(shè)置根目錄權(quán)限
Options FollowSymLinks
AllowOverride None
#使用Directory段設(shè)置/var/www/html目錄權(quán)限
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
?
#設(shè)置首頁為index.html
DirectoryIndex index.html index.html.var
#.ht后綴文件的訪問權(quán)限控制與上目錄的AllowOverride一起作用
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
Order allow,deny
Deny from all
Satisfy All
?
3、與Apache日志相關(guān)的選項如下
#使用ErrorLog參數(shù)設(shè)置錯誤日志的位置
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a
# container, that host's errors will be logged there and not here.
#
ErrorLog logs/error_log
#使用LogLevel參數(shù)設(shè)置錯誤日志的級別
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn
#使用LogFormat參數(shù)設(shè)置訪問日志的格式模板
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" combined
LogFormat "%h %l %u %t "%r" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
#使用CustomLog參數(shù)設(shè)置訪問日志的格式模板
# For a single logfile with access, agent, and referer information
# (Combined Logfile Format), use the following directive:
#
CustomLog logs/access_log combined
評論