1、安装准备
ps aux|grep httpd //查看apache是否启动且有进程
yum install pcre-devel -y //安装依赖
yum -y groupinstall
2、安装最小化源码安装的依赖
#安装apr和apr-util
cd /usr/local/src/
wget http://mirrors.koehn.com/apache//apr/apr-1.5.2.tar.gz
wget http://mirrors.koehn.com/apache//apr/apr-util-1.5.4.tar.gz
tar zvxf apr-1.5.2.tar.gz
tar zxvf apr-util-1.5.4.tar.gz
cd apr-1.5.2
./configure –prefix=/usr/local/apr
yum install gcc gcc-devel //编译发现缺少gcc依赖,安装gcc
./configure –prefix=/usr/local/apr
make && make install
cd ..
cd apr-util-1.5.4
./configure –prefix=/usr/local/apr-util –with-apr=/usr/local/apr
make && make install
#下载apr-iconv
wget http://mirrors.koehn.com/apache//apr/apr-iconv-1.2.1.tar.gz
3、#安装apache2.4.9
wget http://archive.apache.org/dist/httpd/httpd-2.4.9.tar.gz
tar zxvf httpd-2.4.9.tar.gz
cd httpd-2.4.9
./configure –help|less //查看最小化源码安装的需要
./configure –prefix=/usr/local/apache –sysconfdir=/etc/httpd24 –enable-so –enable-ssl enable-cgi –enable-rewrite –with-zlib –with-pcre –with-apr=/usr/local/apr-util/ –enable-modules=most –enable-mpms-shared-all –with-mpm-event
make
make install
echo $?
4、#软连接和启动准备
ln -sv /usr/local/apache/include /usr/include/httpd
ldconfig
ldconfig -p
5、#编写启动apache脚本
vim /etc/profile.d/httpd.sh //export PATH=/usr/local/apache/bin:$PATH
. /etc/profile.d/httpd.sh
httpd -v
rpm -ql httpd
5、启动apache测试
apachectl start
ps aux |grep httpd
apache2.4在centos6.5上
最新推荐文章于 2021-02-20 17:25:32 发布