您的位置:首页 > 运维架构 > Apache

ubuntu12.0.4apache安装mod_security模块

2014-05-26 21:25 246 查看

Ubuntu 12.0.4在apache加载mod_security模块

(文档省略make和make install)

1.安装apr

 ./configure --prefix=/usr/local/apr

出现这句话 cannot remove `libtoolT': No such file or directory 

打开configure文件

gedit configure

修改大概29525行  RM='$RM  -f' 

2.安装apr-util

./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr

3.安装libxml2

apt-get install libxml2-dev

4.安装Libssh

apt-get install libssh-dev

5.安装Curl

apt-get install curl libcurl3 libcurl3-dev php5-curl 

6.安装lua

apt-get install liblua5.1-0-dev

7.安装Mysql

apt-get install mysql-server mysql-client php5-mysql

8安装mod_security模块

(1)./configure --prefix=/usr/mod

1)configure: looking for Apache module support via DSO through APXS

configure: error: couldn't find APXS

apt-get install apache2-dev

(2)make

(3)make install

 

9.安装php

apt-get install php5 libapache2-mod-php5

10安装Apache2

apt-get install apache2

模块在/usr/lib/apache2/modules

重启Apache的时候出现apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName

解决办法:当httpd.conf为空时在/etc/apache2/apache2.conf中加上

ServerName localhost

然后重启,错误消失

./apachectl -t -D DUMP_MODULES

查看安装的模块

在/etc/apache2/mods-enabled中创建一个文件modsecurity.load,

在里面加上

LoadModule security2_module /usr/lib/apache2/modules/mod_security2.so

在httpd.conf中加上

Include /etc/apache2/mod_security.conf

Include /root/modsecutiry-apache_2.7.7/iis/wix/modsecurity_crs_10_setup.conf

第一次写博客,多多指教啊。

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ubuntu apache mod_security