安装过程主要包括以下几个步骤:

1,安装环境描述 2,编译安装 3,安装后环境的配置 4,后记 5,具体配置参数英译汉


1,安装环境描述

   VMware workstation 10,CentOS 6.5 64位,强烈建议系统中事先安装开始工具包“Development Tools”,以免在编译安装httpd软件是出现错误(介绍就这么多, Let's go....^_^)

2,编译安装步骤

   首先在官网下载http的源码包,下载在本地临时目录(/tmp)

   wget http://mirror.bit.edu.cn/apache//httpd/httpd-2.2.26.tar.gz

wKioL1MQiyXh2C9CAAEt3pNJLnM593.jpg

对下载后的文件进行解压,如下图:

wKiom1MQi5eAJZ4WAADTSN3h1Oo431.jpg

切换到httpd-2.2.26目录,如下图:

wKioL1MQjXqR3PJSAAFX7SKE_S8591.jpg

运行命令./configure --prefix=/usr/local/apache 如下图:

wKiom1MQi0vRWsEfAADwP07X89U255.jpg

出现如下图所示,安装前环境检查成功:wKioL1MQiyKgT0s0AAHHtaSqNy0816.jpg

面进行软件的安装前编译,使用make命令,如下图所示:

wKiom1MQi0iRerkWAAERT2mNUn4295.jpg

出现如下图所示,说明编译成功:

wKiom1MQi0mQTIGUAAMAoKh-yyk182.jpg

使用命令make install 进行http软件的安装,如下图所示:

wKiom1MQjf-CaNSyAADTgty_JUU420.jpg

如下图所示说明安装成功:

切换到安装目录/usr/local/apache,并查看所安装的文件及目录:

wKioL1MQiyaSFPkBAAFCFl-wxv0601.jpg


至此软件安装部分已经完成,但是不要放松呦!!!!^_^

3,安装后环境的配置及启动

   为了能够在系统中使用命令启动httpd,需要在目录/etc/profile.d中新建httpd.sh文件,并输入以下内容:

       export PATH=$PATH:/usr/local/apache/bin 如下图:


wKiom1MQi0mSFYenAACWG2yzoB0160.jpg

使用命令 source /etc/profile.d/httpd.sh 使配置文件生效,如下图:

wKioL1MQiySxwj41AADvsWZlWAw246.jpg

启动服务,输入以下命令,如下图:

wKioL1MQiybi-_mYAAC0qOGQvSo126.jpg


打开IE浏览器输入地址,http://你的VMware虚拟主机地址,如下图,说明已经成功启动


wKiom1MQi0vA7iUdAACV652RwkI240.jpg

至此软件安装已经全部完成。


4,后记


   众所周知,Linux系统,RPM软件包的安装,都有相应的默认的安装路径,方便软件管理,而Linux系统下源码编译软件包的安装有很大的灵活性,可以根据用户自己的需要进行相应安装模块的增减工作,以满足不同用户的不同需求。但是,也给其它依赖于http软件工作的软件安装带来了麻烦,不像RPM软件安装一样,便于其它软件包的安装编译依赖性检查,所以http软件的开发环境也要进行标准化的配置。

   http头文件的标准路径输出:

       #ln -sv /usr/local/apache/include /usr/include/httpd

   http库文件的标准路径输出:

       在目录/etc/ld.so.conf.d中新建文件httpd.conf,并输入内容/usr/local/apache/lib,命令如下:

       #echo "/usr/local/apache/lib" >/etc/ld.so.conf.d/httpd.conf

   重新启用库文件路径缓存,命令如下:

       #ldconfig

   使用系统man命令可以查看http帮助文档,命令如下:

      #echo "MANPATH /usr/local/apache/man" >> /etc/man.conf



5,具体配置参数英译汉(翻译的不太准,还请大家谅解)

`configure' configures this package to adapt to many kinds of systems.


Usage: ./configure [OPTION]... [VAR=VALUE]...


Installation directories:


 --prefix=PREFIX         install architecture-independent files in PREFIX


                         [/usr/local/apache2]


                         默认安装路径


 --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX


                         [PREFIX]可执行文件安装路径,默认是依赖于--prefix


                         指定的安装路径


By default, `make install' will install all the files in

`/usr/local/apache2/bin', `/usr/local/apache2/lib' etc.  You can specify

an installation prefix other than `/usr/local/apache2' using `--prefix',

for instance `--prefix=$HOME'.

简译:如果默认使用./configure进行软件的环境安装配置,则软件会默认安装在

/usr/local/apache2目录中,其中可执行文件在/usr/local/apache2/bin,库文件在

/usr/local/apache2/lib等等

For better control, use the options below.

使用以下可选项,可以更有效的使用http服务


Fine tuning of the installation directories:


软件默认安装目录的调整,方便调优(可选)


 --bindir=DIR            user executables [EPREFIX/bin]


 用户可执行文件的目录


 --sbindir=DIR           system admin executables [EPREFIX/sbin]


 管理员可执行文件的目录


 --libexecdir=DIR        program executables [EPREFIX/libexec]


 程序执行所用到的库文件目录


 --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]


 软件配置文件目录(里面的文件为只读属性,所有者可写)


 --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]


 可修改的软件运行状态目录


 --localstatedir=DIR     modifiable single-machine data [PREFIX/var]


 可修改的本机访问状态目录


 --libdir=DIR            object code libraries [EPREFIX/lib]


 对象编码库文件目录


 --includedir=DIR        C header files [PREFIX/include]


 新版本的C语言头文件


 --oldincludedir=DIR     C header files for non-gcc [/usr/include]


 向下兼容的老版本C语言头文件


 --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]


 只读属性,应用程序目录(存放位置)


 --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]


 只读属性,程序数据存放的目录


 --infodir=DIR           info documentation [DATAROOTDIR/info]


 应用程序信息文档目录


 --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]


 本地程序依赖的数据目录


 --mandir=DIR            man documentation [DATAROOTDIR/man]


 应用程序手册目录


 --docdir=DIR            documentation root [DATAROOTDIR/doc/PACKAGE]


 应用程序目录


 --htmldir=DIR           html documentation [DOCDIR]

 静态html文件目录

 --dvidir=DIR            dvi documentation [DOCDIR]

 dvi文件目录

 --pdfdir=DIR            pdf documentation [DOCDIR]

 pdf文件目录

 --psdir=DIR             ps documentation [DOCDIR]

 ps文件目录

System types:


系统类选项

 --build=BUILD     configure for building on BUILD [guessed]


 --host=HOST       cross-compile to build programs to run on HOST [BUILD]


 进行交叉编译程序运行在特定机器上


 --target=TARGET   configure for building compilers for TARGET [HOST]


 对目标机器进行构建编译


Optional Features:


可选项列表


 --disable-option-checking  ignore unrecognized --enable/--with options


 禁用选项检查


 --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)


 禁用新特性


 --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]


 启用新特性 如ARG特性


 --enable-layout=LAYOUT


 --enable-v4-mapped      Allow IPv6 sockets to handle IPv4 connections


 允许IPv6套接字处理IPv4的连接


 --enable-exception-hook Enable fatal exception hook


 启用异常处理挂钩功能


 --enable-maintainer-mode


                         Turn on debugging and compile time warnings


 开启调试及编译时间提醒


 --enable-pie            Build httpd as a Position Independent Executable


 构建一个位置独立的可执行http


 --enable-modules=MODULE-LIST


 启用的模块,多个模块名间用空格分开


                         Space-separated list of modules to enable | "all" |


                         "most"


 --enable-mods-shared=MODULE-LIST


 启用共享模块,多个模块名间用空格分开


                         Space-separated list of shared modules to enable |


                         "all" | "most"


 --disable-authn-file    file-based authentication control


 禁用基本文件的认证机制


 --enable-authn-dbm      DBM-based authentication control


 启用基本数据库管理的认证机制


 --enable-authn-anon     anonymous user authentication control


 启用匿名用户认证机制


 --enable-authn-dbd      SQL-based authentication control


 启用基本SQL认证机制


 --disable-authn-default authentication backstopper


 禁用默认的认证机制


 --enable-authn-alias    auth provider alias


 启用基于别名的认证机制


 --disable-authz-host    host-based authorization control


 禁用基于主机的认证机制


 --disable-authz-groupfile


 禁用基于组文件的认证机制


                         'require group' authorization control


 --disable-authz-user    'require user' authorization control


 禁用基于用户的认证机制


 --enable-authz-dbm      DBM-based authorization control


 启用基于数据库管理的认证机制


 --enable-authz-owner    'require file-owner' authorization control


 启用基于文件所有者的认证机制


 --enable-authnz-ldap    LDAP based authentication


 启用基于轻量级目录访问协议认证的机制


 --disable-authz-default authorization control backstopper


 禁用


 --disable-auth-basic    basic authentication


 禁用基础认证机制


 --enable-auth-digest    RFC2617 Digest authentication


 基于文档RFC2617的认证机制


 --enable-isapi          isapi extension support


 启用对IIS api的扩展支持


 --enable-file-cache     File cache


 启用静态文件高速缓存


 --enable-cache          dynamic file caching


 启用动态文件高速缓存


 --enable-disk-cache     disk caching module


 启用磁盘高速缓存


 --enable-mem-cache      memory caching module


 启用内存高速缓存


 --enable-dbd            Apache DBD Framework/Database-independent framework with driver (DBD)


 启用apache数据库独立框架驱动的机制


 --enable-bucketeer      buckets manipulation filter


 启用欺骗过滤机制


 --enable-dumpio         I/O dump filter


 启用I/O转储过滤器机制


 --enable-echo           ECHO server


 启用回显服务器


 --enable-example        example and demo module


 启用事例和样本


 --enable-case-filter    example uppercase conversion filter


 启用大写字母转换过滤


 --enable-case-filter-in example uppercase conversion input filter


 启用大写字母输入转换过滤


 --enable-reqtimeout     Limit time waiting for request from client


 启用对客户端的请求待时间的限制


 --enable-ext-filter     external filter module


 启用第三方的过滤模块


 --disable-include       Server Side Includes


 禁用服务器内制所包含的过滤


 --disable-filter        Smart Filtering


 禁用智能过滤


 --enable-substitute     response content rewrite-like filtering


 启用回复信息,类似于内容重写的过滤机制


 --disable-charset-lite  character set translation


 禁用字符集转换


 --enable-charset-lite   character set translation


 启用字符集转换


 --enable-deflate        Deflate transfer encoding support


 启用减少转换编码的支持


 --enable-ldap           LDAP caching and connection pooling services


 启用LDAP缓存和连接池服务


 --disable-log-config    logging configuration


 禁用日志配置


 --enable-log-forensic   forensic logging


 启用标准的日志记录


 --enable-logio          input and output logging


 启用输入输出日志记录


 --disable-env           clearing/setting of ENV vars


 禁用环境变量的清空与设置


 --enable-mime-magic     automagically determining MIME type


 启用自动识别MIME类型


 Multipurpose Internet Mail Extensions


 多用途互联网邮件扩展类型


 --enable-cern-meta      CERN-type meta files


 启用CERN类型元文件


 --enable-expires        Expires header control


 启用过期头信息控制


 --enable-headers        HTTP header control


 启用http头文件控制


 --enable-ident          RFC 1413 identity check


 启用RFC1413文件规定的一致性检查


 --enable-usertrack      user-session tracking


 启用用户会话跟踪


 --enable-unique-id      per-request unique ids


 启用每个访问请求的唯一ID


 --disable-setenvif      basing ENV vars on headers


 禁用在文件头信息、环境变量中定义的变量


 --disable-version       determining httpd version in config files


 禁用在配置文件中检查Http的版本


 --enable-proxy          Apache proxy module


 启用代理模块


 --enable-proxy-connect  Apache proxy CONNECT module


 启用代理链接模块


 --enable-proxy-ftp      Apache proxy FTP module


 启用代理文件传输模块


 --enable-proxy-http     Apache proxy HTTP module


 启用代理HTTP模块


 --enable-proxy-scgi     Apache proxy SCGI module


 启用代理SCGI模块


 --enable-proxy-ajp      Apache proxy AJP module


 启用代理AJP模块 AJP是定向包协议


 --enable-proxy-balancer Apache proxy BALANCER module


 启用代理负载均衡模块


 --enable-ssl            SSL/TLS support (mod_ssl)


 启用安全套接层支持


 --enable-distcache      Select distcache support in mod_ssl


 启用在安全套接层模块中对硬盘调整缓存查询的支持


 --enable-optional-hook-export


 启用可选的回钩导出机制


                         example optional hook exporter


 --enable-optional-hook-import


   启用可选的回钩输入机制


                         example optional hook importer


 --enable-optional-fn-import


 启用可选函数输入机制


                         example optional function importer


 --enable-optional-fn-export


 启用可选函数输出机制


                         example optional function exporter


 --enable-static-support


 启用构建一个支持二进制文件的静态链接


                     Build a statically linked version of the support binaries


 --enable-static-htpasswd


 启用构建一个htpasswd的静态链接版本


                         Build a statically linked version of htpasswd


 --enable-static-htdigest


 启用构建支持http 摘要静态链接版本


                         Build a statically linked version of htdigest


 --enable-static-rotatelogs


 启用构建日志回滚的静态链接版本


                         Build a statically linked version of rotatelogs


 --enable-static-logresolve


 启用构建日志解析的静态链接版本


                         Build a statically linked version of logresolve


 --enable-static-htdbm


 启用构建 http数据库管理的静态链接版本


                        Build a statically linked version of htdbm


 --enable-static-ab


                       Build a statically linked version of ab


 --enable-static-checkgid


 启用构建检查gid的静态链接版本                        


                        Build a statically linked version of checkgid


 --enable-static-htcacheclean


 启用构建httpd缓存清空的静态版本链接


                         Build a statically linked version of htcacheclean


 --enable-static-httxt2dbm


 启用构建http文本文件转换成数据库管理的静态链接版本


                         Build a statically linked version of httxt2dbm


 --enable-http


 启用http 协议处理


           HTTP protocol handling


 --disable-mime          mapping of file-extension to MIME


 禁用文件扩展映射到MIME


 --enable-dav            WebDAV protocol handling


 启用WebDAV 协议的处理


 WebDAV Web-based Distributed Authoring and Versioning) 一种基于 HTTP 1.1协议的通信协议


 --disable-status        process/thread monitoring


 禁用进程/线程监控


 --disable-autoindex     directory listing


 禁用目录索引显示


 --disable-asis          as-is filetypes


 禁用as-is文件类型


 --enable-info           server information


 启用服务器信息显示


 --enable-suexec         set uid and gid for spawned processes


 启用由用户ID和组ID所生成的进程


 --disable-cgid          CGI scripts


 禁用CGI脚本


 --enable-cgi            CGI scripts


 启用CGI脚本


 --disable-cgi           CGI scripts


 禁用CGI脚本


 --enable-cgid           CGI scripts


 启用CGI脚本


 --enable-dav-fs         DAV provider for the filesystem


 启用文件系统的DAV提供者 Distributed Authoring and Versioning


                         分布式创作和版本控制


 DAV不仅被看作HTTP的扩展,甚至被看作一种网络文件系统(network filesystem


 --enable-dav-lock       DAV provider for generic locking


 启用对DAV的锁定


 --enable-vhost-alias    mass virtual hosting module


 请允许虚拟主机昵称


 --disable-negotiation   content negotiation


 禁用内容协商


 --disable-dir           directory request handling


 禁用目录请求处理


 --enable-p_w_picpathmap       server-side p_w_picpathmaps


 启用服务器端的图片映射


 --disable-actions       Action triggering on requests


 禁用请求的存储过程协作


 --enable-speling        correct common URL misspellings


 启用URL拼写检查


 --disable-userdir       mapping of requests to user-specific directories


 禁用对用户特殊目录的请求映射


 --disable-alias         mapping of requests to different filesystem parts


 禁用对不用文件系统部分的请求遇敌


 --enable-rewrite        rule based URL manipulation


 启用基于URL的地址重写


 --enable-so             DSO capability


 启用设备软件优化的能力


Optional Packages:


 --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]


 --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)


 --with-included-apr     Use bundled copies of APR/APR-Util


 --with-apr=PATH         prefix for installed APR or the full path to


                            apr-config


 --with-apr-util=PATH    prefix for installed APU or the full path to


                            apu-config


 --with-pcre=PATH        Use external PCRE library


 --with-port=PORT        Port on which to listen (default is 80)


 --with-sslport=SSLPORT  Port on which to securelisten (default is 443)


 --with-z=DIR            use a specific zlib library


 --with-sslc=DIR         RSA SSL-C SSL/TLS toolkit


 --with-ssl=DIR          OpenSSL SSL/TLS toolkit


 --with-mpm=MPM          Choose the process model for Apache to use.


                         MPM={beos|event|worker|prefork|mpmt_os2|winnt}


 --with-module=module-type:module-file


                         Enable module-file in the modules/<module-type>


                         directory.


 --with-program-name     alternate executable name


 --with-suexec-bin       Path to suexec binary


 --with-suexec-caller    User allowed to call SuExec


 --with-suexec-userdir   User subdirectory


 --with-suexec-docroot   SuExec root directory


 --with-suexec-uidmin    Minimal allowed UID


 --with-suexec-gidmin    Minimal allowed GID


 --with-suexec-logfile   Set the logfile


 --with-suexec-safepath  Set the safepath


 --with-suexec-umask     umask for suexec'd process