首页 > 代码库 > apache编译安装

apache编译安装

实验环境:

centos6.3

2.6.32-431.20.3.el6.i686


用到的包:

APR 1.5.1

APR-util 1.5.3

httpd-2.4.9


操作步骤:

第一步:根据依赖关系,先解压、编译安装apr1.5.1

    # tar xf apr-1.5.1.tar.bz2 -C /home

    # cd /home/apr-1.5.1

    # ./configure --prefix=/usr/local/apr 

    # make && make install


第二步:解压、编译安装apr-util-1.5.3

    # tar xf aprutil-1.5.3.tar.gz -C /home

    # cd /home/apr-util-1.5.3

    # ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr

    # make && make install


第三步:解压、编译安装httpd-2.4.9

    # tar xf httpd-2.4.9.tar.bz2 -C /home

    # cd /home/httpd-2.4.9

    # ./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd24 --enable-so --enable-cgi --enable-rewrite --with-zlib --with-pcre --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-modules=most --enable-mpms-shared=all --with-mpm=event --with-openssl=/usr/local/openssl

    # make && make install


第四步:httpd简单配置及启动

    cd /usr/local/apache/

    ln -sv /usr/local/apache/include /usr/include/httpd

    vim /etc/profile.d/httpd.sh    \\申明PATH执行路径

exprot PATH=/usr/local/apache/bin:$PATH

:wq

    /etc/profile.d/httpd.sh    \\执行脚本

    apachectl start

    cp /etc/rc.d/init.d/httpd /etc/rc.d/init.d/httpd24  \\修改启动服务文件

    vim /etc/rc.d/init.d/httpd24

          apachectl=/usr/local/apache/bin/apachectl

 httpd=${HTTPD-/usr/local/apache/bin/httpd}

 pidfile=${PIDFILE-/usr/local/apache/logs/httpd.pid}

 :wq

 

    service httpd stop

    service httpd24 start


第五步:apache详细配置请参考其他文档

本文出自 “滴不尽相思血泪抛红豆” 博客,请务必保留此出处http://beijgh.blog.51cto.com/8272564/1433395