• centos7和centos6安装httpd


     

    编译安装httpd

    http://apr.apache.org/download.cgi

    下载 apr-util-1.6.1.tar.bz2 apr-1.6.5.tar.bz2 
    http://httpd.apache.org/download.cgi#apache24
    下载Source: httpd-2.4.39.tar.bz2
    • 按装依赖

     

    yum install pcre-devel openssl-devel expat-devel
    • 安装apr
    [172.168.2.8-root@lvsapr-1.6.5]#cd apr-1.6.5/
    
    ./configure --prefix=/usr/local/apr
    
     make && make install
    • 安装arp-util
    cd apr-util-1.6.1
    
    ./configure --prefix=/usr/local/apr-util 
    
    --with-apr=/usr/local/apr
    
    make && make install
    • 安装httpd
    cd httpd-2.4.39
    
    ./configure --prefix=/usr/local/httpd2.4.39 
    
    --sysconfdir=/etc/httpd2.4.39 
    
    --enable-so 
    
    --enable-ssl 
    
    --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-mpms=prefork
    
    make && make  install
    • 设置环境变量
    cat >> /etc/profile.d/httpd.ssh << 'EOF'
    
    export PATH=/usr/local/httpd2.4.39/bin:$PATH
    
    EOF
    •  连接
    ln -s /usr/local/httpd2.4.39/ /usr/local/httpd
    1. centos6.9安装apache2.4.39
    • 把 apr 和apr-util 移动到http2.4.39源码包srclib/下重命名
    [root@node2 /usr/local/src]# mv apr-1.6.5 httpd-2.4.39/srclib/apr
    
    [root@node2 /usr/local/src]# mv apr-util-1.6.1 httpd-2.4.39/srclib/apr-util
    yum install pcre-devel openssl-devel expat-devel
    ./configure --prefix=/usr/local/httpd2.4.39 
    
    --enable-so 
    
    --enable-ssl 
    
    --enable-cgi 
    
    --with-include-apr 
    
    --enable-rewrite 
    
    --with-zlib 
    
    --with-pcre 
    
    --enable-modules=most 
    
    --enable-mpms-shared=all 
    
    --with-mpms=prefork
    cat >> /etc/profile.d/httpd.ssh << 'EOF'
    
    export PATH=/usr/local/httpd2.4.39/bin:$PATH
    
    EOF
     
    ln -s /usr/local/httpd2.4.39/ /usr/local/httpd
    • 修改启动脚本
    [root@node2 ~]# cp /etc/init.d/http /etc/init.d/http2.4.39
    
    apachectl=/usr/local/httpd2.4.39/bin/apachectl
    
    httpd=${HTTPD-/usr/local/httpd2.4.39/bin/httpd}
    
    prog=httpd
    
    pidfile=${PIDFILE-/usr/local/httpd2.4.39/logs/httpd.pid}
    
    lockfile=${LOCKFILE-/var/lock/subsys/httpd2.4.39}
    • 加入服务管理
    [root@node2 /etc/init.d]# chkconfig --add httpd2.4.39
    
    [root@node2 /etc/init.d]# chkconfig --list | grep httpd2.4.39
    
    httpd2.4.39    0:off 1:off 2:off 3:off 4:off 5:off 6:off
    • 启动
    [root@node2 /etc/init.d]# /etc/init.d/httpd2.4.39 start
    • 检验环境变量
    [root@node2 /etc/init.d]# which httpd
    
    /usr/local/httpd2.4.39/bin/httpd
    
    [root@node2 /etc/init.d]# which  -a httpd
    
    /usr/local/httpd2.4.39/bin/httpd
    
    /usr/sbin/httpd

     

  • 相关阅读:
    Bean复制
    java中的ConcurrentModificationException异常
    线程安全问题
    多线程等待唤醒机制之生产消费者模式
    JavaScript数据结构——队列的实现
    JavaScript数据结构——链表的实现
    JavaScript数据结构——栈的实现
    java中map集合的迭代
    SQLServer查询最近一天,三天,一周,一月,一季度方法
    细数网络上十七种安全威胁
  • 原文地址:https://www.cnblogs.com/john5yang/p/10754088.html
Copyright © 2020-2023  润新知