VPS侦探论坛

 找回密码
 注册
查看: 5144|回复: 2

国外VPS安装不成功,代码如下,麻烦老大看看~~~

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

  1. #!/bin/bash
  2. PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
  3. export PATH

  4. # Check if user is root
  5. if [ $(id -u) != "0" ]; then
  6.     printf "Error: You must be root to run this script!\n"
  7.     exit 1
  8. fi

  9. printf "=========================================================================\n"
  10. printf "Manager for LNMP V0.9  ,  Written by Licess \n"
  11. printf "=========================================================================\n"
  12. printf "LNMP is a tool to auto-compile & install Nginx+MySQL+PHP on Linux \n"
  13. printf "This script is a tool to Manage status of lnmp \n"
  14. printf "For more information please visit http://www.lnmp.org \n"
  15. printf "\n"
  16. printf "Usage: /root/lnmp {start|stop|reload|restart|kill|status}\n"
  17. printf "=========================================================================\n"

  18. NGINXNAME=nginx
  19. NGINXCONFIGFILE=/usr/local/nginx/conf/$NGINXNAME.conf
  20. NGINXPIDFILE=/usr/local/nginx/logs/$NGINXNAME.pid
  21. NGINXDAEMON=/usr/local/nginx/sbin/$NGINXNAME
  22. PHPFPMNAME=php-fpm
  23. PHPFPMCONFIGFILE=/usr/local/php/etc/$PHPFPMNAME.conf
  24. PHPFPMPIDFILE=/usr/local/php/logs/$PHPFPMNAME.pid
  25. PHPFPMDAEMON=/usr/local/php/sbin/$PHPFPMNAME
  26. HOSTNAME=`hostname`
  27. MYSQLPIDFILE=/usr/local/mysql/var/$HOSTNAME.pid

  28. function_start()
  29. {
  30.     printf "Starting LNMP...\n"
  31.     if [ -f $NGINXPIDFILE ]; then
  32.         printf "Nginx is runing!\n"
  33.         exit 1
  34.     else
  35.         $NGINXDAEMON -c $NGINXCONFIGFILE
  36.         printf "Nginx start successfully!\n"
  37.     fi

  38.     if [ -f $PHPFPMPIDFILE ]; then
  39.         printf "php-fpm is runing!\n"
  40.     else
  41.         $PHPFPMDAEMON start
  42.         printf "PHP-FPM start successfully!\n"
  43.     fi

  44.     if [ -f $MYSQLPIDFILE ]; then
  45.         printf "MySQL is runing!\n"
  46.     else
  47.         /etc/init.d/mysql start
  48.         printf "MySQL start successfully!\n"
  49.     fi
  50. }

  51. function_stop()
  52. {
  53.     printf "Stoping LNMP...\n"
  54.     if  [ -f $NGINXPIDFILE ]; then
  55.         kill `cat $NGINXPIDFILE`
  56.         printf "Nginx program is stop\n"
  57.     else
  58.         printf "Nginx program is not runing!\n"
  59.     fi

  60.     if  [ -f $PHPFPMPIDFILE ]; then
  61.         $PHPFPMDAEMON stop
  62.         printf "PHP-FPM program is stop\n"
  63.     else
  64.         printf "PHP-FPM program is not runing!\n"
  65.     fi

  66.     if  [ -f $MYSQLPIDFILE ]; then
  67.         /etc/init.d/mysql stop
  68.         printf "MySQL program is stop\n"
  69.     else
  70.         printf "MySQL program is not runing!\n"
  71.     fi
  72. }

  73. function_reload()
  74. {
  75.     printf "Reload LNMP...\n"
  76.     printf "Reload Nginx configure...\n"
  77.     $NGINXDAEMON -t
  78.     $NGINXDAEMON -s reload
  79.     printf "Nginx program is reloding!\n"
  80.     /etc/init.d/mysql reload
  81.     $PHPFPMDAEMON reload
  82. }

  83. function_restart()
  84. {
  85.     printf "Reload LNMP...\n"
  86.     printf "Reload Nginx configure...\n"
  87.     $NGINXDAEMON -t
  88.     kill `cat $NGINXPIDFILE`
  89.     $NGINXDAEMON -c $NGINXCONFIGFILE
  90.     printf "Nginx program is restarting!\n"
  91.     /etc/init.d/mysql restart
  92.     $PHPFPMDAEMON restart
  93. }

  94. function_kill()
  95. {
  96.     kill `cat $NGINXPIDFILE`
  97.     kill `cat $PHPFPMPIDFILE`
  98.     kill `cat $MYSQLPIDFILE`
  99. }

  100. function_status()
  101. {
  102.     if [ -f $NGINXPIDFILE ]; then
  103.       printf "Nginx is runing!\n"
  104.     else
  105.         printf "Nginx is stop!\n"
  106.     fi

  107.     if [ -f $PHPFPMPIDFILE ]; then
  108.       printf "php-fpm is runing!\n"
  109.     else
  110.         printf "php-fpm is stop!\n"
  111.     fi
  112. /etc/init.d/mysql status
  113. }

  114. case "$1" in
  115.         start)
  116.                 function_start
  117.                 ;;
  118.         stop)
  119.                 function_stop
  120.                 ;;
  121.         restart)
  122.                 function_stop
  123.                 function_start
  124.                 ;;
  125.         reload)
  126.                 function_reload
  127.                 ;;
  128.         kill)
  129.                 function_kill
  130.                 ;;
  131.         status)
  132.                 function_status
  133.                 ;;
  134.         *)
  135.                 printf "Usage: /root/lnmp {start|stop|reload|restart|kill|status}\n"
  136. esac
  137. exit
复制代码
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2012-6-22 15:14:58 | 显示全部楼层


32位操作系统,用的DEBIAN系统
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2012-6-22 16:31:19 | 显示全部楼层

你发的这是日志文件吗?! 日志是lnmp.log啊
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-17 18:30 , Processed in 0.027903 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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