第一步:源码安装依赖软件apr和apr-util
tar xf apr-.....tar.bz2
cd apr-...
./configure && make && make install
tar xf apr-uitl.....
cd apr-util..
./configure --with-apr=/usr/local/apr/bin/apr-1-config //指定软件的安装路径
make && make install
第二步:编译安装Apache
tar -xf httpd-....tar.bz2
cd httpd...
vim apache.sh //编写apache.sh脚本就行软件安装
./configure \
--enable-modules=all \
--enable-mods-shared=all \
--enable-so \
--enable-rewrite \
--with-pcre \
--enable-ssl \
--with-mpm=prefork \
--with-apr=/usr/local/apr/bin/apr-1-config \
--with-apr-util=/usr/local/apr/bin/apu-1-config
给x权限,然后./apache.sh make && make install
假如之前安装过httpd,yum install httpd -y,必须先移除才能正常使用
systemctl stop httpd
yum remove httpd -y
cd /usr/local/apache2
bin/apachectl //启动apache