linux下安装Apache
1 - 下载Apache
wget http://apache.fayea.com//apr/apr-1.5.2.tar.gz
2 - 安装Apache
> tar zxf
> cd
> ./configure --prefix=/usr/local
执行./configure
的时候报错:
checking for APR... no
configure: error: APR not found . Please read the documentation
3 - 安装APR
> wget http://apache.fayea.com//apr/apr-1.5.2.tar.gz
> cd apr-1.5.2
> ./configure --prefix=/usr/local
报如下错:
configure: error: in `/usr/local/apr-1.5.2':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
需要安装C的编译器:
yum install gcc
总下载量:21 M
Installed size: 39 M
确定吗?[y/N]:y
下载软件包:
(1/9): cloog-ppl-0.15.7-1.2.el6.x86_64.rpm | 93 kB 00:00
(2/9): cpp-4.4.7-17.el6.x86_64.rpm | 3.7 MB 00:43
(3/9): gcc-4.4.7-17.el6.x86_64.rpm | 10 MB 02:32
(4/9): glibc-devel-2.12-1.192.el6.x86_64.rpm | 988 kB 00:26
(5/9): glibc-headers-2.12-1.192.el6.x86_64.rpm | 617 kB 00:11
(6/9): kernel-headers-2.6.32-642.1.1.el6.x86_64.rpm | 4.4 MB 00:55
(7/9): libgomp-4.4.7-17.el6.x86_64.rpm | 134 kB 00:01
(8/9): mpfr-2.4.1-6.el6.x86_64.rpm | 157 kB 00:01
(9/9): ppl-0.10.2-11.el6.x86_64.rpm | 1.3 MB 00:14
--------------------------------------------------------------------------------------------
总计 70 kB/s | 21 MB 05:11
然后再执行:
> ./configure --prefix=/usr/local
> make && make install
4 - 安装apr-util
> wget http://apache.fayea.com//apr/apr-util-1.5.4.tar.gz
> cd apr-util-1.5.4
> ./configure --prefix=/usr/local/ --with-apr=/usr/local/apr-1.5.2
> make && make install
不加--with-apr
选项,会报configure: error: APR could not be located. Please use the --with-apr option
5 - 安装pcre
> yum install -y gcc gcc-c++
> ./configure --prefix=/usr/local
> make && make install
6 - 重新编译Apache
> ./configure --prefix=/usr/local
> make && make install