编译安装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. github 被强了!太丧心病狂了!

    github 不强了! github 不能访问了! github 打不开了! github 被封了... - ping 都 ping 不通, 本地 ping 不通, 服务器 ping 不通. - 本地 ...

  2. Linux命令-nohup和&

    基础 在linux终端或控制台上执行命令时,可能不希望脚本占住屏幕需要在后台执行脚本,有几种方法让脚本在后台执行: & 当在前台运行某个作业时,终端被该作业占据:可以在命令后面加上& ...

  3. bat文件重命名指定路径下文件

    ren "E:\产品\Planning\C1-Planning11\C1-Planning11\target\123" 456 此命令是将文件123重命名为456 注意:456是文 ...

  4. rem js相关

    !function(n){ var e=n.document, t=e.documentElement, i=720, d=i/100, o="orientationchange" ...

  5. bat/cmd批处理程序设计教程

    序言 这是一篇技术教程,我真心诚意会用很简单的文字表达清楚自己的意思,只要你识字就能看懂,就能学到知识.我写这篇教程的目的,是让每一个看过这些文字的朋友记住一句话:如果爱可以让事情变的更简单,那么就让 ...

  6. oracle python操作 增删改查

    oracle删除 删除表内容 truncate table new_userinfo; 删除表 drop table new_userinfo; 1.首先,python链接oracle数据库需要配置好 ...

  7. LinkedHashSet有没有重复的元素

      1.LinkedHashSet 的概述和使用 llinkedHashSet 的特点: 是唯一能保证怎么存就怎么输出的 set 集合,并且去重复 1 LinkedHashSet<String& ...

  8. python代码git上传

    python代码git上传 1.每次上传代码之前需要先拉取线上的代码 操作如下:

  9. RocketMQ 4.5.1 单机环境搭建以及生产消费测试

    为了学习和方便测试,总是要启动一个单机版的.下载 http://rocketmq.apache.org/dowloading/releases/ 1. 要先配置环境变量 ROCKETMQ_HOME E ...

  10. SpringBoot中使用Thymeleaf模板

    1.引入pom依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId& ...