编译安装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.]#cd apr-1.6./

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

 make && make install
  • 安装arp-util
cd apr-util-1.6.

./configure --prefix=/usr/local/apr-util \

--with-apr=/usr/local/apr

make && make install
  • 安装httpd
cd httpd-2.4.

./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. httpd-2.4./srclib/apr

[root@node2 /usr/local/src]# mv apr-util-1.6. httpd-2.4./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    :off :off :off :off :off :off :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

centos7和centos6安装httpd的更多相关文章

  1. Centos7.4 离线安装httpd(解决rpm依赖)

    1.直接下载httpd的rpm安装包,安装失败需要先解决依赖. [root@node06 ~]# rpm -ivh httpd--.el7.centos.x86_64.rpm warning: htt ...

  2. Centos7.4下安装Jumpserver 1.0.0(支持windows组件)

    0)系统环境CentOS 7.4 IP: 192.168.100.10 [root@jumpserver-server ~]# cat /etc/redhat-release CentOS Linux ...

  3. Centos7.3下安装Jumpserver 1.0.0(支持windows组件)

    Jumpserver最新版本支持windows组件,废话不多介绍了,下面直接介绍下部署过程: 0)系统环境 CentOS 7.3 IP: 192.168.10.210 [root@jumpserver ...

  4. CentOS 7 安装Httpd(转)

    实验环境:CentOS7 实验步骤: 安装httpd服务:yum -y install httpd 关闭SELinux:setenforce 0 禁用防火墙策略:iptables -F 启动httpd ...

  5. centos7和centos6通过yum安装JDK1.8

    centos7和centos6通过yum安装JDK1.8 查看JDK的安装路径# java -version============================查看Linux系统版本信息# cat ...

  6. CentOS7.3环境下源码安装httpd

    CentOS7.3环境下源码安装httpd 本文在CentOS7.3下,源码安装apache服务httpd2.4. 1.下载好源码安装包 [root@localhost ~]#ll total 625 ...

  7. Centos7 apache2.4.29(httpd) 安装

    重点参考文章:https://blog.csdn.net/MrDing991124/article/details/78829184  写的很详细了,自己按着改博文走了不遍,不错! 一.配置安装环境 ...

  8. CentOS6.9安装httpd并正确配置静态IP地址

    题目要求 在vmware中安装一台虚拟机,操作系统为centos6.9 ip地址为 192.168.56.11 要求: 1.xshell能够连接上此虚拟机 2.此虚拟机必须可以上网 3.使用yum安装 ...

  9. CentOS-7.0.中安装与配置Tomcat-7的方法

    安装说明 安装环境:CentOS-7.0.1406安装方式:源码安装 软件:apache-tomcat-7.0.29.tar.gz 下载地址:http://tomcat.apache.org/down ...

随机推荐

  1. microsoft vs code 绿化

    下载地址: https://code.visualstudio.com/#alt-downloads 各个版本比较 User Installer System Installer .zip resou ...

  2. iOS - 获取当前时间日期星期几

    //获取当前时间日期星期 - (NSString *)getCurrentTimeAndWeekDay { NSArray * arrWeek=[NSArray arrayWithObjects:@& ...

  3. Java之字符和字符串

    字符类型 字符类型char是基本数据类型,它是character的缩写.一个char保存一个Unicode字符: char c1='A'; char c2='中'; 因为Java在内存中总是使用Uni ...

  4. AspNetCore 限流中间件IpRateLimitMiddleware 介绍

    IpRateLimitMiddleware(Github: AspNetCoreRateLimit) 是ASPNETCore的一个限流的中间件,用于控制客户端调用API的频次, 如果客户端频繁访问服务 ...

  5. Qt5.QtCreator_屏蔽警告

    ZC:注意: 修改了这个配置的话,如果有多个Qt进程的话,它不会自动同步各个进程中的值,可能是 以最后保存的为准(需要注意 ! !) 1.QtCreator屏蔽指定警告 - weixin_409542 ...

  6. 启动Tomcat时报异常org.apache.catalina.core.ContainerBase.startInternal A child container failed during start

    之前Tomcat一直运行正常,重启之后一直报以下错误信息: 13-Jun-2019 19:46:13.000 SEVERE [Catalina-startStop-1] org.apache.cata ...

  7. SimpleDataFormat 线程不安全解决

    SimpleDataFormat 是我们常用的时间转换工具,我再spark中使用sdf对时间戳进行转换,发现转化出的时间有异常,原来sdf是线程不安全的, 改用joda time,错误消失,样例如下 ...

  8. Website Scraping with Python 阅读笔记

    第一章 工程涉及的基本工具:requests, beautiful soup, scrapy. 法规与技术约定:read the Terms & Conditions and the Priv ...

  9. JVM知识点总览-高级Java工程师面试必备

    jvm 总体梳理 jvm体系总体分四大块: 类的加载机制 jvm内存结构 GC算法 垃圾回收 GC分析 命令调优 当然这些知识点在之前的文章中都有详细的介绍,这里只做主干的梳理 这里画了一个思维导图, ...

  10. 【剑指offer】删除链表中重复的结点

    题目描述 在一个排序的链表中,存在重复的结点,请删除该链表中重复的结点,重复的结点不保留,返回链表头指针.例如,链表1->2->3->3->4->4->5 处理后为 ...