Red Hat Enterprise Linux 7.3下Apache安装

一、简介

Apache HTTP Server(简称Apache)是Apache软件基金会的一个开放源码的网页服务器,可以在大多数计算机操作系统中运行,由于其多平台和安全性被广泛使用,是最流行的Web服务器端软件之一。它快速、可靠并且可通过简单的API扩展,将Perl/Python等解释器编译到服务器中。

二、准备

1、环境

内核版本:3.10.0-514.el7.x86_64

2、下载 APR 和 APR-Util包

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

3、下载pcre包

https://sourceforge.net/projects/pcre/files/pcre/

4、下载apache包

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

三、安装

按照官方文档的要求,必须安装APR、APR-Util、PCRE,gcc-c++等包,文档URL地址http://httpd.apache.org/docs/2.4/install.html

1、安装gcc相关依赖

# yum -y install  gcc*

2、安装apr

# tar zxvf apr-1.5.2.tar.gz

# cd apr-1.5.2

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

# make

# make install

3、安装apr-util

 # tar zxvf apr-util-1.5.4.tar.gz

# cd apr-util-1.5.4

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

# make

# make install

4、安装pcre

# tar zxvf pcre-8.38.tar.gz

# cd pcre-8.38

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

# make

# make install

5、安装apache

# tar zxvf httpd-2.4.23.tar.gz

# cd httpd-2.4.23

# ./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

6、测试是否安装成功

查看apache版本

四、启动

1、启动命令

# /usr/local/apache/bin/apachectl start

2、访问测试

更多Apache相关教程见以下内容

猜你喜欢

转载自www.linuxidc.com/Linux/2017-05/143939.htm