Automatic LNMP start/stop control script

Source: Internet
Author: User

The LNMP automatic start/stop control script often needs to restart LNMP after changing the LNMP configuration. Here, an automatic script is written to restart LNMP. In addition to convenient restart, the function of disabling and enabling is also added. Operating System: Ubuntu Server code [plain] #! /Bin/bash function start () {sudo service nginx start sudo service php5-fpm start} function startall () {start sudo service mysql start} function stop () {sudo service nginx stop sudo service php5-fpm stop} function stopall () {stop sudo service mysql start} function restart () {sudo service nginx restart sudo service php5-fpm restart} function restartall () {restart sudo service mysql restart }## main () case "$1" in "start") start; "startall") startall; "stop") stop ;; "stopall") stopall; "restart") restart; "restartall") restartall; "configtest") configtest; *) echo "Usage: $0 {start | stop | restart | startall | stopall | restartall} "esac exit 0 for example: [plain] webserver restart // restart nginx and php-fpm

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.