centos7源码编译安装httpd、加入systemctl并设置开机自启动

  • 所需软件:
    apr-1.6.3.tar.gz
    (下载地址:http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-1.6.3.tar.gz)
    apr-util-1.6.1.tar.gz
    (下载地址:http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-util-1.6.1.tar.gz)
    httpd-2.4.29.tar.gz
    (下载地址:http://mirrors.shu.edu.cn/apache//httpd/httpd-2.4.29.tar.gz)
  • 安装编译环境:
    yum  -y  install  gcc  pcre  pcre-devel  libtool
  • 安装apr:
    tar  -xzf  apr-1.6.3.tar.gz
    cd  apr-1.6.3/
    ./configure  &&  make  &&  make  install
  • 安装apr-util:
    tar  -xzf  apr-util-1.6.1.tar.gz
    cd  apr-util-1.6.1/
    ./configure  --with-apr=/usr/local/apr/
    make  &&  make  install
  • 安装httpd:
    tar  httpd-2.4.29.tar.gz
    cd httpd-2.4.29/
    ./configure  &&  make  &&  make  install
  • 编写启动脚本:vim myhttpd
    #!/bin/bash
    # chkconfig: 12345 80 90
    function start_http()
    {
    /usr/local/apache2/bin/apachectl  start
    }
    function stop_http()
    {
     /usr/local/apache2/bin/apachectl  stop
    }
    case "$1" in
    start)
        start_http
    ;;
    stop)
        stop_http
    ;;
    restart)
        stop_http
        start_http
    ;;
    *)
        echo "Usage : start | stop | restart"
    ;;
    esac
  • 加入系统服务:
    chmod  a+x  myhttpd
    cp  -arf  myhttpd  /etc/init.d/
  • 启动自己编写的服务:
    systemctl  start  myhttpd
  • 设置开机自启动:
    chkconfig  --add  myhttpd
  • 原文地址:http://blog.51cto.com/12173069/2067565

    时间: 2024-08-27 07:31:44

    centos7源码编译安装httpd、加入systemctl并设置开机自启动的相关文章

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

    今天来总结一下在Linux中软件安装,通常我们应该知道,安装软件有两种方法:一种是软件包的安装,也就是rpm包的安装,就是指这些软件包都是 已经编译好的二进制rpm包,我们通过rpm安装工具和yum安装工具就可以直接安装了.另一种则是源代码安装,这种软件安装就是指它只有源代码,没有经 过编译的二进制,需要通过手动去编译安装的. rpm包是别人所编译好的软件包,比如说编译好的rpm包没有某个功能,也我们又想用,那我们就得自去手动下载源代码来自行安装了,自定义去安装程序包,这个是我们要撑握的. 下面

    centos7 源码编译安装TensorFlow CPU 版本

    一.前言 我们都知道,普通使用pip安装的TensorFlow是万金油版本,当你运行的时候,会提示你不是当前电脑中最优的版本,特别是CPU版本,没有使用指令集优化会让TensorFlow用起来更慢. 但是在编译之中,发现很多坑,由此记录一下. 环境相关: 系统:centos7 python版本:2.7.5 二.准备 1. 安装相关依赖 # 一般会缺失的依赖 yum -y install java-1.8.0-openjdk-devel automake autoconf libtool libi

    centos7 源码编译安装heartbeat 以及结合nginx测试高可用

    1.环境CentOS Linux release 7.4.1708 (Core) 3.10.0-693.el7.x86_64主(heartbeat27=uname -n)10.0.0.27(ip) 10.0.10.27(心跳) 10.0.0.29(vip)备(heartbeat28=uname -n)10.0.0.28(ip) 10.0.10.28(心跳) 10.0.0.29(vip)2.cat /etc/hosts10.0.0.27 heartbeat2710.0.0.28 heartbeat

    源码编译安装 httpd

    一 环境准备 获取 httpd 源码wget http://mirrors.shu.edu.cn/apache//httpd/httpd-2.4.37.tar.bz2 解压源码包tar xf httpd-2.4.37.tar.bz2 3.挂载本地光盘,并配置yum源mount /dev/cdrom /mediavim /etc/yum.reps.d/new.repo[base-001]name=CentOs everythingbaseurl=file:///media/enabled=1gpg

    源码编译安装httpd及其常见错误

    一.编译安装的整体步骤 1.在官网下载源码,并解压 2.切换到其目录中 3.执行./configure 4.编译 二.编译中及安装后配置常见的参数及其说明 编译中配置 1)指定安装路径 --prefix=/usr/local/Pacakage_name  指定安装路径 --sysconfigdir=/etc/Package_name  指定配置文件存放路径 2)指定启用/禁用的特性 --enbale-feature --disable-feature 3)指定所依赖的功能.程序或文件 --wit

    源码编译安装httpd服务

     1)下载httpd源码包到自己电脑指定的路径,解压该源码包,然后用lrzsz,上传到虚拟机进行解压安装,(这里直接谷歌lrzsz查询详细使用过程)我们要执行的源码安装的./configure脚本就在此目录中. 2. 解压   #tar xf package-vertion.tar{gz|bz|xz} 3.  在执行源码安装之前,还是看一下我们的开发环境有没有安装:"Development Tools"和"Server Platform Development",这

    centos软件源码编译安装httpd

    使用CentOS软件过程中,可能需要用编译使用.src的软件源码包,有些是因为需要某些功能,有些是需要某个版本,以下以httpd为例: 下载源码httpd并编译[[email protected] ~]# tar -xf httpd-2.4.6.tar.bz2[[email protected] ~]# cd httpd-2.4.6; ls #看到install文件[[email protected] httpd-2.4.6]# cat install #查看帮助,有些软件是README...$

    CentOS7源码编译安装FreeRadius3.17

    (一)环境简介1.OS:Centos7.42.软件:Freeradiusd3.17(ftp://ftp.freeradius.org/pub/freeradius/freeradius-server-3.0.17.tar.gz)3.网站:https://freeradius.org/ (二)安装1.yum安装所需的依赖包[[email protected] raddb]#yum install openssl openssl-devel libtalloc-devel libtalloc* -y

    CentOS7 源码编译安装Tengine

    简介 Tengine是由淘宝网发起的Web服务器项目.它在Nginx的基础上,针对大访问量网站的需求,添加了很多高级功能和特性.它的目的是打造一个高效.安全的Web平台. 发展 Tengine的性能和稳定性已经在大型的网站如淘宝网,天猫商城等得到了很好的检验. 从2011年12月开始,Tengine成为一个开源项目,Tengine团队在积极地开发和维护着它.Tengine团队的核心成员来自于淘宝.搜狗等互联网企业.Tengine是社区合作的成果,我们欢迎大家参与其中,贡献自己的力量. 一.安装编