VPS侦探论坛

 找回密码
 注册
查看: 5321|回复: 1

lnmp 0.9安装报错

[复制链接]
发表于 2012-6-5 15:12:01 | 显示全部楼层 |阅读模式

centos 6.2 64位

#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
# Check if user is root
if [ $(id -u) != "0" ]; then
    printf "Error: You must be root to run this script!\n"
    exit 1
fi
printf "=========================================================================\n"
printf "Manager for LNMP V0.9  ,  Written by Licess \n"
printf "=========================================================================\n"
printf "LNMP is a tool to auto-compile & install Nginx+MySQL+PHP on Linux \n"
printf "This script is a tool to Manage status of lnmp \n"
printf "For more information please visit http://www.lnmp.org \n"
printf "\n"
printf "Usage: /root/lnmp {start|stop|reload|restart|kill|status}\n"
printf "=========================================================================\n"
NGINXNAME=nginx
NGINXCONFIGFILE=/usr/local/nginx/conf/$NGINXNAME.conf
NGINXPIDFILE=/usr/local/nginx/logs/$NGINXNAME.pid
NGINXDAEMON=/usr/local/nginx/sbin/$NGINXNAME
PHPFPMNAME=php-fpm
PHPFPMCONFIGFILE=/usr/local/php/etc/$PHPFPMNAME.conf
PHPFPMPIDFILE=/usr/local/php/logs/$PHPFPMNAME.pid
PHPFPMDAEMON=/usr/local/php/sbin/$PHPFPMNAME
HOSTNAME=`hostname`
MYSQLPIDFILE=/usr/local/mysql/var/$HOSTNAME.pid
function_start()
{
    printf "Starting LNMP...\n"
    if [ -f $NGINXPIDFILE ]; then
        printf "Nginx is runing!\n"
        exit 1
    else
        $NGINXDAEMON -c $NGINXCONFIGFILE
        printf "Nginx start successfully!\n"
    fi
    if [ -f $PHPFPMPIDFILE ]; then
        printf "php-fpm is runing!\n"
    else
$PHPFPMDAEMON start
printf "PHP-FPM start successfully!\n"
    fi
    if [ -f $MYSQLPIDFILE ]; then
        printf "MySQL is runing!\n"
    else
/etc/init.d/mysql start
printf "MySQL start successfully!\n"
    fi
}
function_stop()
{
    printf "Stoping LNMP...\n"
    if  [ -f $NGINXPIDFILE ]; then
        kill `cat $NGINXPIDFILE`
        printf "Nginx program is stop\n"
    else
        printf "Nginx program is not runing!\n"
    fi
    if  [ -f $PHPFPMPIDFILE ]; then
        $PHPFPMDAEMON stop
        printf "PHP-FPM program is stop\n"
    else
        printf "PHP-FPM program is not runing!\n"
    fi
    if  [ -f $MYSQLPIDFILE ]; then
        /etc/init.d/mysql stop
        printf "MySQL program is stop\n"
    else
        printf "MySQL program is not runing!\n"
    fi
}
function_reload()
{
    printf "Reload LNMP...\n"
    printf "Reload Nginx configure...\n"
    $NGINXDAEMON -t
    $NGINXDAEMON -s reload
    printf "Nginx program is reloding!\n"
    /etc/init.d/mysql reload
    $PHPFPMDAEMON reload
}
function_restart()
{
    printf "Reload LNMP...\n"
    printf "Reload Nginx configure...\n"
    $NGINXDAEMON -t
    kill `cat $NGINXPIDFILE`
    $NGINXDAEMON -c $NGINXCONFIGFILE
    printf "Nginx program is restarting!\n"
    /etc/init.d/mysql restart
    $PHPFPMDAEMON restart
}
function_kill()
{
    kill `cat $NGINXPIDFILE`
    kill `cat $PHPFPMPIDFILE`
    kill `cat $MYSQLPIDFILE`
}
function_status()
{
    if [ -f $NGINXPIDFILE ]; then
      printf "Nginx is runing!\n"
    else
printf "Nginx is stop!\n"
    fi
    if [ -f $PHPFPMPIDFILE ]; then
      printf "php-fpm is runing!\n"
    else
printf "php-fpm is stop!\n"
    fi
/etc/init.d/mysql status
}
case "$1" in
start)
  function_start
  ;;
stop)
  function_stop
  ;;
restart)
  function_stop
  function_start
  ;;
reload)
  function_reload
  ;;
kill)
  function_kill
  ;;
status)
  function_status
  ;;
*)
  printf "Usage: /root/lnmp {start|stop|reload|restart|kill|status}\n"
esac
exit
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2012-6-5 15:14:55 | 显示全部楼层


哪里有日志啊
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-11-17 13:27 , Processed in 0.032457 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表