编译安装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. 做JAVA的需要了解的框架

    spring netty Elasticsearch Eureka Hystrix 接口的依赖性管理 Zuul Config Bus ActiveMQ redis zookper quartz had ...

  2. nginx入门系列之应用场景介绍

    目录 HTTP服务器 反向代理服务器 作为一个虚拟主机下多个应用的反向代理 作为多个虚拟主机的反向代理 负载均衡器 简单轮训策略 最小连接数策略 客户端IP哈希策略 服务器权重策略 邮件代理服务器 官 ...

  3. ifcopenshell在VS2015下的编译

    源起 今天使用 IfcOpenShell的IfcConvert ,因为是开源的所以就想自己编译下,编译过程中遇到不少问题,因此记录下来 什么是IfcOpenShell? IfcOpenShell是一个 ...

  4. war包部署在tomcat下,使用windows service服务方式启动tomcat服务器,在包含调用dll的模块,报dll找不到问题的解决办法

    问题描述: 开发了一个需要调用dll的java web程序,在idea开发环境下运行调试没问题,可以正常运行,在tomcat/bin下,运行批处理startup.bat,启动tomcat服务器,也可以 ...

  5. Android EditText禁止回车换行

    在做一个登录页面的时候,发现了输入手机号的EditText可以输入回车的bug,影响用户体验,在此分享下解决办法. 百度了很多,都是设置singline=true的或者设置maxLines=" ...

  6. 搭建mqtt服务器apollo

    使用的apollo,官网太慢,附上百度云下载地址: 链接:https://pan.baidu.com/s/1NIq6R71hlyPuaUBwPoMPNg 提取码:36vw 原文链接:https://b ...

  7. charles 4.2.1 Ubuntu破解版安装

    charles 4.2.1 Ubuntu破解版安装 下载 charles-proxy-4.2.1_amd64.tar.gz 破解版 charles.jar 破解包 解压 sudo tar -zxvf ...

  8. ubuntu查看软件安装位置

    ubuntu中的软件可通过图形界面的软件中心安装,也可以通过命令行apt-get install安装.但是安装后的软件在哪个位置呢?这点跟windows环境下安装软件的路径选择不一样.ubuntu中可 ...

  9. C语言函数返回指针方法

    1.将函数内部定义的变量用static修饰 由于static修饰的变量,分配在静态内存区(类似于全局变量区),函数返回时,并不会释放内存,因此可以将要返回的变量加static修饰. int *test ...

  10. EasyExcel读取文件-同步处理数据

    读取代码 // 前端传过来的文件 MultipartFile file; InputStream inputStream = file.getInputStream(); // 读取excel数据,边 ...