安装apache httpd2.4

(1)从http://httpd.apache.org/download.cgi下载httpd-2.4.18.tar.gz包

(2)从http://apr.apache.org/download.cgi下载apr-1.5.2.tar.gz、apr-util-1.5.4.tar.gz包,关于Apache APR,全称Apache Portable Runtime,Apache可移植运行库,主要为上层的应用程序提供一个可以跨越多操作系统平台使用的底层支持接口库。在早期 的Apache版本中,应用程序本身必须能够处理各种具体操作系统平台的细节,并针对不同的平台调用不同的处理函数。随着Apache的进一步开 发,Apache组织决定将这些通用的函数独立出来并发展成为一个新的项目。官方如下描述:The mission of the Apache Portable Runtime (APR) project is to create and maintain software libraries that provide a predictable and consistent interface to underlying platform-specific implementations. The primary goal is to provide an API to which software developers may code and be assured of predictable if not identical behaviour regardless of the platform on which their software is built, relieving them of the need to code special-case conditions to work around or take advantage of platform-specific deficiencies or features.

(3)从ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/下载pcre-8.37.tar.gz包,关于pcre,Perl官方如下描述:The PCRE library is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl 5. PCRE has its own native API, as well as a set of wrapper functions that correspond to the POSIX regular expression API. The PCRE library is free, even for building proprietary software.

(4)先解压缩各包,安装pcre,再安装httpd

[plain]  view plain copy
  1. $ gzip -d httpd-2.4.18.tar.gz  
  2. $ tar xvf httpd-2.4.18.tar  
  3. $ gzip -d apr-1.5.2.tar.gz  
  4. $ tar xvf apr-1.5.2.tar  
  5. $ gzip -d apr-util-1.5.4.tar.gz  
  6. $ tar xvf apr-util-1.5.4.tar  
  7. $ mv apr-1.5.2 httpd-2.4.18/srclib/apr  
  8. $ mv apr-util-1.5.4 httpd-2.4.18/srclib/apr-util  
  9. $ gzip -d pcre-8.37.tar.gz  
  10. $ tar xvf pcre-8.37.tar  
  11. $ cd ~/pcre-8.37  
  12. $ ./configure  
  13. $ make && make install  
  14. $ cd ~/httpd-2.4.18  
  15. $ ./configure --prefix=/usr/local/apache2  
  16. $ make && make install  

httpd相关命令在/usr/local/apache2/bin下

配置文件等在/usr/local/apache2/conf下

安装成功后,

执行命令/usr/local/apache2/bin/apachectl start,默认启动端口为80,浏览器访问

  提示

It Works!


官方安装文档

http://httpd.apache.org/docs/2.4/install.html

 

Overview for the impatient

Download $ lynx http://httpd.apache.org/download.cgi
Extract $ gzip -d httpd-NN.tar.gz
$ tar xvf httpd-NN.tar
$ cd httpd-NN
Configure $ ./configure --prefix=PREFIX
Compile $ make
Install $ make install
Customize $ vi PREFIX/conf/httpd.conf
Test PREFIX/bin/apachectl -k start

NN must be replaced with the current version number, and PREFIX must be replaced with the filesystem path under which the server should be installed. If PREFIX is not specified, it defaults to /usr/local/apache2.

Each section of the compilation and installation process is described in more detail below, beginning with the requirements for compiling and installing Apache httpd.

top

Requirements

The following requirements exist for building Apache httpd:

APR and APR-Util
Make sure you have APR and APR-Util already installed on your system. If you don't, or prefer to not use the system-provided versions, download the latest versions of both APR and APR-Util from  Apache APR, unpack them into  /httpd_source_tree_root/srclib/apr and /httpd_source_tree_root/srclib/apr-util (be sure the directory names do not have version numbers; for example, the APR distribution must be under /httpd_source_tree_root/srclib/apr/) and use  ./configure's  --with-included-apr option. On some platforms, you may have to install the corresponding  -dev packages to allow httpd to build against your installed copy of APR and APR-Util.
Perl-Compatible Regular Expressions Library (PCRE)
This library is required but not longer bundled with httpd. Download the source code from  http://www.pcre.org, or install a Port or Package. If your build system can't find the pcre-config script installed by the PCRE build, point to it using the  --with-pcre parameter. On some platforms, you may have to install the corresponding  -dev package to allow httpd to build against your installed copy of PCRE.
Disk Space
Make sure you have at least 50 MB of temporary free disk space available. After installation the server occupies approximately 10 MB of disk space. The actual disk space requirements will vary considerably based on your chosen configuration options, any third-party modules, and, of course, the size of the web site or sites that you have on the server.
ANSI-C Compiler and Build System
Make sure you have an ANSI-C compiler installed. The  GNU C compiler (GCC) from the  Free Software Foundation (FSF) is recommended. If you don't have GCC then at least make sure your vendor's compiler is ANSI compliant. In addition, your  PATH must contain basic build tools such as make.
Accurate time keeping
Elements of the HTTP protocol are expressed as the time of day. So, it's time to investigate setting some time synchronization facility on your system. Usually the  ntpdate or  xntpd programs are used for this purpose which are based on the Network Time Protocol (NTP). See the  NTP homepage for more details about NTP software and public time servers.
Perl 5 [OPTIONAL]
For some of the support scripts like  apxs  or  dbmmanage  (which are written in Perl) the Perl 5 interpreter is required (versions 5.003 or newer are sufficient). If no Perl 5 interpreter is found by the  configure  script, you will not be able to use the affected support scripts. Of course, you will still be able to build and use Apache httpd.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值