Linux apache源码编译安装

下载、解压Apache源码

[[email protected] ~]# mkdir /usr/local/apache

[[email protected] ~]# cd /usr/local/apache/

[[email protected] apache]# wget http://mirrors.sohu.com/apache/httpd-2.4.25.tar.gz

[[email protected] apache]# tar -zxvf httpd-2.4.25.tar.gz

设置安装环境

[[email protected] apache]# ls
httpd-2.4.25  httpd-2.4.25.tar.gz

[[email protected] apache]# cd httpd-2.4.25/

[[email protected] httpd-2.4.25]# ./configure --prefix=/opt/httpd-2.4.25 --enable-so --enable-mods-shared=most --enable-proxy-balancer=shared --enable-proxy-http=shared --enable-p
roxy-ajp --enable-rewrite
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
configure:
configure: Configuring Apache Portable Runtime library...
configure:
checking for APR... no
configure: error: APR not found.  Please read the documentation.
[[email protected] httpd-2.4.25]#
[[email protected] httpd-2.4.25]# cd /usr/local/src/

[[email protected] src]# wget http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-1.5.2.tar.gz

[[email protected] src]# tar zxvf apr-1.5.2.tar.gz
[[email protected] src]# cd apr-1.5.2/

[[email protected] apr-1.5.2]# ./configure --prefix=/usr/local/apr

[[email protected] apr-1.5.2]# make

[[email protected] apr-1.5.2]# make install

[[email protected] httpd-2.4.25]# ./configure --prefix=/opt/httpd-2.4.25 --enable-so --enable-mods-shared=most --enable-proxy-balancer=shared --enable-proxy-http=shared --enable-proxy-ajp --enable-rewrite
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
configure:
configure: Configuring Apache Portable Runtime library...
configure:
checking for APR... yes
  setting CC to "gcc"
  setting CPP to "gcc -E"
  setting CFLAGS to " -g -O2 -pthread"
  setting CPPFLAGS to " -DLINUX -D_REENTRANT -D_GNU_SOURCE"
  setting LDFLAGS to " "
configure:
configure: Configuring Apache Portable Runtime Utility library...
configure:
checking for APR-util... no
configure: error: APR-util not found.  Please read the documentation.

[[email protected] httpd-2.4.25]#

[[email protected] src]# wget http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-util-1.5.4.tar.gz

[[email protected] src]# tar zxvf apr-util-1.5.4.tar.gz

[[email protected] apr-util-1.5.4]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr

[[email protected] apr-util-1.5.4]# make

[[email protected] apr-util-1.5.4]# make install

[[email protected] httpd-2.4.25]# ./configure --prefix=/opt/httpd-2.4.25 --enable-so --enable-mods-shared=most --enable-proxy-balancer=shared --enable-proxy-http=shared --enable-proxy-ajp --enable-rewrite --with-apr-util=/usr/local/apr-util/

[[email protected] httpd-2.4.25]# ./configure --prefix=/opt/httpd-2.4.25 --enable-so --enable-mods-shared=most --enable-proxy-balancer=shared --enable-proxy-http=shared --enable-proxy-ajp --enable-rewrite --with-apr-util=/usr/local/apr-util/
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
configure:
configure: Configuring Apache Portable Runtime library...
configure:
checking for APR... yes
  setting CC to "gcc"
  setting CPP to "gcc -E"
  setting CFLAGS to " -g -O2 -pthread"
  setting CPPFLAGS to " -DLINUX -D_REENTRANT -D_GNU_SOURCE"
  setting LDFLAGS to " "
configure:
configure: Configuring Apache Portable Runtime Utility library...
configure:
checking for APR-util... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for gcc option to accept ISO C99... -std=gnu99
checking for pcre-config... false
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/

最好下载pcre 不要下载pcre2.版本

[[email protected] src]# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.39.tar.gz

[[email protected] src]#

[[email protected] src]#

[[email protected] src]# tar zxfv pcre-8.39.tar.gz
[[email protected] src]# cd pcre-8.39/

[[email protected] pcre-8.39]# ./configure --prefix=/usr/local/pcre

[[email protected] pcre-8.39]# make && make install

[[email protected] pcre-8.39]# cd ../httpd-2.4.25/
[[email protected] httpd-2.4.25]# ./configure --prefix=/opt/httpd-2.4.25 --enable-so --enable-mods-shared=most --enable-proxy-balancer=shared --enable-proxy-http=shared --enable-proxy-ajp --enable-rewrite --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre

--enable-so  表示让Apache可以支持DSO模式

--enable-mods-shared=most  表示动态编译大部分常用的模块。当然也可以有选择地加载一些模块

,most的意思是只包含通常常用的模块,并且以动态加载模式加载。

--enable-proxy-balancer=shared

--enable-proxy-http=shared

--enable-proxy-ajp

--enable-rewrite

3.编译、安装软件

[[email protected] httpd-2.4.25]# make

[[email protected] httpd-2.4.25]# make install

时间: 2024-12-25 04:04:20

Linux apache源码编译安装的相关文章

Linux下源码编译安装rpy2

R(又称R语言)是一款开源的跨平台的数值统计和数值图形化展现工具.rpy2是Python直接调用R的第三方库,它可以实现使用python读取R的对象.调用R的方法以及Python与R数据结构转换等.这里主要介绍一下在没有网络的情况下,源码安装rpy2的一些方法,以作备忘. 1.python安装 $ wget https://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz $ tar zvxf Python-2.7.6.tgz $ cd Pytho

linux下源码编译安装mysql详解

1.redhat5环境下,首先安装编译环境 yum groupinstall -y  "Development Libraries"   "Development Tools" 2.由于源码编译mysql需要cmake命令,所以先要编译安装cmake包 首先下载cmake包,这里下载使用cmake-2.8.8.tar.gz tar xf cmake-2.8.8.tar.gz cd cmake-2.8.8 ./configure make && mak

Apache源码编译安装脚本

??Apache是开源的的.最流行的Web服务器软件之一,它快速.可靠并且可通过简单的API扩充,将Perl/Python/PHP等解释器编译到服务器中.Apache的模块超多,以及具有运行稳定,强大的rewrite功能.动态处理能力强等优点,在追求稳定的业务环境下被广泛使用. ??以下是Apache2.4版本prefork模式的源码编译脚本: #!/bin/bash # #*************************************************************

Linux环境源码编译安装SVN

zhoulf 2015/2/28 原创 安装说明 安装环境:Red Hat Enterprise Linux 安装方式:源码安装 软件:apr-1.5.0.tar.gz.apr-iconv-1.2.1.tar.gz.apr-util-1.5.3.tar.gz.sqlite-amalgamation-201311181848.zip.subversion-1.8.4.tar.gz 安装前提 安装之前要安装apr.apr-util.apr-iconv软件 安装 将subversion-1.8.4.t

Linux httpd源码编译安装

# wget http://apache.fayea.com/httpd/httpd-2.2.31.tar.bz2 去官网下载源码包 # mv httpd-2.2.31.tar.bz2 /usr/local/src/ 为方便管理源码包 统一放在一个文件下 # tar -jxvf httpd-2.2.31.tar.bz2 # cd httpd-2.2.31 # ls ABOUT_APACHE config.log httpd.mak Makefile README acinclude.m4 con

Linux下源码编译安装程序

一.程序的组成部分 Linux下程序大都是由以下几部分组成:     二进制文件:也就是可以运行的程序文件     库文件:就是通常我们见到的lib目录下的文件     配置文件:这个不必多说,都知道     帮助文档:通常是我们在linux下用man命令查看的命令的文档 二.linux下程序的存放目录     linux程序的存放目录大致有三个地方:     /etc, /bin, /sbin, /lib  :系统启动就需要用到的程序,这些目录不能挂载额外的分区,必须在根文件系统的分区上   

Apache源码编译安装

精髓前言: 解析JAVA程序用:tomcat.resin.weblogic.jboss 解析.asp .aspx程序用:pws,iis  后端数据库为:sql server,access IP PV UV: IP:internet protocol    --internet协议 pv:page view         --访问量 uv:unique visitor      --独立访客 简单介绍cookie: cookie: 访问一个网站的时候,网站就会给你发一个cookie,独一无二的

centos 7.1 apache 源码编译安装

Apache编译安装 一,需要软件: 1.apr-1.5.2.tar.gz 2.apr-util-1.5.4.tar.gz 3.pcre-8.38.tar.gz 4.httpd-2.4.23.tar.gz 二,安装apr yum install gcc libtools -y    tar zxf apache/apr-1.5.2.tar.gz   cd apr-1.5.2  ./configure --prefix=/usr/local/apr make && make install

ubuntu linux下源码编译安装lamp环境

安装zlib库 tar -zvxf zlib-1.2.8.tar.gz cd zlib-1.2.8 ./configure make && make install 2.安装apache2.4.23 tar -zvxf httpd-2.4.23.tar.gz cd httpd-2.2.23 ./configure  --prefix=/usr/local/http2 \ --enable-modules=all \          //支持动态,静态加载模块 --enable-rewri