编译安装好apache httpd以后,可以继续添加扩展
mod_expires 用于发送header,设置静态文件的过期时间。
参考:http://httpd.apache.org/docs/2.2/mod/mod_expires.html
cd httpd-2.2.19/modules/metadata
sudo /usr/local/apache2/bin/apxs -i -a -c mod_expires.c
echo 'ExpiresActive On' | sudo tee -a /usr/local/apache2/conf/httpd.conf
echo 'FileEtag none' | sudo tee -a /usr/local/apache2/conf/httpd.conf
然后按照在静态服务器的配置里加上ExpiresDefault "access plus 1 month"
mod_deflate 用于开启gzip压缩
cd httpd-2.2.19/modules/filters
sudo /usr/local/apache2/bin/apxs -i -a -c mod_deflate.c
echo 'SetOutputFilter DEFLATE' | sudo tee -a /usr/local/apache2/conf/httpd.conf
改完配置,重启apache。
参考资料:
《高性能网站建设指南》
http://book.douban.com/subject/3132277/
转载于:https://www.cnblogs.com/sink_cup/archive/2011/11/13/apache_httpd_module-mod_expires-mod_deflate.html
相关资源:数据结构—成绩单生成器