Centos7 源码安装Apache

官网下载依赖包和apache的包
Centos7 源码安装Apache
rz上传到虚拟机
Centos7 源码安装Apache
Centos7 源码安装Apache
安装apr
解压:
Centos7 源码安装Apache
进入解压包下编译安装:

Centos7 源码安装Apache
Centos7 源码安装Apache
安装完apr后才能安装apr-util
Centos7 源码安装Apache
Centos7 源码安装Apache
安装pcre
Centos7 源码安装Apache
安装apache
Centos7 源码安装Apache
-C /usr/src 把源码放到/usr/src中
./configure
–prefix=/usr/local/apache:指定安装路径
–sysconfdir=/etc:指定config文件(配置文件)放置的位置
–enable-so:启用动态控制支持
–enable-rewrite:启用地址重启
指定依赖包的路径
–with-apr=/usr/local/apr
–with-apr-util=/usr/local/apr-util
–with-pcre=/usr/local/pcre
依赖包路径一定要写对不然安装会报错

编译和安装:
Centos7 源码安装Apache
安装成功:
Centos7 源码安装Apache
防火墙允许apache
Centos7 源码安装Apache
重启防火墙
Centos7 源码安装Apache
关闭selinux
Centos7 源码安装Apache
查看主机名称
Centos7 源码安装Apache
添加一个host
Centos7 源码安装Apache
做模块链接启动httpd服务:
Centos7 源码安装Apache
Centos7 源码安装Apache
设置服务器名称
Centos7 源码安装Apache
直接查找
Centos7 源码安装Apache
Centos7 源码安装Apache
再检测没有报错
Centos7 源码安装Apache
启动apache
Centos7 源码安装Apache
设置开机自动启动
先给apache设置一个服务请求脚本
Centos7 源码安装Apache
Centos7 源码安装Apache
Centos7 源码安装Apache
Centos7 源码安装Apache
到自己的浏览器访问
Centos7 源码安装Apache
Apache安装和配置成功