about uscontact

apache 자동으로 시작시키는 방법

Category:
Author: zemna
Date: April 17, 2021
Share this:

RedHat/chkconfig-compliant start script:

#!/bin/sh

httpd This shell script takes care of starting and stopping

httpd.

chkconfig: 2345 65 35

description: httpd provides support for updating dynamic DNS services.

PATH=/usr/sbin:/root/bin:${PATH}
export PATH

HTTPD='/usr/local/apache2/bin/httpd'

case "$1" in
start)
echo -n "Starting httpd: "
$HTTPD -k $1
echo
;;
stop)
echo -n "Shutting down httpd: "
$HTTPD -k $1
echo
;;
restart)
echo -n "Restarting httpd: "
$HTTPD -k $1
echo
;;
*)
echo "Usage: httpd {start|stop|restart|status}"
exit 1
esac

exit 0

Save this file as "apache"

cp apache /etc/rc.d/init.d/

Add to chkconfig:

/sbin/chkconfig --add apache

Share this:

Leave a Reply

Your email address will not be published.

ZEMNA.NET

Professional software development agency estalished in Indonesia. We offers website setup, web application development, fulfillment service, and etc.
Follow us
Follow us to get latest news and tutorials.
2022 - Copyright, All Rights Reserved, Made by ZEMNA.NET with ❤️
magnifiercrossmenu