[5] 编译安装Apache-2.4.3

本文提供了一步一步的指南,详细说明了如何在Linux环境下使用wget和tar命令下载并安装Apache HTTP服务器的各个组件,包括PCRE、APR、APR-Util和HTTPD,同时配置了防火墙规则和初始化Apache服务。
# cd /usr/software
# wget http://mirror.bjtu.edu.cn/apache/httpd/httpd-2.4.3.tar.gz
# wget http://mirrors.axint.net/apache/apr/apr-1.4.6.tar.gz
# wget http://mirrors.axint.net/apache/apr/apr-util-1.5.1.tar.gz
# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.31.tar.gz
# tar zxvf pcre-8.31.tar.gz
# tar zxvf apr-1.4.6.tar.gz
# tar zxvf apr-util-1.5.1.tar.gz 
# tar zxvf httpd-2.4.3.tar.gz
# cd pcre-8.31 
# ./configure --prefix=/usr/local/pcre
# make && make install
# yum -y install openssl-devel
# cd /usr/software
# cp -r /usr/software/apr-1.4.6 /usr/software/httpd-2.4.3/srclib/apr
# cp -r /usr/software/apr-util-1.5.1 /usr/software/httpd-2.4.3/srclib/apr-util
# cd httpd-2.4.3
# ./configure --prefix=/usr/local/apache \
--enable-dav \
--enable-so \
--enable-maintainer-mode \
--enable-rewrite \
--enable-deflate=shared \
--enable-ssl=shared \
--enable-expires=shared \
--enable-headers=shared \
--enable-static-support \
--with-included-apr \
--with-mpm=prefork \
--enable-cache \
--enable-file-cache \
--with-pcre=/usr/local/pcre
# make && make install
# cp /usr/local/apache/bin/apachectl /etc/init.d/httpd
# vi /etc/init.d/httpd
在#!/bin/sh 下面加上这两行
# chkconfig: 345 90 90
# description: Apache
:wq 
# chkconfig --add httpd
# chkconfig httpd on
# service httpd start
# vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
:wq 
# service iptables restart 
# vi /usr/local/apache/conf/httpd.conf
ServerName localhost:80
User www
Group www 
:wq 
# groupadd www
# useradd www -g www -s /sbin/nologin
# service httpd restart
# /usr/local/apache/bin/httpd -v
# /usr/local/apache/bin/httpd -M
至此apache安装结束。
 

转载于:https://www.cnblogs.com/lwysoft/archive/2012/10/28/2743834.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值