Having a self-managed Ubuntu server from Vultr for as low as $2.5 a month (or Digital Ocean for $5 a month (setup guides here or here respectively)) can certainly be cheap but you take on all the support and risk in keeping the services up.
Vultr has a good monitoring information but this does not show you services performance.
Node JS monitoring service like http://docs.keymetrics.io/ is great at monitoring Node applications where webmin and PHPServerMonitor are good options for monitoring basic servers and services.
The more software you install the more complex the setup and find potential errors.
Service Interruption Notifications
How will you be notified when things are down? Having automated monitoring scripts (or Self Service Status Pages) or external monitoring services is a good idea, the last thing you wants is to see your server or service is down based on a twitter reply.
Much thanks goes to Michael Boelen on Twitter for reporting that my server was down: Follow: @mboelen
Founder of @cisofy_is, author of rkhunter and Lynis, blogger at linux-audit.com, public speaker. #linux #security
Read more Linux troubleshooting tips at https://linux-audit.com/
You can have many different types of errors and it is going to be hard to suggest where your problem is going to be.
Provider/Networking Errors
Always assume provider errors are an issue, more often than not my servers have gone offline due to provider problems outside of my control.
I have had networking errors on Vultr with the default Dynamic DHCP IP’s (prompting changes to Static IP’s). I have also had issues with Static IP’s on Vultr and had to log a Support Tickets again when my server went offline, In this case, Vultr was able to restore my server but I am unsure of what happened?
Example Problem (DHCP IP): Dynamic IP, VM is totally offline (not accessible via the web or Telnet, but is accessible via Vultr Web Console).
I logged a ticket with Vultr after I rebooted the server.
Vultr support quickly identified the problem was my server was not picking up an IP address and suggested I set static IP and reboot.
Example Problem (Static IP): VM is totally offline (not accessible via the web or Telnet, but is accessible via Vultr Web Console).
Again I logged a support ticket and Vultr indicated the issues was network related.
In both cases, there was nothing I could do (a reboot did not fix each error) and a support ticket had to be logged.
Broken WordPress
Example Problem (Website Down): Error 502 bad gateway
Today I had a server stay-up buy NGINX reported error 502 bad gateway. IN this case, I rebooted the server
Know your NGINX log file location
Show the last 22 lines of the identifies NGINX log file
tail -n 200 error_log /var/log/nginx/error.log
Error Hints
PHP-FPM is reporting errors.
WordPress too is reporting errors, I could have restarted NGINX and PHP but it was just as easy to reboot the server as I forgot the right commands to restart PHP/NGINX.
I rebooted the server in 30 seconds.
How I Rebooted in Ubuntu
How to prevent this error in future?
- Extend PHP file execution time (No)
- Daily reboots of the server (No)?
- Daily restarts of NGINX/PHP (Yes, Short Term)
- Check the server for errors and automatically reboot (Yes, Long Term).
How to check system uptime (verifying the server rebooted)
I will set a cronjob entry to perform diagnostics (via a Bash Script) and restart NGINX/PHP or the server. I might set up remote monitoring of the webserver content too.
I should have checked memory/CPU usage too but forgot (sometimes it is best to do a deep investigation and get more information).
Troubleshooting Network Errors
As mentioned above the providers can have network issues (with a static or Dynamic IP) so don’t feel bad if you cannot fix every networking error.
Perform External Ping
Can you ping a remote server from your server?
Has your domain expired?
Check the expiry of your domain here
Here is a nice post on setting up a bash script to check multiple domains expiry.
Common (Digital Ocean) Debugging commands
SSL Certificate
You can check the expiry of your SSL certificate by scanning our site with https://www.ssllabs.com/ssltest/
If you use a Let’s Encrypt SSL certificate you can reissue a certificate (see my guide here)
Web Server Config
It is a good idea to make a backup of your web server (NGINX) configuration and know what each configuration value does.
View NGINX Config
Web Console (Vultr)
Server Setup Guide
Read more here on setting up Ubuntu on Vultr
Local Network Info
Read more here on setting up Ubuntu Networking on Vultr
Disable Firewall
Read more on setting up firewalls on Ubuntu here.
Logs
Common Ubuntu Log paths: https://help.ubuntu.com/community/LinuxLogFiles
If in Doubt, Reboot
Log a ticket
Remember you can log a ticket with Vultr when things go pear shape.
Monitoring
Don’t forget to have a self-serve status page to alert you when things go wrong.
Vultr Status Page
View the Vultr status page here.
Your Status Page
Read my service status page guide here.
Past Data
Do document past errors and try and prevent those errors from happening again and act upon reoccurring errors (using past documentation).
Donate and make this blog better
Ask a question or recommend an article
[contact-form-7 id=”30″ title=”Ask a Question”]
Revision History
v1.2 added common digital ocean commands
etc