码迷,mamicode.com
首页 > Web开发 > 详细

编译安装httpd 2.4

时间:2018-01-24 16:50:02      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:环境   module   orb   方便   aliyun   pad   tables   端口   exp   

CentOS 6.9

(1)关闭SELINUX

Note:如果不关闭SELINUX,在设置DocumentRoot的时候可能会出现Forbidden等各种不可预知的问题

#sed  -i ‘s/^SELINUX=enforcing/SELINUX=disabled/g /etc/selinux/config`

(2)关闭IPTABLES和添加系统用户

也可以打开80端口,这里为了测试方便就直接关闭

# /etc/init.d/iptables stop
# groupadd -r apache
# useradd -r -g apache apache

(3)需要的依赖包

# yum -y groupinstall "Development tools" "Server Platform Development"
# yum -y install pcre-devel
# yum -y install expat-devel

(4)下载安装包

wget https://mirrors.aliyun.com/apache/httpd/httpd-2.4.29.tar.gz https://mirrors.aliyun.com/apache/apr/apr-1.6.3.tar.gz https://mirrors.aliyun.com/apache/apr/apr-util-1.6.1.tar.gz

(5)安装apr

# tar xf apr-1.6.3.tar.gz
# apr-1.6.3
# ./configure --prefix=/usr/local/apr
# make && make install

(6)安装apr-util

# tar xf apr-util-1.6.1.tar.gz 
# cd apr-util-1.6.1
# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/
# make && make install

(7)安装httpd

# tar xf httpd-2.4.29.tar.gz 
# cd httpd-2.4.29
# ./configure --prefix=/usr/local/apache --sysconf=/etc/httpd24 --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-pcre --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-modules=most --enable-mpms-shared=all --with-mem=event --libdir=/usr/lib64

(8)添加环境变量

# echo "PATH=/usr/local/apache/bin/apachectl:$PATH" > /etc/profile.d/httpd.sh

(9)启动http服务

# apachectl -k start

(10)查看监听端口

ss -tnl

编译安装httpd 2.4

标签:环境   module   orb   方便   aliyun   pad   tables   端口   exp   

原文地址:http://blog.51cto.com/2143754/2064676

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!