apache的配置参数的意义

#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html

1.DocumentRoot

DocumentRoot指定apache服务器网页(文档)根目录

DocumentRoot "/home/iflow/apache2/htdocs"

2.Director

Directory用于指定默认的路径

<Directory "/home/iflow/apache2/htdocs">

3.DirectoryIndex

DirectoryIndex是在只指定目录的情况下默认显示的文件名

DirectoryIndex home.html index.html index.html.var index.shtml

4.DefaultLanguage

DefaultLanguage强制指定页面默认输出的语音语音

DefaultLanguage zh-cn

5.ServerRoot

ServerRoot设置apache服务器的根目录

ServerRoot "/home/iflow/apache2"

6.ServerAdmin

ServerAdmin设置Apache服务器管理员的email地址

ServerAdmin root@zbxsoft.com

7.ServerName

ServerName设置Apache服务器的主机名

ServerName english.zbxsoft.com

8.Listen

Listen设置apache服务器监听的端口

Listen 80

9.ErrorLog

ErrorLog设置Apache服务器中错误日志的路径和文件名

ErrorLog logs/error_log

10.CustomLog

CustomLog

CustomLog logs/access_log common

11.Timeout

Timeout定义客户程序和服务器连接的超时间隔,超过这个时间间隔(秒)后服务器将断开和客户机的连接

Timeout 300

12.KeepAlive

KeepAlive 在HTTP 1.0中,一次连接只能作传输一次HTTP请求,而KeepAlive参数用于支持HTTP 1.1版本的一次连接、多次传输功能,这样就可以在一次连接中传递多个HTTP请求

KeepAlive On

13.MaxKeepAliveRequests

MaxKeepAliveRequests为一次连接可以进行的HTTP请求的最大请求次数。将其值设为0将支持在一次连接内进行无限次的传输请求。事实上没有客户程序在一次连接中请求太多的页面,通常达不到这个上限就完成连接了。

MaxKeepAliveRequests 100

14.KeepAliveTimeout

KeepAliveTimeout测试一次连接中的多次请求传输之间的时间,如果服务器已经完成了一次请求,但一直没有接收到客户程序的下一次请求,在间隔超过了这个参数设置的值之后,服务器就断开连接

KeepAliveTimeout 15

15.IndexIgnore

IndexIgnore让服务器在列出文件列表时忽略相应的文件, 这里使用模式配 置的方式定义文件名

IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t

16.AddEncoding

AddEncoding用于告诉一些使用压缩的MIME类型,这样可以让浏览器进行解压缩操作

AddEncoding x-compress .Z
AddEncoding x-gzip .gz .tgz

17.AddType

AddType参数可以为特定后缀的文件指定MIME类型,这里的设置将覆盖 mime.types中的设置

AddType application/x-compress .Z
AddType text/html .shtml
AddType application/x-httpd-php .php .phtml

18.ErrorDocument

ErrorDocument就用于设置当出现哪个错误时应该回应客户浏览器那些内容

ErrorDocument 500 "The server made a boo boo."
ErrorDocument 404 /missing.html

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值