In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Known Nginx management commands are:
Start: / application/nginx/sbin/nginx
Stop: / application/nginx/sbin/nginx-s stop
Reload: / application/nginx/sbin/nginx-s reload
Use the case script to simulate Nginx service startup and shutdown:
/ etc/init.d/nginx {start | stop | reload | restart}, which can be managed through chkconfig.
[root@web01 ~] # cat / etc/init.d/nginx#/bin/sh# chkconfig: 2345 15 62 # set the run level and the order to start and stop Nginx services # description: Nginx Server # script description [- f / etc/init.d/functions] & &. / etc/init.d/functions | | exit 1#Define ArivablesPath=/application/nginx/sbin/nginxRETVAL=0 # Define Start Functionstart () {if [`ss-lntup | grep nginx | wc-l`-gt 0]; then echo "Nginx is Running..." Else $Path RETVAL=$? If [$RETVAL-eq 0]; then action "Starting Nginx..." / bin/true else action "Starting Nginx..." / bin/false fi fi return $RETVAL} # Define Stop Functionstop () {if [`ss-lntup | grep nginx | wc-l`-gt 0]; then $Path-s stop RETVAL=$? If [$RETVAL-eq 0]; then action "Stopping Nginx..." / bin/true else action "Stopping Nginx..." / bin/false fi else echo "Nginx is Stopped" fi return $RETVAL} # Define Restart Functionreload () {if [`ss-lntup | grep nginx | wc-l`-gt 0]; then $Path-s reload RETVAL=$? If [$RETVAL-eq 0]; then action "Reloading Nginx..." / bin/true else action "Reloading Nginx..." / bin/false fi else echo "Nginx is Stopped" fi return $RETVAL} # Define Restart Functionrestart () {stop sleep 1 start return $RETVAL} case "$1" in start) start RETVAL=$?; stop) stop RETVAL=$? Reload) reload RETVAL=$?;; restart) restart RETVAL=$?; *) echo "USAGE:$0 {start | stop | reload | restart}" RETVAL=2;; esacexit $RETVAL [root@web01 ~] # ls-l / etc/init.d/nginx-rwxr-xr-x. 1 root root 1680 Jun 9 12:13 / etc/init.d/nginx [root@web01 ~] # chkconfig-- list | grep nginxnginx 0:off 1:off 2:on 3:on 4:on 5:on 6:off
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.