在我本机配置时间不长,不过花了好长的时间写了份配置文档,和大家分享一下,希望对大家有用
LINUX发行版本:Fedora 14 , Apache .2.2
安装就不说了!依然采用rpm包安装方式 ,下面进入正题:
httpd.conf配置文件介绍
1、与Apache网络和系统相关的选项
#使用ServerRoot参数设置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参数设置Apache监听端口,Apache默认是80
Listen 80
#使用User参数设置Apache进程的执行者
User apache
#使用Group参数设置Apache进程执行者所属的用户组
Group apache
#使用ServerAdmin参数设置网站管理员的邮箱地址
2、与Apache文件和目录权限相关选项
#使用DocumentRoot参数设置网站根目录
# 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段设置根目录权限
OpTIons FollowSymLinks
AllowOverride None
#使用Directory段设置/var/www/html目录权限
OpTIons Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
#设置首页为index.html
DirectoryIndex index.html index.html.var
#.ht后缀文件的访问权限控制与上目录的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日志相关的选项如下
#使用ErrorLog参数设置错误日志的位置
# 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参数设置错误日志的级别
# 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参数设置访问日志的格式模板
# 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参数设置访问日志的格式模板
# For a single logfile with access, agent, and referer information
# (Combined Logfile Format), use the following directive:
#
CustomLog logs/access_log combined