一、开胃小菜
1、安装相应编译工具: gcc gcc-c++ gcc-c77 ; expat-devel -y
2、分析安装平台
3、下载源码包:
官方站点 例:[http://mirror.bit.edu.cn/apache/apr/](http://mirror.bit.edu.cn/apache/apr/)
保存位置:usr/local/src
让我们先开始必要的准备工具
安装编译工具
首先,我们先来安装wget命令
[root@localhost ~]# mount /dev/sr0 /media/
mount: /dev/sr0 is write-protected, mounting read-only
[root@localhost ~]# yum install wget
...
Installed:
wget.x86_64 0:1.14-18.el7
Complete!
中间无数个省略号。。哈哈,看到了Complete!就知道已经安装完成了
接下来正式开始安装编译工具
[root@localhost ~]# yum install gcc gcc-c++ gcc-c77
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
...
Complete!
二、编译安装程序源码包步骤
1、./configure 软件配置和系统检查
a.指定安装路径 --prefix=/usr/local/apache
b.启用禁用功能 --enable-ssl
c.与其他软件关联 --with-apr
d.检查
定义好的功能和检测的安装环境信息写入到 makefile文件中,
2、 make
3、 make install
【注】:如果make出错 需要执行 make clean 并且最好重新 ./configure
4、PREFIX/bin/*ctl start
5、cp PREFIX/bin/*ctl /etc/rc.d/init.d/httpd
service httpd start
三、开始安装httpd
使用官方站点的链接安装【如下】,或者在电脑上下载之后直接拖入到ssh工具里我们指定的路径下
[root@localhost ~]# cd /usr/local/src
[root@localhost src]# wget http://mirror.bit.edu.cn/apache/httpd/httpd-2.4.41.tar.gz
--2020-03-19 19:26:57-- http://mirror.bit.edu.cn/apache/httpd/httpd-2.4.41.tar.gz
Resolving mirror.bit.edu.cn (mirror.bit.edu.cn)... 202.204.80.77, 219.143.204.117, 2001:da8:204:1205::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: 9267917 (8.8M) [application/octet-stream]
Saving to: ‘httpd-2.4.41.tar.gz’
100%[==========================================