[转]apache的一些必要的mod安装
来源:互联网 发布:电视直播回放软件 编辑:程序博客网 时间:2024/05/22 06:26
Apache 的一些必要的 mod 安装
PS:
Apache强大指出在于方便的插件和模块技术,这里安装的是部分不常用但是很不错的模块,包括:防范拒绝服务器攻击的mod_evasive,用于防注入等安全性防范的mod_security,以及对网页进行压缩的mod_deflate等等模块
模块:mod_evasive
作用:防止DDOS的攻击
介绍:mod_evasive模块的前身就是mod_dosevasive
下载:http://www.nuclearelephant.com/projects/mod_evasive
安装
# tar zxvf mod_evasive_1.10.1.tar.gz
# cd mod_evasive_1.10.1
# /usr/local/apache/bin/apxs -i -a -c mod_evasive20.c
打开 httpd.conf 文件
查看是否有
LoadModule evasive20_module modules/mod_evasive20.so
如没有则加上去
并在httpd.conf里加入
#################################
DOSHashTableSize 3097
DOSPageCount 2
DOSSiteCount 50
DOSPageInterval 1
DOSSiteInterval 1
DOSBlockingPeriod 10
###################################
模块:mod_security
作用:可以加强apache的安全性特别是在防sql 注入
下载:http://www.modsecurity.org/download/
安装
# tar zxvf modsecurity-apache-1.9.tar.gz
# cd modsecurity-apache-1.9/apache2/
# /apache2/bin/apxs -cia mod_security.c
打开 httpd.conf 文件
查看是否有
LoadModule security_module modules/mod_security.so
如没有则加上去
并在httpd.conf里加入
#################################
SecFilterEngine On
SecFilterCheckURLEncoding On
SecFilterDefaultAction "deny,log,status:500"
#SecFilterForceByteRange 32 126
#SecFilterScanPOST On
SecAuditLog logs/audit_log
###
SecFilter "/././"
#####
SecFilter /etc/*passwd
SecFilter /bin/*sh
#for css attack
SecFilter "<( | )*script"
SecFilter "<(.| )+>"
#for sql attack
SecFilter "delete[ ]+from"
SecFilter "insert[ ]+into"
SecFilter "select.+from"
SecFilter "union[ ]+from"
SecFilter "drop[ ]"
###############################
模块:mod_deflate
作用:对网页进行压缩加快网页浏览速度
下载:apache2自带
安装
# /usr/local/apache2/bin/apxs -i -a -c /root/httpd-2.0.48/modules/filters/mod_deflate.c
查看是否有
LoadModule deflate_module modules/mod_deflate.so
如没有则加上去
编辑 httpd.conf 文件加入以下内容:
######################################
DeflateFilterNote ratio
LogFormat '"%v %h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" (%{ratio}n)' deflate
SetOutputFilter DEFLATE
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch /bMSIE !no-gzip !gzip-only-text/html
SetEnvIfNoCase Request_URI /.(?:gif|jpe?g|png)$ no-gzip dont-vary
#Header append Vary User-Agent env=!dont-vary
#查找Customlog 注释原来的的一行,改成
CustomLog logs/deflate_log deflate
######################################
######################################
SetOutputFilter DEFLATE
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch /bMSIE !no-gzip !gzip-only-text/html
SetEnvIfNoCase Request_URI /.(?:gif|jpe?g|png)$ no-gzip dont-vary
#Header append Vary User-Agent env=!dont-vary
#查找Customlog 注释原来的的一行,改成
CustomLog logs/deflate_log deflate
######################################
######################################
- apache 的一些必要的 mod 安装
- [转]apache的一些必要的mod安装
- [转]apache的一些必要的mod安装
- [转]apache的一些必要的mod安装
- Fedora22安装后的一些必要操作
- apache 的mod-status
- apache 的mod-status
- 安装ubuntu以及安装一些必要的软件
- Android 编译前要安装的一些必要的库
- Centos安装后的一些必要处理工作
- Android Studio安装后的一些必要设置
- 手动添加apache的mod
- ubuntu的一些必要设置
- studio 的一些必要配置
- ubuntu安装必要的软件
- mod-security apache的一个模块
- Ubuntu一些很必要的命令
- SOAP和WSDL的一些必要知识
- boost源码剖析之:多重回调机制signal(下)
- 转:Windows时间函数大全
- [转]通过案例深入探讨PHP中的内存管理问题
- Little Miss Sunshine - The most moving movie of 2006
- Beautiful Proof - Data-Race-Free Implies Sequential Consistency铪铪
- [转]apache的一些必要的mod安装
- 《Working Effectively With Legacy Code》译序
- [原创]MySQL中SQL优化和架构设计的一些简单想法
- Intuition out of counter-intuition
- 转:3NF——来自www.itisedu.com
- C++0x简讯
- 关于C++0x内存模型和序列点的一些思考
- [转]Sqlite中文排序研究
- fedora8 安装Geforce8600显卡