Apache部分模块配置

deflate模块配置:

去掉前面的井号,加载模块
LoadModule deflate_module modules/mod_deflate.so

<IfModule mod_deflate.c>
SetOutputFilter DEFLATE #添加deflate压缩
DeflateCompressionLevel 7 #压缩级别
#设置压缩对象格式
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-httpd-php text/css text/javascript
AddOutputFilter DEFLATE css
AddOutputFilter DEFLATE js
#设置日志输出!
DeflateFilterNote Input input_info        
DeflateFilterNote Output output_info
DeflateFilterNote Ratio ratio_info
LogFormat '"%r" %{output_info}n/%{input_info}n (%{ratio_info}n%%)' deflate
CustomLog logs/deflate.log deflate
</IfModule>
mod_disk_cache模块配置:

加载模块
LoadModule cache_module modules/mod_cache.so
LoadModule disk_cache_module modules/mod_disk_cache.so

<IfModule mod_cache.c>
CacheDefaultExpire 3600 #设置默认缓存过期时间
    <IfModule mod_disk_cache.c>
    CacheEnable disk / #设置缓存内容,缓存路径
    CacheRoot D:/server/apacheCache #设置缓存文件目录
    CacheDirLevels 2 #缓存目录的深度
    CacheDirLength 1 #缓存目录名的字符长度
    #CacheMaxFileSize 1048576 #缓存文件的最大值和最小值
    #CacheMinFileSize 10
    </IfModule>
</IfModule>
mod_expires配置:

去掉前面的井号,加载模块
LoadModule expires_module modules/mod_expires.so

<IfModule mod_expires.c>
expiresactive on #启用expires功能
expiresdefault a60 #设置默认缓存时间为60秒
expiresbytype text/html a300 #设置不同类型文件缓存时间
expiresbytype text/plain a300
expiresbytype text/css a3600
expiresbytype application/x-javascript a3600
</IfModule>
apache监控模块:

去掉前面的井号,加载模块
LoadModule status_module modules/mod_status.so

<location /server-status>
SetHandler server-status #开启监控模块
Order Deny,Allow
Deny from all
Allow from all
</location>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值