ServerAdmin root@localhost
#
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If this is not set to valid DNS name for your host, server-generated
# redirections will not work. See also the UseCanonicalName directive.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
# You will have to access it by its address anyway, and this will make
# redirections work in a sensible way.
#ServerName www.example.com:80
#
# UseCanonicalName: Determines how Apache constructs self-referencing
# URLs and the SERVER_NAME and SERVER_PORT variables.
# When set "Off", Apache will use the Hostname and Port supplied
# by the client. When set "On", Apache will use the value of the
# ServerName directive.
UseCanonicalName Off
# 站点根目录
DocumentRoot "/var/www/html"
# 默认主页
DirectoryIndex index.html index.html.var
# 支持的MIME类型定义文件所在路径
TypesConfig /etc/mime.types
# 默认的MIME类型
DefaultType text/plain
# 日志(access_log)中记录client的IP地址(Off)还是其hostname(On)
# 一般都是Off,因为反解析主机名较浪费时间
HostnameLookups Off
ErrorLog logs/error_log
# debug, info, notice, warn, error, crit,alert, emerg.
LogLevel warn
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
#此处的combined即为LogFormat的别名
CustomLog logs/access_log combined
# 别名
Alias /icons/ "/var/www/icons/"