• shell脚本1例 自动安装httpd


    #!/bin/bash

    read -n 1 -p "是否已将httpd-2.2.17源码包放到root目录下,确认按Y" p # -n 1指定只能读入一个字符

    test "$p" = "y" -o "$p" = "Y"

    if [ $? -eq 0 ]

    then

        rpm -qa | grep httpd

        rpm -e httpd --nodeps

        cd /root

        tar zxf httpd-2.2.17.tar.gz -C /usr/src/

        cd /usr/src/httpd-2.2.17/

        ./configure --prefix=/usr/local/httpd --enable-so --enable-rewrite --enable-charset-lite --enable-cgi

        make && make install

        ln -s /usr/local/httpd/bin/* /usr/local/bin

     

        cp /usr/local/httpd/bin/apachectl /etc/init.d/httpd

        sed -i '1a #chkconfig: 35 85 21 ' /etc/init.d/httpd

        sed -i '2a#descriotion:This is httpd ' /etc/init.d/httpd

        sed -i '97cServerName www.benet.com ' /usr/local/httpd/conf/httpd.conf

        chkconfig --add httpd

        chkconfig --list httpd

        service httpd start

        netstat -anpt |grep httpd

     

        echo " httpd 安装完成 "

     

     

    else

        exit 1

    fi

  • 相关阅读:
    - 错误笔记
    只是一个没有人知道的蒟蒻
    省选前模板复习
    数学知识小结#1
    写在NOIP2018后
    Atcoder&CodeForces杂题11.7
    Atcoder&CodeForces杂题11.6
    [NOIP11.1模拟赛]补番报告
    [JZOJ5281]钦点题解--瞎搞+链表
    [JZOJ5280]膜法师题解--思维+前缀和
  • 原文地址:https://www.cnblogs.com/gdlinux/p/7059614.html
Copyright © 2020-2023  润新知