(5).编译
make
make clean
make install 编译安装
此时报错:
mod_proxy_balancer.c:25:24: fatal error: apr_escape.h: No such file or directory
原因是
开始没有编译安装apr和apr-util。
解决办法有两个。
跳过该错误,后期指定该模块,一般安装不成功,推荐解决该问题;
或者编译参数可以去掉该模块,禁止该模块,添加--disable-proxy;
更换软件版本,考虑到操作系统和软件兼容性问题;
上面使用的办法,详情:
结果使用这个方式时又报错:
rm: cannot remove 'libtoolT': No such file or directory config.status: execu
编辑configure这个文件,将 $RM “$cfgfile” 那行注释掉 ,然后重新编译即可。
然而,等我解决完这些问题之后,再去编译,同样报哪个错误,遂用第一个方法,成功。
./configure --prefix=/usr/local/apache2 --disable-proxy
(6).运行httpd:
/usr/local/apache2/bin/apachectl start
报错:httpd: Could not reliably determine the server's fully qualified domain name
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
2)编辑httpd.conf文件,搜索"#ServerName",添加ServerName localhost:80
extra httpd.conf magic mime.types original
ServerName localhost:80
3)再重新启动apache 即可。
(7).关闭防火墙
centos从7开始默认用的是firewalld,这个是基于iptables的,虽然有iptables的核心,但是iptables的服务是没安装的。所以你只要停止firewalld服务即可:
sudo systemctl stop firewalld.service && sudo systemctl disable firewalld.service
用浏览器打开虚拟机Linux系统地址,如果显示It work!则成功
3、源码包的卸载
不需要卸载命令,直接删除目录即可。不会遗留任何垃圾文件。