准备工作:
1.关闭防火墙:
centos6:service iptables stop;chkconfig iptables off
centos7:systemctl stop firewalld;systemctl distable fire walld
2.关闭SElinux
临时关闭:setenforce 0
永久关闭:vim /etc/selinux/config
SELINUX=disabled
1. 安装相应的开发包组及工具**
yum groupinstall "development tools"
yum install openssl-devel**
2. 下载源码download src 网址:http://archive.apache.org/dist/httpd/ ,接着解压缩 **
tar xvf httpd-2.2.34.tar.bz2**
3. 先进入安装包目录下查看相关文档,不着急安装,cd httpd-2.2.34
cat README
cat INSTALL
4. ./configure --help获取其支持使用的选项,接着运行该脚本,根据Makefile.in文件生成Makefile(只有进入httpd-2.2.34这个目录下才能运行这个脚本)
./configure --prefix=/app --sysconfdir=/etc/httpd2 --enable-ssl
--prefix=/PATH: 指定默认安装位置,默认为/usr/local/,这里装在/app目录下
--sysconfdir=/PATH:配置文件安装位置,这里装在/etc/httpd2目录下
--enable-FEATURE[=ARG] 启用ssl功能
5.make 根据Makefile文件,构建应用程序
make -j 2
6. make install 复制文件到相应路径
make install
7. 二进制程序目录导入至PATH环境变量中
vim /etc/profile.d/env.sh
PATH=/app/bin:$PATH
8. . /etc/profile.d/env.sh
9. 启动服务
apachectl start