编译安装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. python初级(302) 6 对象(二)

    一.复习 1.什么是对象 2.什么是类 3.什么是属性 4.什么是方法 5.创建一个dog类,dog的属性有颜色,方法有汪汪叫 随堂练习: class Dog: def __init__(self, ...

  2. java基础:

    java基础: 内容. 待续........

  3. SpringBoot小技巧:统一异常处理

    SpringBoot小技巧:统一异常处理 情景描述 对于接口的定义,我们通常会有一个固定的格式,比如: 但是调用方在请求我们的API时把接口地址写错了,就会得到一个404错误,且不同于我们定义的数据格 ...

  4. 修复Nginx报错:upstream sent too big header while reading response header from upstream

    在 nginx.conf 的http段,加入下面的配置: proxy_buffer_size 128k; proxy_buffers 32k; proxy_busy_buffers_size 128k ...

  5. 【bat】九九表

    @echo off & setlocal EnableDelayedExpansion title 九九表 for /l %%a in (1,1,9) do ( set temp= for / ...

  6. 19 SpringMVC 拦截器

    1. 拦截器的概述(1)SpringMVC框架中的拦截器用于对处理器进行预处理和后处理的技术.(2)可以定义拦截器链,连接器链就是将拦截器按着一定的顺序结成一条链,在访问被拦截的方法时,拦截器链 中的 ...

  7. [转帖]Java升级那么快,多个版本如何灵活切换和管理?

    Java升级那么快,多个版本如何灵活切换和管理? https://segmentfault.com/a/1190000021037771 前言 近两年,Java 版本升级频繁,感觉刚刚掌握 Java8 ...

  8. 图论 --- 三维空间bfs

    <传送门> [题目大意] 给你一个三维的迷宫,让你计算从入口走到出口最少步数. [题目分析] 其实和二维迷宫还是一样的,还是用队列来做,由于BFS算法一般是不需要回溯的,所以我们就用不着还 ...

  9. DS AVL树详解

    先说说二叉搜索树: 是有序的二叉树,根值>左节点值,右节点值>根值. 如果要查找某个值,二叉搜索树和二分查找一样,每进行一次值比较,就会减少一半的遍历区间. 但是,如果树插入的值一直递增/ ...

  10. emmet css 缩写

    css 缩写 对于CSS语法,Emmet有许多用于属性的预定义代码段.例如,您可以扩展 m 缩写以获取margin: ;代码段. 要获取 margin: 10px;您可以简单地扩展m10缩写. 需要多 ...