您的位置:首页 > 运维架构 > Apache

centos5.5 安装apache2.4.2

2012-09-15 16:23 176 查看
Apache
2.4.2 安装:

1.下载文件到download文件

cd /download

wgethttp://mirrors.axint.net/apache/httpd/httpd-2.4.2.tar.gz

wgethttp://mirrors.axint.net/apache/apr/apr-1.4.6.tar.gz

wgethttp://mirrors.axint.net/apache/apr/apr-util-1.4.1.tar.gz

wgetftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz

2.解压文件

tar zxvf httpd-2.4.2.tar.gz

tar zxvf apr-1.4.6.tar.gz

tar zxvf apr-util-1.4.1.tar.gz

tar zxvf pcre-8.30.tar.gz

3、移动apr到srclib

mv apr-1.4.6 httpd-2.4.2/srclib/apr

mv apr-util-1.4.1 httpd-2.4.2/srclib/apr-util

4.安装pcre-8.30(--prefix 指的是安装文件目录)

cd /tmp/pcre-8.30

./configure

make

make install

5、安装apache-2.4(安装目录为/usr/local/apache)

cd /tmp/httpd-2.4.2

./configure --prefix=/usr/local/apache --enable-so --enable-deflate=shared --enable-ssl=shared --enable-expires=shared --enable-headers=shared --enable-rewrite=shared
--enable-static-support --with-included-apr --with-mpm=prefork

make && make install
cp -f build/rpm/httpd.init /etc/init.d/httpd
chmod +x /etc/init.d/httpd
chkconfig --add httpd
chkconfig httpd on
cd /etc
mv httpd httpd_old
ln -s /usr/local/apache/ httpd
cd /usr/sbin/
ln -fs /usr/local/apache/bin/httpd
ln -fs /usr/local/apache/bin/apachectl
cd /var/log
rm -rf httpd/
ln -s /usr/local/apache/logs httpd
# service httpd restart
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: