apr-1.6.3.tar.gz(下载地址:http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-1.6.3.tar.gz)apr-util-1.6.1.tar.gz(下载地址:http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-util-1.6.1.tar.gz)httpd-2.4.29.tar.gz(下载地址:http://mirrors.shu.edu.cn/apache//httpd/httpd-2.4.29.tar.gz)
yum ?-y ?install ?gcc ?pcre ?pcre-devel ?libtool
tar ?-xzf ?apr-1.6.3.tar.gzcd ?apr-1.6.3/./configure ?&& ?make ?&& ?make ?install
tar ?-xzf ?apr-util-1.6.1.tar.gzcd ?apr-util-1.6.1/./configure ?--with-apr=/usr/local/apr/make ?&& ?make ?install
tar ?httpd-2.4.29.tar.gzcd httpd-2.4.29/./configure ?&& ?make ?&& ?make ?install
#!/bin/bash# chkconfig: 12345 80 90function start_http(){/usr/local/apache2/bin/apachectl ?start}function stop_http(){ /usr/local/apache2/bin/apachectl ?stop}case "$1" instart) ???start_http;; ?stop) ???stop_http;; ?restart) ???stop_http ???start_http;;*) ???echo "Usage : start | stop | restart";;esac
chmod ?a+x ?myhttpdcp ?-arf ?myhttpd ?/etc/init.d/
systemctl ?start ?myhttpd
chkconfig ?--add ?myhttpd
centos7源码编译安装httpd、加入systemctl并设置开机自启动
原文地址:http://blog.51cto.com/12173069/2067565