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

     

  • 相关阅读:
    Oracle冷备份需要保存的文件
    oracle 重建 sys密码文件
    ORA-01991错误
    oracle ORA-01033问题怎么解决
    oracle创建表空间
    oracle 10G服务器端安装以及冷备份恢复
    完全卸载oracle11g步骤
    42. 函数指针用在菜单驱动系统中,练习函数指针数组的使用。
    41. 定义与调用一个函数指针时的几种方式
    40. 使用数组时的四个要点
  • 原文地址:https://www.cnblogs.com/john5yang/p/10754088.html
Copyright © 2011-2022 走看看