zoukankan      html  css  js  c++  java
  • 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

     

  • 相关阅读:
    (转)Hadoop MapReduce链式实践--ChainReducer
    (转)Permission denied: win7下面eclipse上传本地文件到DFS && 运行M/R程序时出现的同样的错误解决方法
    为什么需要注册OCX控件?
    WPF插件开发:使用FrameworkElementAdapters时VS报错的问题
    C# semphore的使用
    C# int可以表示的最大值
    WCF客户端从服务器下载数据
    C# 读取WAV文件(详细)
    C#读取wav文件
    VEMap.DeleteAllShapeLayers 方法
  • 原文地址:https://www.cnblogs.com/john5yang/p/10754088.html
Copyright © 2011-2022 走看看