1. 安装 apr
http服务依赖 apr和apr-util ,安装 http 前需先安装这两个程序
apr 简介:http://www.cnblogs.com/Alight/p/3997777.html
下载:http://apr.apache.org/download.cgi
apr-1.5.2.tar.gz
> tar xvf apr-1.5.2.tar.gz
> cd apr-1.5.2
> ./configure --prefix=/usr/local/apr-util
> make && make install
apr-util-1.5.4.tar.gz
> tar xvf apr-util-1.5.4.tar.gz
> cd apr-util-1.5.4
> ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
> make && make install
2. 安装 http
下载: http://httpd.apache.org/
httpd-2.4.25.tar.gz
> tar xvf httpd-2.4.25.tar.gz
> cd httpd-2.4.25
> ./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/
> make && make install
3. 查看版本
> httpd -v
4. http 安全优化
在 http 配置文件 httpd.conf 添加如下内容
ServerTokens Prod ServerSignature Off RewriteEngine on RewriteCond {REQUEST_METHOD} ^(TRACE|TRACK) RewriteRule .* - [F] RequestHeader unset Proxy early