• Skip to primary navigation
  • Skip to content
  • Skip to primary sidebar
  • Skip to footer
  • Home
  • Buy a Domain Name
  • Create your own VM ($25 Credit)
  • Setup Domain Email
  • Setup Server Monitoring
  • About

Code, InfoSec and Server Stuff

Views are my own and not my employer's

Personal Development Blog...

Coding for fun since 1996, Learn by doing and sharing.

Buy a domain name, then create your own server (get $25 free credit)

"If you're not still learning, you're already dying."
- Ryan Holiday - Ego is the Enemy

Follow me on Twitter: @FearbySoftware

View All Posts.

  • Cloud
    • I moved my domain to UpCloud (on the other side of the world) from Vultr (Sydney) and could not be happier with the performance.
    • How to buy a new domain and SSL cert from NameCheap, a Server from Digital Ocean and configure it.
    • Setting up a Vultr VM and configuring it
    • All Cloud Articles
  • Development
    • I moved my domain to UpCloud (on the other side of the world) from Vultr (Sydney) and could not be happier with the performance.
    • How to setup pooled MySQL connections in Node JS that don’t disconnect
    • NodeJS code to handle App logins via API (using MySQL connection pools (1000 connections) and query parameters)
    • Infographic: So you have an idea for an app
    • All Development Articles
  • MySQL
    • Using the free Adminer GUI for MySQL on your website
    • PHP 7 code to send object oriented sanitised input data via bound parameters to a MYSQL database
    • All MySQL Articles
  • Performance
    • I moved my domain to UpCloud (on the other side of the world) from Vultr (Sydney) and could not be happier with the performance.
    • Measuring VM performance (CPU, Disk, Latency, Concurrent Users etc) on Ubuntu and comparing Vultr, Digital Ocean and UpCloud – Part 1 of 4
    • Speeding up WordPress with the ewww.io ExactDN CDN and Image Compression Plugin
    • Setting up a website to use Cloudflare on a VM hosted on Vultr and Namecheap
    • All Performance Articles
  • Security
    • Using the Qualys FreeScan Scanner to test your website for online vulnerabilities
    • Using OWASP ZAP GUI to scan your Applications for security issues
    • Setting up the Debian Kali Linux distro to perform penetration testing of your systems
    • Enabling TLS 1.3 SSL on a NGINX Website (Ubuntu 16.04 server) that is using Cloudflare
    • PHP implementation to check a password exposure level with Troy Hunt’s pwnedpasswords API
    • Setting strong SSL cryptographic protocols and ciphers on Ubuntu and NGINX
    • Securing Google G Suite email by setting up SPF, DKIM and DMARC with Cloudflare
    • All Security Articles
  • Server
    • I moved my domain to UpCloud (on the other side of the world) from Vultr (Sydney) and could not be happier with the performance.
    • All Server Articles
  • Ubuntu
    • I moved my domain to UpCloud (on the other side of the world) from Vultr (Sydney) and could not be happier with the performance.
    • Useful Linux Terminal Commands
    • All Ubuntu Articles
  • VM
    • I moved my domain to UpCloud (on the other side of the world) from Vultr (Sydney) and could not be happier with the performance.
    • All VM Articles
  • WordPress
    • Speeding up WordPress with the ewww.io ExactDN CDN and Image Compression Plugin
    • Installing and managing WordPress with WP-CLI from the command line on Ubuntu
    • How to backup WordPress on a host that has CPanel
    • Moving WordPress to a new self managed server away from CPanel
    • Moving a CPanel domain with email to a self managed VPS and Gmail
    • All WordPress Articles
  • All

Debug an offline Vultr Ubuntu server

October 22, 2017 by Simon

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.

Advertisement:



Vultr has a good monitoring information but this does not show you services performance.

Monitor

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.

Down

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 were 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.

DHCP

Vultr support quickly identified the problem was my server was not picking up an IP address and suggested I set static IP and reboot.

DHCP Error

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.

Networking

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 teh server

Know your NGINX log file location

Shell
1
cat /etc/nginx/nginx.conf

Show the last 22 lines of the identifies NGINX log file

Lua
1
tail -n 200 error_log /var/log/nginx/error.log

Error  Hints

PHP-FPM is reporting errors.

Shell
1
2017/10/22 19:45:02 [error] 12045#0: *100883 connect() to unix:/var/run/php/php7.0-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client: 62.210.215.115, server: www.fearby.com, request: "GET /article/how-to-setup-a-twitter-feed-api-endpoint-in-nodejs-with-nginx-ruby-t-etc/feed/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock:", host: "fearby.com"

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.

Shell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2017/10/22 10:28:40 [error] 12045#0: *98242 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /www/wp-content/plugins/bj-lazy-load/inc/class-bjll.php on line 329
PHP message: PHP Stack trace:
PHP message: PHP   1. {main}() /www/index.php:0
PHP message: PHP   2. require() /www/index.php:17
PHP message: PHP   3. require_once() /www/wp-blog-header.php:19
PHP message: PHP   4. include() /www/wp-includes/template-loader.php:74
PHP message: PHP   5. genesis() /www/wp-content/themes/genesis/index.php:15
PHP message: PHP   6. do_action() /www/wp-content/themes/genesis/lib/framework.php:39
PHP message: PHP   7. WP_Hook->do_action() /www/wp-includes/plugin.php:453
PHP message: PHP   8. WP_Hook->apply_filters() /www/wp-includes/class-wp-hook.php:323
PHP message: PHP   9. genesis_do_loop() /www/wp-includes/class-wp-hook.php:298
PHP message: PHP  10. genesis_standard_loop() /www/wp-content/themes/genesis/lib/structure/loops.php:41
PHP message: PHP  11. do_action() /www/wp-content/themes/genesis/lib/structure/loops.php:92
PHP message: PHP  12. WP_Hook->do_action() /www/wp-includes/plugin.php:453
PHP message: PHP  13. WP_Hook->apply_filters() /www/wp-includes/class-wp-hook.php:323
PHP message: PHP  14. genesis_do_post_content() /www/wp-includes/class-wp-hook.php:298
PHP message: PHP  15. the_content() /www/wp-content/themes/genesis/lib/structure/post.php:367
PHP message: PHP  16. apply_filters() /www/wp-includes/post-template.php:240
PHP message: PHP  17. WP_Hook->apply_filters() /www/wp-includes/plugin.php:203
PHP message: PHP  18. BJLL::filter() /www/wp-includes/class-wp-hook.php:298
PHP message: PHP  19. apply_filters() /www/wp-content/plugins/bj-lazy-load/inc/class-bjll.php:169
PHP message: PHP  20. WP_Hook->apply_filters() /www/wp-includes/plugin.php:203
PHP message: PHP  21. BJLL::filter_iframes() /www/wp-includes/class-wp-hook.php:298
PHP message: PHP  22. BJLL::_get_content_haystack() /www/wp-content/plugins/bj-lazy-load/inc/class-bjll.php:255

I rebooted the server in 30 seconds.

Reboot

How I Rebooted in Ubuntu

Shell
1
sudo shutdown -r now

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)

Shell
1
2
uptime
20:04:02 up 14 min,  1 user,  load average: 0.13, 0.09, 0.08

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 web server 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?

Shell
1
2
3
4
5
6
ping www.google.com
PING www.google.com (172.217.25.132) 56(84) bytes of data.
64 bytes from syd15s03-in-f4.1e100.net (172.217.25.132): icmp_seq=1 ttl=57 time=0.853 ms
64 bytes from syd15s03-in-f4.1e100.net (172.217.25.132): icmp_seq=2 ttl=57 time=0.820 ms
64 bytes from syd15s03-in-f4.1e100.net (172.217.25.132): icmp_seq=3 ttl=57 time=0.776 ms
64 bytes from syd15s03-in-f4.1e100.net (172.217.25.132): icmp_seq=4 ttl=57 time=0.835 ms

Has your domain expired?

Check the expiry of your domain here

Shell
1
2
whois google.com | egrep -i 'Expiry Date'
Registry Expiry Date: 2020-09-14T04:00:00Z

Here is a nice post on setting up a bash script to check multiple domains expiry.

Common (Digital Ocean) Debugging commands

Shell
1
2
3
4
5
6
7
8
cat /etc/network/interfaces.d/50-cloud-init.cfg
cat /etc/network/interfaces
ip addr
ip route
uname -a
iptables -nvL --line-numbers
ls -l /lib/modules
cat /etc/udev/rules.d/70-persistent-net.rules

 

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

Shell
1
cat /etc/nginx/nginx.conf

Web Console (Vultr)

Server Setup Guide

Read more here on setting up Ubuntu on Vultr

Local Network Info

Shell
1
ifconfig

Read more here on setting up Ubuntu Networking on Vultr

Disable Firewall

Shell
1
sudo ufw disable

Read more on setting up firewalls on Ubuntu here.

Logs

Common Ubuntu Log paths: https://help.ubuntu.com/community/LinuxLogFiles

If in Doubt, Reboot

Shell
1
sudo shutdown -r now

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

Your Name (required)

Your Email (required)

Your Question

Revision History

v1.2 added common digital ocean commands

etc

Filed Under: Server, Status, Ubuntu, VM, Vultr, Wordpress Tagged With: Debug, offline, server, ubuntu, vultr

Advertisement:



Opt Out Of Tracking:

Become a Patron

Primary Sidebar

Advertisement:



Poll

What would you like to see more posts about?
Results

Support this Blog

Create your own server today (support me by using these links

Create your own server on UpCloud here ($25 free credit).

Create your own server on Vultr here.

Create your own server on Digital Ocean here ($10 free credit).

Remember you can install the Runcloud server management dashboard here if you need DevOps help.

Tags

Advice (15) Analytics (7) Android (6) App (9) Apple (8) AWS (8) Backup (13) Blog (6) Business (8) CDN (7) Cloud (45) Cloudflare (8) Cost (6) Development (26) Digital Ocean (12) DNS (10) Domain (25) Firewall (12) Hosting (18) IoT (6) JIRA (6) LetsEncrypt (7) Linux (17) Marketing (11) MySQL (21) Networking (6) NGINX (9) NodeJS (10) OS (9) PHP (11) Scalability (12) Scalable (14) Security (39) SEO (7) Server (25) Software (7) ssl (17) Status (6) Tech Advice (9) Ubuntu (37) UpCloud (10) VM (41) Vultr (23) Website (13) Wordpress (25)

Disclaimer

Terms And Conditions Of UseAll content provided on this "www.fearby.com" blog is for informational purposes only. Views are his own and not his employers. The owner of this blog makes no representations as to the accuracy or completeness of any information on this site or found by following any link on this site. Never make changes to a live site without backing it up first.

Footer

Popular

  • Add two factor auth login protection to WordPress with YubiCo hardware YubiKeys and or 2FA Authenticator App
  • Setup two factor authenticator protection at login on Ubuntu or Debian
  • Using the Yubico YubiKey NEO hardware-based two-factor authentication device to improve authentication and logins to OSX and software
  • I moved my domain to UpCloud (on the other side of the world) from Vultr (Sydney) and could not be happier with the performance.
  • How to setup pooled MySQL connections in Node JS that don’t disconnect
  • Measuring VM performance (CPU, Disk, Latency, Concurrent Users etc) on Ubuntu and comparing Vultr, Digital Ocean and UpCloud – Part 1 of 4
  • Monitor server performance with NixStats and receive alerts by SMS, Push, Email, Telegram etc
  • Speeding up WordPress with the ewww.io ExactDN CDN and Image Compression Plugin
  • Add Google AdWords to your WordPress blog

Security

  • Check the compatibility of your WordPress theme and plugin code with PHP Compatibility Checker
  • Add two factor auth login protection to WordPress with YubiCo hardware YubiKeys and or 2FA Authenticator App
  • Setup two factor authenticator protection at login on Ubuntu or Debian
  • Using the Yubico YubiKey NEO hardware-based two-factor authentication device to improve authentication and logins to OSX and software
  • Setting up DNSSEC on a Namecheap domain hosted on UpCloud using CloudFlare
  • Set up Feature-Policy, Referrer-Policy and Content Security Policy headers in Nginx
  • Securing Google G Suite email by setting up SPF, DKIM and DMARC with Cloudflare
  • Enabling TLS 1.3 SSL on a NGINX Website (Ubuntu 16.04 server) that is using Cloudflare
  • Using the Qualys FreeScan Scanner to test your website for online vulnerabilities
  • Beyond SSL with Content Security Policy, Public Key Pinning etc
  • Upgraded to Wordfence Premium to get real-time login defence, malware scanner and two-factor authentication for WordPress logins
  • Run an Ubuntu VM system audit with Lynis
  • Securing Ubuntu in the cloud
  • No matter what server-provider you are using I strongly recommend you have a hot spare ready on a different provider

Code

  • Useful Java FX Code I use in a project using IntelliJ IDEA and jdk1.8.0_161.jdk
  • No matter what server-provider you are using I strongly recommend you have a hot spare ready on a different provider
  • How to setup PHP FPM on demand child workers in PHP 7.x to increase website traffic
  • Installing Android Studio 3 and creating your first Kotlin Android App
  • PHP 7 code to send object oriented sanitised input data via bound parameters to a MYSQL database
  • How to use Sublime Text editor locally to edit code files on a remote server via SSH
  • Creating your first Java FX app and using the Gluon Scene Builder in the IntelliJ IDEA IDE
  • Deploying nodejs apps in the background and monitoring them with PM2 from keymetrics.io

Tech

  • Check the compatibility of your WordPress theme and plugin code with PHP Compatibility Checker
  • Is OSX Mojave on a 2014 MacBook Pro slower or faster than High Sierra
  • Telstra promised Fibre to the house (FTTP) when I had FTTN and this is what happened..
  • The case of the overheating Mac Book Pro and Occam’s Razor
  • Useful Linux Terminal Commands
  • Useful OSX Terminal Commands
  • Useful Linux Terminal Commands
  • What is the difference between 2D, 3D, 360 Video, AR, AR2D, AR3D, MR, VR and HR?
  • Application scalability on a budget (my journey)
  • Monitor server performance with NixStats and receive alerts by SMS, Push, Email, Telegram etc
  • Why I will never buy a new Apple Laptop until they fix the hardware cooling issues.

Wordpress

  • Telstra promised Fibre to the house (FTTP) when I had FTTN and this is what happened..
  • Check the compatibility of your WordPress theme and plugin code with PHP Compatibility Checker
  • Add two factor auth login protection to WordPress with YubiCo hardware YubiKeys and or 2FA Authenticator App
  • Monitor server performance with NixStats and receive alerts by SMS, Push, Email, Telegram etc
  • Upgraded to Wordfence Premium to get real-time login defence, malware scanner and two-factor authentication for WordPress logins
  • Wordfence Security Plugin for WordPress
  • Speeding up WordPress with the ewww.io ExactDN CDN and Image Compression Plugin
  • Installing and managing WordPress with WP-CLI from the command line on Ubuntu
  • Moving WordPress to a new self managed server away from CPanel
  • Moving WordPress to a new self managed server away from CPanel

General

  • Infographic: So you have an idea for an app
  • Restoring lost files on a Windows FAT, FAT32, NTFS or Linux EXT, Linux XFS volume with iRecover from diydatarecovery.nl
  • Building faster web apps with google tools and exceed user expectations
  • Why I will never buy a new Apple Laptop until they fix the hardware cooling issues.
  • Telstra promised Fibre to the house (FTTP) when I had FTTN and this is what happened..

Copyright © 2019 · News Pro on Genesis Framework · WordPress · Log in

Some ads on this site use cookies. You can opt-out if of local analytics tracking by scrolling to the bottom of the front page or any article and clicking "You are not opted out. Click here to opt out.". Accept Reject Read More
GDPR, Privacy & Cookies Policy