使用 ssh 重新启动 linux web 服务器
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7858559/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
restart linux web server using ssh
提问by Muhammad Umar
I have shut down my linux web server using ssh command
我已经使用 ssh 命令关闭了我的 linux web 服务器
~# shutdown -h now
how can i restart the server again. i am trying out different things but they are not helping. How to restart using ssh.
我怎样才能再次重新启动服务器。我正在尝试不同的东西,但它们没有帮助。如何使用 ssh 重新启动。
采纳答案by Nasreddine
You have powered off the machine, you can't restart it from SSH. unless it supports Wake from Lan.
您已关闭机器电源,无法从 SSH 重新启动它。除非它支持从局域网唤醒。
If you want to only restart your web server use
如果您只想重新启动 Web 服务器,请使用
apachectl restart
apachectl restart
回答by kubal5003
reboot
reboot
or if you want to restart just apache then
或者如果你只想重启 apache 那么
/etc/init.d/apache2 restart
/etc/init.d/apache2 restart
and if you want to shutdown then instead of shutdown -h now
you can simply use poweroff
如果你想关机,那么shutdown -h now
你可以简单地使用poweroff
回答by bbaja42
You have shut down your server. Unless server supports wake from lan
option, you can no longer turn it on remotely.
您已关闭服务器。除非服务器支持wake from lan
选项,否则您不能再远程打开它。
To restart server, use reboot
command through ssh.
要重新启动服务器,请reboot
通过 ssh使用命令。
回答by user1008373
Sorry I can't advise how to remotely turn on the server. But if you are asking how to reboot it next time, use "shutdown -r now"
抱歉,我无法建议如何远程打开服务器。但是,如果您询问下次如何重新启动,请使用“shutdown -r now”
回答by MarkR
It depends what kind of server it is and what remote access facilities you have. If you did not personally (or your colleagues) set up the server, you should contact whoever did and ask them how to do this.
这取决于它是哪种服务器以及您拥有哪些远程访问设施。如果您没有亲自(或您的同事)设置服务器,您应该联系设置服务器的人并询问他们如何设置。
It is possible they may charge for this "remote hands" service if they have to physically access it (NB: rebooting is often handled by a separate system; many dedicated providers have their own systems for PDU remote control etc. A virtualised server probably does not need a remote hands request to reboot, because it can be handled by the hypervisor's control interface to which you may have some access).
如果他们必须实际访问它,他们可能会对这种“远程”服务收费(注意:重启通常由单独的系统处理;许多专用供应商都有自己的 PDU 远程控制系统等。虚拟化服务器可能会这样做不需要远程手动请求来重新启动,因为它可以由您可能有权访问的管理程序的控制接口处理)。