http2.4 startup script

Source: Internet
Author: User

#!/bin/bash

# httpd Starts/stop the at daemon

#chkconfig: 345 61 29
#description: Runs Apache as httpd

#Source function Library
. /etc/init.d/functions

Exec=/usr/local/apache2/bin/httpd
Prog= "httpd"

Config=/usr/local/apache2/conf/httpd.conf

lockfile=/var/lock/subsys/$prog

Start ()
{
[-X $exec] | | Exit 5
[-f $config] | | Exit 6
[-F $lockfile] && echo "HTTP has running ..." && exit 7
Echo-n $ "Starting $prog .... "
Sleep 1
$exec-K Start
[$?-eq 0] && touch $lockfile && echo-e "\033[31m ok \033[0m" | | echo-e "\033[31m Failure \033[0m"

}


Stop ()
{
Echo-n "httpd is stoping ..."
Sleep 1
Killproc $prog >/dev/null && rm-f $lockfile && echo-e "\033[31m ok \033[0m" | | Echo-e "\033[31m faiure stop \033[0m"

}


Restart ()
{
Stop
Start

}

Status ()

{
[-F $lockfile] && echo "httpd is running ..." | | echo "httpd has stoping ..."
}


Case "$" in
Start
start;;
Stop
stop;;
Restart
restart;;
Status
status;;
*)
echo "Usage./httpd {Start|stop|restart|status}"
;;
Esac

http2.4 startup script

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.