一. 首先安装编译工具:
// yum install gcc
//yum install gcc-c++
//yum install gcc-g77
二. 前往官方站点下载源码包。
// 到/usr/local/src下进行下载
// wget http://mirror.bit.edu.cn/apache/httpd/httpd-2.4.41.tar.gz 下载源码包。
// tar -zxvf httpd-2.4.41.tar.gz 将压缩包解压。
三. 按照编译安装程序源码包的步骤进行安装。
步骤:
- ./configure --prefix=安装路径–>指定安装路径
- –with- =安装路径 -->关联其他软件。
- make 配置文件配置文件。
- make install 安装
- 启动。
具体安装过程。
- 到 /usr/local/ httpd-2.4.41下执行 ./configure --prefix=/usr/local/apache
[root@fei httpd-2.4.41]# ./configure --prefix=/usr/local/apache
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
configure:
configure: Configuring Apache Portable Runtime library...
configure:
checking for APR... no
configure: error: APR not found. Please read the documentation.
- 通过最后一行错误提示,需要安装Apr。
将apr下载到/usr/local/src下,进入安装apr
[root@fei src]# ls
apr-1.7.0 httpd-2.4.41
apr-1.7.0.tar.gz httpd-2.4.41.tar.gz