编译安装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. Appium脚本(4) 使用uiautomator方法定位元素

    from app.find_element.capability import driver from time import sleep # 使用uiautomator方法定位元素 accunt_i ...

  2. EF的 NoTracking 的一些记录

    NoTracking官方解释 跟踪与非跟踪查询 跟踪行为可控制 Entity Framework Core 是否将有关实体实例的信息保留在其更改跟踪器中. 如果已跟踪某个实体,则该实体中检测到的任何更 ...

  3. Docker 容器内无法通过 HTTP 访问外网

    现象 内/外网 IP 和 域名 可以 ping 通 容器内无法访问宿主机所在内网及外网的 Web 服务(404) 通过 curl 查看返回头信息感觉是所有 Web 请求被中转到一个固定的 Nginx ...

  4. 解决netty客户端接收报文不完整的情况

    逻辑就是在处理handler前加入一个处理符,然后 channelReadComplete这个事件进行处理.同时注意客服端的配置: public void connect(String addr, i ...

  5. 如何申请高德地图用户Key

    打开网页https://lbs.amap.com/,进入高德开发平台. 单击箭头处[注册],打开注册页面.(如果您已注册为高德地图开发者可跳过此步骤,直接登录即可). 选择[成为个人开发者],如果您是 ...

  6. Python之路【第二十九篇】:django ORM模型层

    ORM简介 MVC或者MVC框架中包括一个重要的部分,就是ORM,它实现了数据模型与数据库的解耦,即数据模型的设计不需要依赖于特定的数据库,通过简单的配置就可以轻松更换数据库,这极大的减轻了开发人员的 ...

  7. Linux下C++酒店管理系统

    功能要求: ​ 相关源码:码云:传送门,GitHub:传送门 相关图片: 拆分版 make编译 ​ ./hotel运行 ​ 输入2,进入开房模块 ​ 相关源码: class.cpp #include ...

  8. springboot2.x 使用redis (入门)

    在使用之前先简单介绍一下,redis和mongoDB这两个nosql的区别以及使用场景. 1. redis redis是一个分布式缓存.高性能的key-value数据库.支持存储的value类型包括s ...

  9. Hive学习笔记(二)—— 安装配置

    Hive安装配置及基本操作 1. Hive安装及配置 (1). 上传文件到Hadoop102节点,解压到/opt/moudle (2). 修改/opt/module/hive/conf目录下的hive ...

  10. sudo apt-get install libstdc++6

    sudo apt-get install libstdc++6 yum install  libncurses.so.5 sudo apt-get install libncurses.so.5 su ...