`
445822357
  • 浏览: 740314 次
文章分类
社区版块
存档分类
最新评论

centos6.4-x86-64系统更新系统自带Apache Http Server

 
阅读更多

系统自带Apache Http Server 版本比较老,有漏洞。现在对Apache Http Server进行升级。总体思路:先删除老的,再安装新的。详细步骤如下:

1 删除老版本

1.1 删除老Apache

rpm -qa httpd得到的东西全部删除(yum remove xxx)

1.2 删老apr apr-util

yum remove apr-util-devel apr apr-util-mysql apr-docs apr-devel apr-util apr-util-docs

2 安装Apache Http Server最新稳定版。

2.1 参考http://httpd.apache.org/docs/2.4/install.html 下载获得apr-1.4.8.tar.gz 、 apr-util-1.5.2.tar.gz 、pcre-8.21.tar.gz、httpd-2.4.6.tar.gz。

2.2 安装gcc

yum -y install gcc

yum -y install gcc-c++

2.3 解压下载的压缩包


tar -xzf apr-1.4.8.tar.gz
tar -xzf apr-util-1.5.2.tar.gz

tar -xzf httpd-2.4.6.tar.gz

tar -xzf pcre-8.21.tar.gz

2.4 安装apr

cd apr-1.4.8

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

make

make install


2.5 安装apr-util

cd ../apr-util-1.5.2
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config

make

make install

2.6 安装pcre

cd ../pcre-8.21
./configure --prefix=/usr/local/pcre --with-apr=/usr/local/apr/bin/apr-1-config

make

make install

2.7 安装apache

cd ../httpd-2.4.6

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

make

make install


2.8 启动apahce

/usr/local/apache/bin/apachectl start

2.9 测试启动是否成功

http://localhost:80



参考:

1 防火墙开启80和22端口

/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT
/sbin/iptables -I INPUT -p tcp --dport 22 -j ACCEPT
/etc/rc.d/init.d/iptables save

2 设置apache 开机自启动

/etc/rc.d/rc.local中添加/usr/local/apache/bin/apachectl start

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics