日期:2014-05-17  浏览次数:20667 次

Apache(一)安装

本文仅记录学习Apache HttpServer的过程,以便加深记忆及以后查找

?

一、下载Apache HttpServer

?

? ? ? 下载地址:http://httpd.apache.org/

?

二、解压

? ? ? gzip -dvf?httpd-2.4.1.tar.gz?

?

? ? ? tar -xvf?httpd-2.4.1.tar

?

安装前需依次装好 apr(Apache Portable Runtime) 和 apr-util(安装apu的时候需要指定apr安装目录)

?

三、安装前的配置 执行./configure options

?

解压后进入httpd-2.4.1目录,执行configure options... [var=value]...用以指定apache选项和

?

? ? 参数

-c= ?--cache-file的简写,指定测试结果存放文件

?

-n= ?--no-cache的简写,不输出测试结果到文件

?

-q= ?--quiet的简写,在执行configure期间不输出checking....信息

?

--silent= ?同-q

?

--srcdir= ?指定源文件目录,默认是configure所在目录或其父目录

?

?

? ? ? ??--prefix= ? 指定Apache HttpServer安装目录,默认安装目录是/usr/local/apache2

?

--exec-prefix= 设定安装目录的顶级目录(默认是--prefix指定的目录),通过layout相关参数可指定安装目录结

?

构;在解压目录中的config.layout文件中有预定义的一些目录结构;通过以下参数可自定义安装目

?

录结构

?

--bindir=?放置可执行文件的目录(默认是eprefix/bin)

?

--libdir= 放置库文件目录(默认是eprefix/lib)

?

? ?....其他目录结构参数参考?http://httpd.apache.org/docs/2.4/programs/configure.html(中的Fine

?

tuning of the installation directories段落)

?

--with-apr=DIR ?指定apr安装目录

?

--with-apr-util=DIR 指定apu安装目录

?

四、编译

执行 make

?

五、安装

执行 make install

?