yum install gcc-c++.x86_64
yum install gcc.x86_64
yum install apr-devel apr-util-devel pcre-devel -y
cd /usr/src ;
1.进入Apache官网下载 httpd-2.4.41.tar.bz压缩包到本地目录(需yum install lrzsz -y 上传下载软件)
http://httpd.apache.org/download.cgi
2.进入CentOS或CRT下载压缩包
rz 下载本地 httpd-2.4.41.tar.bz
3.解压 httpd-2.4.41.tar.bz
tar -xjvf httpd-2.4.41.tar.bz
4.进入解压目录
cd httpd-2.4.41/
5.预编译Apache,启用rewrite规则.动态加载库
./configure --prefix=/usr/local/apache/ --enable-rewrite --enable-so
6.编译
make
7.安装
make install
8.启动Apache服务,临时关闭SELinux.firewalld
/usr/local/apache2/bin/apachectl start
setenforce 0
systemctl stop firewall.service
9.用客户端浏览器访问http://虚拟机ip地址/检验是否成功
出现的错误:
make: *** No targets specified and no makefile found. Stop.
解决方法:
yum install gcc-c++.x86_64
yum install gcc.x86_64
出现的错误:
checking for APR… configure: error: the --with-apr parameter is incorrect. It must specify an install prefix, a build directory, or an apr-config file.
解决方法:
yum install apr-devel apr-util-devel
出现的错误:
checking for pcre-config… false
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
解决方法:
yum install pcre-devel -y