Press "Enter" to skip to content

httpd源码安装

主机环境:
[root@test ~]# lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.4.1708 (Core)
Release: 7.4.1708
Codename: Core
[root@test ~]# uname -a
Linux test 3.10.0-693.2.2.el7.x86_64 #1 SMP Tue Sep 12 22:26:13 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

具体安装步骤:
httpd-2.4 依賴于1.4+及以上版本的apr
[root@test httpd-2.4.33]# rpm -qa|grep apr //可yum安装
apr-util-1.5.2-6.el7.x86_64
apr-1.4.8-3.el7_4.1.x86_64
或者编译安装:
安装apr:
[root@test ~]# tar -zxvf apr-1.5.1.tar.gz
[root@test ~]# cd apr-1.5.1
[root@test ~]# ./configure --prefix=/usr/local/apr
[root@test ~]# make && make install
安装apr-util:
[root@test ~]# tar -zxvf apr-util-1.5.4.tar.gz
[root@test ~]# cd apr-util-1.5.4
[root@test ~]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
[root@test ~]# make
[root@test ~]# make install
安装httpd:
[root@test ~]# wget http://mirror.bit.edu.cn/apache//httpd/httpd-2.4.33.tar.gz
--2018-05-20 20:36:55-- http://mirror.bit.edu.cn/apache//httpd/httpd-2.4.33.tar.gz
Resolving mirror.bit.edu.cn (mirror.bit.edu.cn)... 202.204.80.77, 2001:da8:204:2001:250:56ff:fea1:22
Connecting to mirror.bit.edu.cn (mirror.bit.edu.cn)|202.204.80.77|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9076901 (8.7M) [application/octet-stream]
Saving to: ‘httpd-2.4.33.tar.gz’

100%[=============================================================================================================================================================================>] 9,076,901 276KB/s in 17s

2018-05-20 20:37:12 (521 KB/s) - ‘httpd-2.4.33.tar.gz’ saved [9076901/9076901]

[root@test ~]# tar -zxvf httpd-2.4.33.tar.gz
[root@test ~]# cd httpd-2.4.33
[root@test httpd-2.4.33]# ls -l
total 2152
-rw-r--r-- 1 root 40 13496 Apr 16 2015 ABOUT_APACHE
-rw-r--r-- 1 root 40 24803 Feb 9 18:17 acinclude.m4
-rw-r--r-- 1 root 40 66316 Feb 20 06:47 Apache-apr2.dsw
-rw-r--r-- 1 root 40 81355 Feb 20 06:47 Apache.dsw
-rw-r--r-- 1 root 40 9907 Dec 18 2009 apache_probes.d
-rw-r--r-- 1 root 40 2512 Dec 22 2008 ap.d
drwxr-sr-x 6 root 40 4096 Mar 18 07:41 build
-rw-r--r-- 1 root 40 2644 Aug 24 2007 BuildAll.dsp
-rw-r--r-- 1 root 40 2784 Jan 14 19:26 BuildBin.dsp
-rwxr-xr-x 1 root 40 10679 Sep 8 2017 buildconf
-rw-r--r-- 1 root 40 251046 Mar 16 07:19 CHANGES
-rw-r--r-- 1 root 40 45131 Feb 28 05:37 CMakeLists.txt
-rw-r--r-- 1 root 40 13357 Feb 9 18:30 config.layout
-rwxr-xr-x 1 root 40 1192476 Mar 18 07:41 configure
-rw-r--r-- 1 root 40 29527 Oct 18 2017 configure.in
drwxr-sr-x 10 root 40 4096 Mar 18 07:41 docs
-rw-r--r-- 1 root 40 403 Nov 22 2004 emacs-style
-rw-r--r-- 1 root 40 2218 Mar 23 2016 httpd.dep
-rw-r--r-- 1 root 40 4124 Jun 12 2008 httpd.dsp
-rw-r--r-- 1 root 40 8994 Mar 23 2016 httpd.mak
-rw-r--r-- 1 root 40 17267 Mar 18 07:41 httpd.spec
drwxr-sr-x 2 root 40 4096 Mar 18 07:41 include
-rw-r--r-- 1 root 40 3782 May 18 2016 INSTALL
-rw-r--r-- 1 root 40 2909 Nov 15 2011 InstallBin.dsp
-rw-r--r-- 1 root 40 4097 Nov 16 2013 LAYOUT
-rw-r--r-- 1 root 40 79070 Mar 23 2016 libhttpd.dep
-rw-r--r-- 1 root 40 21528 Jan 16 03:33 libhttpd.dsp
-rw-r--r-- 1 root 40 38913 Jan 16 03:33 libhttpd.mak
-rw-r--r-- 1 root 40 25478 Feb 21 22:56 LICENSE
-rw-r--r-- 1 root 40 10845 Sep 19 2017 Makefile.in
-rw-r--r-- 1 root 40 53539 Feb 20 06:47 Makefile.win
drwxr-sr-x 28 root 40 4096 Mar 18 07:41 modules
-rw-r--r-- 1 root 40 720 Feb 21 22:56 NOTICE
-rw-r--r-- 1 root 40 13884 Mar 20 2016 NWGNUmakefile
drwxr-sr-x 7 root 40 4096 Mar 18 07:41 os
-rw-r--r-- 1 root 40 4642 Jan 24 2014 README
-rw-r--r-- 1 root 40 13317 Mar 23 2016 README.cmake
-rw-r--r-- 1 root 40 4418 Aug 28 2014 README.platforms
-rw-r--r-- 1 root 40 10184 Oct 31 2010 ROADMAP
drwxr-sr-x 3 root 40 4096 Mar 18 07:41 server
drwxr-sr-x 2 root 40 4096 Mar 18 07:41 srclib
drwxr-sr-x 4 root 40 4096 Mar 18 07:41 support
drwxr-sr-x 2 root 40 4096 Mar 18 07:41 test
-rw-r--r-- 1 root 40 8183 Mar 1 2007 VERSIONING
[root@test httpd-2.4.33]./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-included-apr
[root@test httpd-2.4.33]make && make install
[root@test httpd-2.4.33]/usr/local/apache/bin/apachectl start //启动httpd
启动完浏览器输入你主机的IP地址验证即可.

Be First to Comment

发表评论

电子邮件地址不会被公开。 必填项已用*标注