NGINX, PHP-FPM boot automatically

Source: Internet
Author: User

  Nginx shell script put under/etc/init.d/name Nginx? 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 6667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611 7118119120121#!/BIN/SH # Nginx-this script starts and stops the Nginx daemon # chkconfig:-$ description:ngi  NX is an HTTP (s) server, HTTP (s) reverse # Proxy and IMAP/POP3 Proxy server # Processname:nginx # chkconfig:2345 90 91 # Description:nginx Web server# processname:nginx# config:/opt/nginx/conf/nginx.conf# pidfile:/opt/nginx/nginx.pid # so Urce function Library. /etc/init.d/functions # Source Networking configuration: /etc/sysconfig/network if [-f/etc/sysconfig/nginx];then. /ETC/SYSCONFIG/NGINXFI # Check that networking are up. ["$NETWORKING" = "no"] && exit 0 nginx= "/usr/local/nginx/sbin/nginx" prog=$ (basename $nginx) nginx_conf_file= "/ Usr/local/nginx/conf/nginx.conf "[-f/etc/sysconfig/nginx] &&. /etc/sysconfig/nginx Lockfile=/var/lock/subsys/nginx Start () {[-X $nginx] | | Exit 5 [-F $NGINX _conf_file] | | Exit 6 E Cho-n $ "Starting $prog:" Daemon $nginx #-c $NGINX _conf_file retval=$? echo [$retval-eq 0] && touch $lockfile return $retval} stop () {echo-n $ "stopping $prog:" Killproc $prog-qu IT retval=$? echo [$retval-eq 0] && rm-f $lockfile return $retval killall-9 Nginx} restart () {configtest | | return $? st OP sleep 1 start} reload () {Configtest | | return $? ECHO-N $ "Reloading $prog:" Killproc $nginx-hup retval=$? echo} force_reload () {restart} configtest () {$nginx-t #-c $NGINX _conf_file} rh_status () {Status $prog} rh_status_q () {rh_status >/dev/null 2>&1} case "$" in start) Rh_status_q && exit 0 $;; Stop) rh_status_q | | Exit 0 $;; restart) \ n; test) configtest;; Reload) Rh_status_q | | Exit 7 $;; Force-reload) foRce_reload;; status) Rh_status;; Condrestart|try-restart) rh_status_q | | Exit 0;; *) echo $ "Usage: $ start|stop|status|restart|condrestart|try-restart|reload|force-reload|test}" Exit 2 Esac PHP-FPM Shell script put under/etc/init.d/name PHP-FPM? 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 66676869#!/bin/bash# php-fpm startup script for the PHP-FPM # PHP-FPM version:5.5.0-alpha6# chkconfig:-15# Descriptio N:PHP-FPM is very good# processname:php-fpm# pidfile:/var/run/php-fpm.pid# config:/usr/local/php/etc/php-fpm.conf ph p_command=/usr/local/php/sbin/php-fomphp_config=/usr/local/php/etc/php-fpm.confphp_pid=/usr/local/php/var/run/  Php-fpm.pidretval=0prog= "PHP-FPM" #start Functionphp_fpm_start () {/USR/LOCAL/PHP/SBIN/PHP-FPM} start () {if [-E    $php _pid] then echo "PHP-FPM already start ..." Exit 1 fi Php_fpm_start} stop () {if [-e $php _pid] Then parent_pid=' Cat $php _pid ' all_pid= ' ps-ef | grep php-fpm | awk ' {if (' $parent _pid ' = = $ $) {print $}} ' for PID in $all _pid does kill $pid done kill $pare Nt_pid fi exit 1} restart () {Stop start} # See how we were Called.case "$" instart) start; ; stop) stop;; restart) stop start;;        Status) status $prog retval=$? ;; *) echo $ "Usage: $prog {start|stop|restart|status}" exit 1esacexit $RETVAL post-processing:? 1234567891011## Add Execute Permission Ch MoD A+x/etc/init.d/nginx chmod a+x/etc/init.d/php-fpm # # Join service chkconfig--add nginxchkconfig--add php-fpm # # Power on Start CH Kconfig Nginx on Chkconfig php-fpm on

  

NGINX, PHP-FPM boot automatically

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.