Showing posts with label vps. Show all posts
Showing posts with label vps. Show all posts

Friday, November 16, 2012

OpenVZ VPS CentOS Linux setup notes

OpenVZ VPS running CentOS Linux, setup notes:

To change the timezone:
[root@voyager asterisk-1.8.18.0]# date
Sat Nov 17 06:12:49 MSK 2012
[root@voyager etc]# ln -sf /usr/share/zoneinfo/EST /etc/localtime
[root@voyager etc]# date
Fri Nov 16 22:13:52 EST 2012
Make sure to restart your VPS and also check the syslog daemon that it has its time properly. I noticed I had to restart the syslog daemon service to get the date and time updated.
service syslog restart

Thursday, June 7, 2012

How to receive an e-mail alert when your linux server or linux VPS restarts

Here is a quick tip on how to receive an e-mail alert if your linux server or linux VPS restarts:

1. Log into your linux server or VPS using ssh.
2. Type in crontab -e into the commandline.
            Depending on the default text editor, it could be nano or vi. Here are the directions for vi:
3. Press insert button on your keyboard.
4. Then type in @reboot echo "Rebooted, now online" | mail -s "`hostname` REBOOTED" you@yourdomain.com
5. Then type in :wq to save and quit the vi text editor.

If your default text editor is nano, then the commands to type in are:

3. Find a new line or create one by pressing the Enter key.
4. Now type in on one line:
@reboot echo "Rebooted, now online" | mail -s "`hostname` REBOOTED" you@yourdomain.com
5. Then press CTRL and X on the keyboard to save.
6. Press Y to save the changes. Press Enter to exit.

If you want to send the e-mail to multiple people, edit the line to show this instead:
@reboot echo "Rebooted, now online" | mail -s "`hostname` REBOOTED" -c "user2@yourdomain.com" you@yourdomain.com

Now you will receive an e-mail alert when your server or VPS reboots. Very handy in troubleshooting issues with your VPS provider or your own server.