全球主机交流论坛

标题: lnmp在centos 下无法开机时自动启动吗? [打印本页]

作者: wjhhxl    时间: 2011-3-18 23:16
标题: lnmp在centos 下无法开机时自动启动吗?
怎么我重启后,网站就打不开,必须手动启动一下LNMP
作者: tony1999    时间: 2011-3-18 23:16
标题: 回复 1# 的帖子
加到rc.local
作者: wjhhxl    时间: 2011-3-18 23:42
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
ulimit -SHn 51200
/usr/local/php/sbin/php-fpm start
/usr/local/nginx/sbin/nginx

我的这个文件是这样的,我不知道怎么加,你能告诉我一下吗。谢谢@@
作者: winder    时间: 2011-3-18 23:53
如果不行在最后面加一句
/root/lnmp start
作者: tony1999    时间: 2011-3-19 00:13
原帖由 wjhhxl 于 2011-3-18 23:42 发表
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /va ...


有这两行的话,说明已经加好了
/usr/local/php/sbin/php-fpm start
/usr/local/nginx/sbin/nginx

看看mysql启动了没
作者: wjhhxl    时间: 2011-3-19 16:20
奇怪了,我自己在虚拟机上测试时,rc.local文件是一样的,但我虚拟机重启时,LNMP也能启动!为什么服务器上的不行。
作者: usa    时间: 2011-3-19 16:22
有时候没有启动 多等几分钟看看
我之前有测试 等了5分钟左右才自己启动的...不要急 多观察~
作者: 95147    时间: 2011-3-19 16:39
要稍微等等的,不是机器启动好了lnmp什么的都能启动好
作者: wjhhxl    时间: 2011-3-20 07:34
原帖由 usa 于 2011-3-19 16:22 发表
有时候没有启动 多等几分钟看看
我之前有测试 等了5分钟左右才自己启动的...不要急 多观察~



真感谢你啊,原来真是要等个二分钟才能启动好!!!!




欢迎光临 全球主机交流论坛 (https://loc.imgfree.eu.org/) Powered by Discuz! X3.4