步骤1 下载httpd源码和依赖包 httpd下载网址:http://httpd.apache.org/, 将下载的apr、apr-util解压后 移动到 /user2/httpd-2.4.43/srclib
步骤2 安装开发环境包组及相关依赖的包:
[root@oracle httpd-2.4.43]# yum install -y pcre-devel openssl-devel expat-devel
步骤3 切换到httpd目录下,开始./configure编译
[root@oracle httpd-2.4.43]# ./configure --prefix=/user2/httpd24--enable-so--enable-ssl--enable-cgi--enable-rewrite--with-zlib--with-included-apr
步骤4 执行make && make install 编译
[root@oracle httpd-2.4.43]# make && make install
步骤5 定义环境变量并生效
[root@oracle bin]# echo 'PATH=/user2/httpd24/bin:$PATH' > /etc/profile.d/httpd24.sh
[root@oracle bin]# ./etc/profile.d/httpd24.sh
步骤6 启动和关闭apache服务
[root@oracle httpd-2.4.43]#apachectl start
[root@oracle httpd-2.4.43]#apachectl stop