CENTOS 6.5 平台离线安装 Apache2.4

一、下载Apache 2.4

http://httpd.apache.org/download.cgi

http://mirrors.cnnic.cn/apache//httpd/httpd-2.4.10.tar.gz

解决依赖关系的包

http://www.eu.apache.org/dist/apr/apr-1.5.1.tar.gz

http://www.eu.apache.org/dist/apr/apr-util-1.5.4.tar.gz

http://softlayer-sng.dl.sourceforge.net/project/pcre/pcre/8.36/pcre-8.36.tar.gz

二、解压

tar -zxf httpd-2.4.10.tar.gz

mv httpd-2.4.10.tar.gz Apache

三、处理依赖关系

解决apr not found问题

1 tar -zxf apr-1.5.1.tar.gz 2 cd  apr-1.5.1 3 ./configure --prefix=/usr/local/apr 4 make && make install

解决APR-util not found问题

1 tar -zxf apr-util-1.3.12.tar.gz 2 cd apr-util-1.3.12 3 ./configure --prefix=/usr/local/apr-util -with- apr=/usr/local/apr/bin/apr-1-config 4 make && make install

解决pcre问题

1 tar -zxf pcre-8.36.tar.gz 2 cd  pcre-8.36 3 ./configure --prefix=/usr/local/pcre 4 make && make install
四、卸载自带的apache

停止HTTPD服务,找到安装目了删除安装文件夹,再删除配置文件

五、编译安装
./configure --prefix=/usr/local/apache2 --enable-deflate --enable-expires --enable-headers --enable-modules=most --enable-so --with-mpm=worker --enable-rewrite --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre
1 make 2 make install
五、卸载apache

源码编译安装时通过--prefix 参数指定了安装目录,先停止所有服务,把安装目录文件夹删除,然后再到/etc配置文件下删除配置文件。

然后再通过 find 命令确定一下就可以了

六、添加为服务
cp /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/httpd
vi /etc/rc.d/init.d/httpd

添加(#!/bin/sh下面) # chkconfig: 2345 50 90 # description: Activates/Deactivates Apache Web Server 运行chkconfig把Apache添加到系统的启动服务组里面: # chkconfig --add httpd # chkconfig httpd on 启动服务
service httpd start

转载于:https://my.oschina.net/u/269655/blog/666034

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值