| 关键词: 脚本 php bin usr 以下 restart 内容 nginxd local nginx |
重启nginx是执行 /usr/bin/nginxd restart 即可 以下是脚本内容: #!/usr/local/php/bin/php <? if($argv[1]=="start") { echo system("ulimit -SHn 51200"); echo system("/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf"); } elseif($argv[1]=="stop") { echo system("killall -9 nginx"); } elseif($argv[1]=="test") { echo system("/usr/local/nginx/sbin/nginx -t"); } elseif($argv[1]=="restart") { echo system("killall -9 nginx"); sleep(1); echo system("ulimit -SHn 51200"); echo system("/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf"); } else echo "Usage: nginx {start|stop|restart|test|} "; ?> |
|
声明:文章版权归原作者所有 部分文章转自互联网 如有侵权请联系
[邮箱地址] 删除
|