优化apache

天远科技  发表于:2015-12-31  分类:Web Serve  阅读(3729)  赞同35

增加缓存,增加缓存模块

/usr/local/apache/bin/apxs -i -a -c /usr/local/src/httpd-2.2.31/modules/metadata/mod_expires.c


配置/usr/local/apache/conf/httpd.conf

增加一行

<IfModule mod_expires.c>
  ExpiresActive    on
  ExpiresDefault A600
  ExpiresByType image/x-icon A2592000
  ExpiresByType application/x-javascript A2592000
  ExpiresByType image/gif A2592000
  ExpiresByType image/jpeg A2592000
  ExpiresByType text/css A2592000
  ExpiresByType image/jpg A2592000
  ExpiresByType image/png A2592000
  ExpiresByType text/html A600
</IfModule>

增加

ServerTokens Prod
ServerSignature off
TraceEnable off
HostnameLookups Off
EnableSendfile On

博文分类

线

在线联系
点击这里给我发消息
点击这里给我发消息
关注我们