一个管理nginx和php-fpm的脚本
来源:互联网 发布:jdk 6u45 windows x64 编辑:程序博客网 时间:2024/06/10 14:59
一个同时启停或者加载配置,用于管理nginx和php-fpm的脚本,可以放在任意目录,也可以放在/etc/init.d/里面,然后chkconfig一下,使其开机启动。
PS:现在用CentOS7的人多么?……
#!/bin/shsource /etc/profileSETCOLOR_FAILURE="echo -en \\033[1;31m"SETCOLOR_SUCCESS="echo -en \\033[1;32m"SETCOLOR_NORMAL="echo -en \\033[0;39m"function CheckReturn{if [ "$?" -eq "0" ]then$SETCOLOR_SUCCESSecho $1$SETCOLOR_NORMALelse$SETCOLOR_FAILUREecho $2$SETCOLOR_NORMALfi}cmd=$1php_fpm_bin_path="/usr/local/php/sbin/php-fpm"php_fpm_conf_path="/usr/local/php/lib"nginx_bin_path="/usr/local/nginx/sbin/nginx"nginx_pid_path="/usr/local/nginx/nginx.pid"case "$cmd" in'start')ulimit -SHn 65535$php_fpm_bin_path -c $php_fpm_conf_path/php.ini -y $php_fpm_conf_path/php-fpm.conf -t &> /dev/nullif [ "$?" -eq "0" ]then$php_fpm_bin_path -c $php_fpm_conf_path/php.ini -y $php_fpm_conf_path/php-fpm.conf &> /dev/nullCheckReturn "php-fpm start success!" "php-fpm start failed!"elseecho "php-fpm start test failed!"fi$nginx_bin_path -t &> /dev/nullif [ "$?" -eq "0" ]then$nginx_bin_path &> /dev/nullCheckReturn "nginx start success!" "nginx start failed!"elseecho "nginx start test failed!"fi;;'stop')kill -QUIT `cat /usr/local/php/var/run/php-fpm.pid` &> /dev/nullCheckReturn "php-fpm stop success!" "php-fpm stop failed!"kill -QUIT `cat $nginx_pid_path` &> /dev/nullCheckReturn "nginx stop success!" "nginx stop failed!";;'reload')$php_fpm_bin_path -c $php_fpm_conf_path/php.ini -y $php_fpm_conf_path/php-fpm.conf -tif [ "$?" -eq "0" ]thenkill -USR2 `cat /usr/local/php/var/run/php-fpm.pid`elseecho "php-fpm reload test failed!"fi$nginx_bin_path -tif [ "$?" -eq "0" ]then$nginx_bin_path -s reloadelseecho "nginx reload test failed!"fi;;*)# usageecho "Usage: $0 {start|stop|reload}"exit 1;;esac
0 0
- 一个管理nginx和php-fpm的脚本
- Nginx和PHP-FPM的启动/重启脚本
- Nginx和PHP-FPM的启动/重启脚本 [转发]
- Nginx和PHP-FPM的启动/重启脚本 [转发]
- Nginx和PHP-FPM的启动/重启脚本
- Nginx和PHP-FPM的启动/重启脚本
- Nginx和PHP-FPM的启动/重启脚本
- Nginx和PHP-FPM的启动、重启、停止脚本
- php-fpm 管理脚本
- nginx 和 php-fpm的通信
- Nginx和PHP-FPM的启动、重启、停止脚本分享
- Nginx和PHP-FPM的启动、重启、停止脚本分享
- Nginx和PHP-FPM的启动、重启、停止脚本分享
- Nginx和PHP-FPM的启动、重启、停止脚本分享
- nginx和php-fpm配置
- nginx、php-fpm启动脚本详解
- linux 安装了memcache模块,phpinfo加载不了 & Nginx和PHP-FPM的启动/重启脚本
- Nginx和php,FastCGI和php-fpm
- SQL Server 根据表名获取表的所有列及属性(数据同步服务数据分析需要)
- 从热更新到Nuwa源码分析
- 算法导论第五章
- Redis安装配置教程
- 安卓开发不得不收集的工具类
- 一个管理nginx和php-fpm的脚本
- Struts环境搭建
- Data URI scheme - 数据的uri模式
- RunLoop
- Java系列-集合框架理解
- 如何建设一个营销型网站
- iOS 控制器View加载顺序详细版
- Unity3d 反编译破解游戏 简单示例 (使用ildasm反编译DLL修改然后重新编译DLL)
- ios系统界面带英文解决方法