首页 > Web开发 > 详细

编译安装 http

时间:2017-03-07 13:12:18      阅读:238      评论:0      收藏:0      [点我收藏+]

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

  

 

编译安装 http

原文:http://www.cnblogs.com/yorkyang/p/6514010.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!