Reboot server using web interface

+3 pd0sh  · November 19, 2014
I have some linux vps. Is it possible to reboot the vps by using web interface? So, it could be easier and manageable without having me to go to every each vps control panel which came from different providers.

Post a Reply

Replies

Oldest  Newest  Rating
0 Eugene Botma · November 19, 2014
You'd need to run a program/web server on each VPS that accepts a connection and then triggers the reboot. It certainly is possible, but I don'y recommend it. Aside from the obvious security issues, if a server needs to be restarted constantly, somethings wrong. Why do you need to restart the servers? it sounds like a regular thing.
0 Chris Whitlock · November 20, 2014
It depends. I run my own server at home and I work with it off-site and I sometimes need to restart it. The only difference is I have root access and use SSH to do the reboot. If you want to restart a server remotely the first thing you gotta know is you can't just write some web script and do it. You will need root access and have access to the server itself.

To do it through the browser I'd use PHP of course. Do some google searches and read up about "Sending SSH commands with PHP" and you can start with searching for "ssh2_connect".

If you have too much trouble I can type up a quick one but you'll have to enter the variable data. The best way to learn is to do it yourself. Good luck and please let me know.

Best regards,
Chris W.
0 pd0sh  · November 20, 2014
Thanks for the replies.

The reason I need to reboot my servers because it only have 512mb of ram. And keep down whenever I need to download something from it. I migrate from apache to nginx and give it a try for a few days.
0 Colonel Panic · November 21, 2014
just use an ssh command to restart it.  Set up PKI keys to secure the connection https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2

Once you have keys set up, run this command on your workstation.
ssh -t userWithSuperPrivs@serverName 'sudo shutdown -r now'
-1 Colonel Panic · November 19, 2014
I agree, this sounds all sorts of dirty
  • 1

Linux

107,333 followers
About

Linux is a free and open source software operating system for computers.

Links
Moderators
Bucky Roberts Administrator