centos7.0 安转apache2.4

 安装apache2.4的需要安转apr和apr-util 包 

APR和APR-util的下载地址

http://apache.fayea.com//apr/apr-1.6.2.tar.gz
http://apache.fayea.com//apr/apr-util-1.6.0.tar.gz

下载Apache包解压 进入到解压目录

./configure --prefix=/usr/local/httpd-2.4.26 --with-apr=/usr/local/apr -with-apr-util=/usr/local/apr-util-1.6.0 --with-included-apr

  1. xml/apr_xml. 致命错误:expat.h 需要 yum install -y expat-devel
  2. configure: error: Bundled APR requested but not found at ./srclib/. Download and unpack the corresponding apr and apr-util packages to ./srclib/.

    它的意思是说:需要下载apr和apr-utils并解压到 ./srclib/ 目录下, 再进行编译。把解压后的apr-1.6.2.tar.gz和apr-util-1.6.0.tar.gz放在./srclib目录下并重命名为apr和apr-util

  3. make的时候报 exports.c:1902: 错误:‘ap_hack_apr_md4’ 重定义   需要在 --with-included-apr

 apache使用service start 启动

 1:cp /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/httpd

 2:chmod +x  /etc/rc.d/init.d/httpd

 

用chkconfig将自编译设置为系统服务的时候,httpd 服务不支持 chkconfig。

1.编辑/etc/init.d/httpd

  #!/bin/bash

#chkconfig:345 61 61

#description:Apache httpd

 3 : chkconfig --add httpd

 
 4: chkconfig httpd on
posted on 2017-06-24 11:27  paulversion  阅读(162)  评论(0)    收藏  举报