Linux下编译安装Apache

编译安装环境

CentOS6.6、apache2.2.31

安装zilb、zlib-device

[root@test ~]# yum -y install zib
[root@test ~]# yum -y install zlib-devel

下载编译安装包并解压

[root@test ~]# wget -c http://apache.fayea.com/httpd/httpd-2.2.31.tar.gz
[root@test ~]# tar -zxvf httpd-2.2.31.tar.gz

编译安装

[root@test httpd-2.2.31]# cd httpd-2.2.31
[root@test httpd-2.2.31]# ./configure –prefix=/usr/local/apache2 –enable-rewrite –enable-so –enable-headers –enable-expires –with-mpm=worker –enable-modules=most –enable-deflate
[root@test httpd-2.2.31]# make && make install

设置httpd启动服务并启动

[root@test ~]# cp /usr/local/apache2/bin/httpd /etc/init.d/
[root@test ~]# service httpd -k start
[root@test ~]# netstat -lntp | grep 80

设置防火墙80端口允许访问

[root@test ~]# iptables -F
[root@test ~]# iptables -A OUTPUT -p tcp –sport 80 -j ACCEPT

查看版本

[root@test ~]# cd /usr/local/apache2/bin/
[root@test bin]# ./httpd -v apache

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值