一、安装前的说明:

  httpd依赖于apr和apr-util所以在安装httpd之前要把这些东西都安装上去。

  事先安装的依赖:

yum -y install gcc gcc-c++ pcre-devel openssl-devel

二、上传httpd-2.4.20.tar.gz,apr-1.5.2.tar.gz,apr-util-1.5.4.tar.gz 包到服务器

三、解压httpd-2.4.20.tar.gz,apr-1.5.2.tar.gz,apr-util-1.5.4.tar.gz

tar -xzvf httpd-2.4..tar.gz -C/usr/src
tar -xzvf apr-1.5..tar.gz -C/usr/src
tar -xzvf apr-util-1.5..tar.gz -C/usr/src

四、安装apr到/usr/local/apr

/usr/src/apr-1.5./configure --prefix=/usr/local/apr && make && make install

五、安装apr-util到/usr/local/apr-util

/usr/src/apr-util-1.5./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr && make && make install

六、安装httpd到/usr/local/httpd/

/usr/src/httpd-2.4./configure --prefix=/usr/local/httpd/ --enable-so --enable-rewrite --enable-ssl --enable-cgi --enable-cgid \
--enable-modules=most --enable-mods-shared=most --enable-mpms-shared=all --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util && make && make install

七、编写linux 启动脚本

touch /etc/init.d/httpd

/etc/init.d/httpd 的内容如下:

#!/bin/bash

# chkconfig:
# description: httpd server script
HTTPD=/usr/local/httpd/bin/httpd
PID_FILE=/usr/local/httpd/logs/httpd.pid case $ in
"start")
if test -e $PID_FILE
then
echo 'httpd is started ...'
else
echo 'httpd will start ...'
$HTTPD
fi
;; "stop")
if test -e $PID_FILE
then
PID=`cat $PID_FILE`
kill $PID
else
echo 'httpd is stoped'
fi
;;
"status")
if test -e $PID_FILE
then
echo 'httpd has been started '
else
echo 'httpd is stoped'
fi
;;
*)
echo "not support option $1"
;;
esac

9、启动httpd

service httpd start

编译安装httpd的更多相关文章

  1. 编译安装HTTPD 2.4.9版本

    编译安装HTTPD 2.4.9版本    服务脚本:/etc/rc.d/init.d/httpd    脚本配置文件路径:/etc/sysconfig/httpd    运行目录:/etc/httpd ...

  2. CentOS 6.4源码编译安装httpd并启动测试

    今天来总结一下在Linux中软件安装,通常我们应该知道,安装软件有两种方法:一种是软件包的安装,也就是rpm包的安装,就是指这些软件包都是 已经编译好的二进制rpm包,我们通过rpm安装工具和yum安 ...

  3. apache编译安装 httpd 2.2 httpd 2.4

    #apache编译安装#httpd 2.2 , httpd 2.4 #!/bin/sh #apache编译安装 #httpd 2.2 , httpd 2.4 #centos #rpm -e httpd ...

  4. Linux源码编译安装httpd

    Linux安装软件采用源码编译安装灵活自由,适用于不同平台,维护也十分方便. 源码编译的安装方式一般由3个步骤组成: 1.配置(configure) 2.编译(make) 3.安装(make inst ...

  5. (转)CentOS 7.6 上编译安装httpd 2.4.38

    原文:https://www.s4lm0x.com/archives/40.html https://www.cnblogs.com/sunshine-H/p/8110608.html----超详细 ...

  6. 编译安装httpd 2.4

    author:JevonWei 版权声明:原创作品 官方网站下载httpd2.4.apr及apr-util的相关软件包,并传输到centos 7系统中的/usr/local/src(apr1.6版本过 ...

  7. LAMP环境之编译安装httpd服务

    “Apache HTTP Server”是开源软件项目的杰出代表,它基于标准的 HTTP 网络协议提供网页浏览服务. 在配置 Apache 网站服务之前,需要正确安装好 httpd 服务器软件.htt ...

  8. 二进制编译安装httpd服务

    systemctl stop httpd yum remove httpd-----------------------(在做之前 先删掉httpd) 安装编译环境 yum -y groupinsta ...

  9. 把编译安装的httpd 实现服务脚本,通过service和chkconfig 进行管理

    把编译安装的httpd 实现服务脚本,通过service和chkconfig 进行管理 1 编译安装httpd 把httpd编译安装在/app/httpd/目录下. 2 在/etc/rc.d/init ...

随机推荐

  1. nodejs+express Mvc站点

    nodejs+express Mvc站点 像asp.net Mvc一样开发nodejs+express Mvc站点 首先,我是个c#码农.从事Mvc开发已然4个年头了,这两年前端MVC的兴起,我也跟风 ...

  2. Shell脚本调试技术

    http://www.ibm.com/developerworks/cn/linux/l-cn-shell-debug/ 一. 前言 shell编程在unix/linux世界中使用得非常广泛,熟练掌握 ...

  3. (转)centos6起/etc/syslog.conf不再有!而是/etc/rsyslog.conf代替!

    centos6起/etc/syslog.conf不再有!而是/etc/rsyslog.conf代替!

  4. 逻辑数据库设计 - 需要ID(谈主键Id)

    本文的目标就是要确认那些使用了主键,却混淆了主键的本质而造成的一种反模式. 一.确立主键规范 每个了解数据库设计的人都知道,主键对于一张表来说是一个很重要,甚至必需的部分.这确实是事实,主键是好的数据 ...

  5. Qt编程之d指针与q指针

    我们在Qt中可以看到两个宏Q_D和Q_Q这两个红分别是取得d指针和q指针的,d指针指向封装的私有类,q指针指向公共的类.(我的理解类似于回调,回指的意思). 为什么Qt要这样实现呢?下面几个链接中的文 ...

  6. 转:sql语句中GROUP BY 和 HAVING和使用 count()

    在开发时,我们经常会遇到以“累计(count)”或是“累加(sum)”为条件的查询.比如user_num表: id user num 1 a 3 2 a 4 3 b 5 4 b 7   例1:查询出现 ...

  7. bzoj1615 [Usaco2008 Mar]The Loathesome Hay Baler麻烦的干草打包机

    Description Farmer John新买的干草打包机的内部结构大概算世界上最混乱的了,它不象普通的机器一样有明确的内部传动装置,而是,N (2 <= N <= 1050)个齿轮互 ...

  8. UVa 1449 - Dominating Patterns (AC自动机)

    题目大意:给出多个字符串模板,并给出一个文本串,求在文本串中出现最多的模板,输出最多的次数并输出该模板(若有多个满足,则按输入顺序输出). 思路:赤裸裸的 AC自动机,上模板. 代码: #includ ...

  9. Hdu3487-Play with Chain(伸展树分裂合并)

    Problem Description YaoYao is fond of playing his chains. He has a chain containing n diamonds on it ...

  10. apacheOfbiz

    一.ofbiz 用自身数据库安装 1. 由 binary 安装: 由 binary 安装非常简单, 以下是安装方法: 下载ofbiz-2.0-beta1-complete.tar.gz, 注意不是of ...