`

Apache2的httpd.conf翻译(四)

阅读更多

#
ErrorLog logs/error_log

 

#
# LogLevel:控制记录在错误日志文件中的日志信息数量。
# 可能的值包括:debug,info,notice,warn,error,crit,alert,emerg。
#
LogLevel warn

#
# 下面的指令为CustomLog指令定义格式别名。
#
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

# 你需要安装了mod_logio.c模块才能使用%I和%O。
# LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio

#
# 指定接入日志文件的定位和格式(一般日志格式)。
# 如果你没有在<VirtualHost>内定义这个指令,传输信息将记录在这里,
# 如果你定义了这个指令,则记录在你指定的位置,而不是这儿定义的位置。
#
CustomLog logs/access_log common

#
# 如果你想要记录agent和referer信息,可以使用下面的指令
#
# CustomLog logs/referer_log referer
# CustomLog logs/agent_log agent

#
# 如果你想要使用一个文件记录access,agent和referer信息,
# 你可以如下定义这个指令:
#
# CustomLog logs/access_log combined

#
# ServerTokens
# 这个指令定义包含在HTTP回应头中的信息类型。默认为“Full”,
# 这表示在回应头中将包含模块中的操作系统类型和编译信息。
# 可以设为列各值中的一个:
# Full | OS | Minor | Minimal | Major | Prod
# Full传达的信息最多,而Prod最少。
#
ServerTokens Full

#
# 随意的添加包含服务器版本和虚拟主机名字一行信息到server-generated输出页中
# (内部错误文档,FTP目录列表,mod_status和mod_info输出等等,除了CGI错误
# 或自定义的错误文档以外)。
# 设为“EMail”将包含一个指向ServerAdmin的mailto:连接。
# 可以为如下值:On | Off | EMail
#
ServerSignature On

#
# Aliases:在这时添加你需要的别名,格式如下:
# Alias 别名 真实名
#
# 注意,如果你在别名的未尾包含了“/”,那么在URL中也需要包含“/”。
# 因此,“/icons”不是这个示例中的别名。
# 如果别名中以“/”结尾,那么真实名也必须以“/”结尾,
# 如果别名中省略了结尾的“/”,那么真实名也必须省略。
#
# 我们使用别名“/icons/”来表示FancyIndexed目录列表,如果你不使用、
# FancyIndexing,你可以注释掉它。
#
# Alias /icons/ "/usr/local/apache2/icons/"

# <Directory "/usr/local/apache2/icons">
# Options Indexes MultiViews
# AllowOverride None
# Order allow,deny
## Allow from all
# </Directory>

#
# 这将改变ServerRoot/manual。这个别名提供了手册页所在的位置,
# 即使你改变了你的DocumentRoot。如果你对有无手册页并不在意的话,
# 你可以注释掉它。
#
Alias /manual "/usr/loacl/apache2/manual"

<Directory "/usr/local/apache2/manual">
Options Indexes FollowSymLinks MultiViews IncludesNoExec
AddOutputFilter Includes html
Order allow,deny
Allow from all
</Directory>

#
# ScriptAlias:指定包含服务脚本的目录。
# ScriptAliases 本质上与Aliases一样,除了这里的文档在请求时做为程序处理处理以外。
# 尾部的“/”规则与Alias一样
#
ScriptAlias /cgi-bin/ "/usr/loacl/apache2/cgi-bin/"

# 这里是添加php 4支持的指令
AddType application/x-httpd-php .php
LoadModule php4_module modules/libphp4.so

<IfModule mod_cgidc>
#
# 添加mod_cgid.c设置,mod_cgid提供使用cgid进行通讯的UNIX套接字的
# 脚本接口路径。
#
# Scriptsock logs/cgisock
</IfModule>

#
# 将"/usr/local/apache2/cgi-bin"改为你的ScriptAliased指定的CGI目录,
# 如果你配置了的话。
#
<Directory "/usr/local/apache2/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>

#
# Redirect允许你告诉客户端使用存在于服务器名字空间中的文档,
# 而不是现在的,这帮助客户定位那些改变了位置的文档。
# 例如:
# Redirect permanent /foo http://www.example.com/bar

#
# 控制server-generated目录列表显示的指令
#

#
# IndexOptions:控制server-generated目录列表显示特征。
#
IndexOptions FancyIndexing VersionSort

#
# AddIcon* 指令告诉服务器不同扩展名的图象文件如何显示,
# 只适用于FancyIndexed指令
#
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*

AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core

AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^

#
# DefaultIcon 为那些没有显式定义图标的文件提供处理
#
DefaultIcon /icons/unknown.gif

#
# AddDescription允许你在server-generated索引后放置一个简短的说明。
# 只对FancyIndexed指令有效。
# 格式:AddDescription "说明" 文件名
#
# AddDescription "GZIP compressed document" .gz
# AddDescription "tar archive" .tar
# AddDescription "GZIP compressed tar archive" .tgz

#
# ReadmeName指定服务器默认查找的README文件的名字,并添加到目录列表中
#
# HeaderName指定目录列表前缀文件的文件名
ReadmeName README.html
HeaderName HEADER.html

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics