zoukankan      html  css  js  c++  java
  • 编译安装httpd

    一、安装前的说明:

      httpd依赖于apr和apr-util所以在安装httpd之前要把这些东西都安装上去。

      事先安装的依赖:

    yum -y install gcc gcc-c++ pcre-devel openssl-devel

    二、上传httpd-2.4.20.tar.gz,apr-1.5.2.tar.gz,apr-util-1.5.4.tar.gz 包到服务器

    三、解压httpd-2.4.20.tar.gz,apr-1.5.2.tar.gz,apr-util-1.5.4.tar.gz 

    tar -xzvf httpd-2.4.20.tar.gz -C/usr/src
    tar -xzvf apr-1.5.2.tar.gz -C/usr/src
    tar -xzvf apr-util-1.5.4.tar.gz -C/usr/src

    四、安装apr到/usr/local/apr

    /usr/src/apr-1.5.2/configure --prefix=/usr/local/apr && make && make install

    五、安装apr-util到/usr/local/apr-util

    /usr/src/apr-util-1.5.4/configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr && make && make install

    六、安装httpd到/usr/local/httpd/

    /usr/src/httpd-2.4.20/configure --prefix=/usr/local/httpd/ --enable-so --enable-rewrite --enable-ssl --enable-cgi --enable-cgid 
    --enable-modules=most --enable-mods-shared=most --enable-mpms-shared=all --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util && make && make install

    七、编写linux 启动脚本

    touch /etc/init.d/httpd

    /etc/init.d/httpd 的内容如下:

    #!/bin/bash
    
    # chkconfig: 2345 64 36
    # description: httpd server script
    HTTPD=/usr/local/httpd/bin/httpd
    PID_FILE=/usr/local/httpd/logs/httpd.pid
    
    case $1 in
    "start")
        if test -e $PID_FILE
        then
            echo 'httpd is started ...'
        else
            echo 'httpd will start ...'
            $HTTPD
        fi
    ;;
    
    "stop")
        if test -e $PID_FILE
        then
            PID=`cat $PID_FILE`
            kill $PID
        else
            echo 'httpd is stoped'
        fi
    ;;
    "status")
        if test -e $PID_FILE
        then
            echo 'httpd has been started '
        else
            echo 'httpd is stoped'
        fi
    ;;
    *)
        echo "not support option $1"
    ;;
    esac

    9、启动httpd

    service httpd start

  • 相关阅读:
    【转】CUDA5/CentOS6.4
    【转】centos 6.4 samba 安装配置
    【转】Install MATLAB 2013a on CentOS 6.4 x64 with mode silent
    【转】Getting xrdp to work on CentOS 6.4
    【VLFeat】使用matlab版本计算HOG
    Unofficial Windows Binaries for Python Extension Packages
    March 06th, 2018 Week 10th Tuesday
    March 05th, 2018 Week 10th Monday
    March 04th, 2018 Week 10th Sunday
    March 03rd, 2018 Week 9th Saturday
  • 原文地址:https://www.cnblogs.com/JiangLe/p/5596099.html
Copyright © 2011-2022 走看看