Restarting a Discourse Container

We have a server that runs a kind of multisite Discourse environment that I discussed a number of years ago in this post. It is an Ubuntu server with Docker installed, and each of the Discourse instances on that server are spun up in Docker containers. It’s a very small, experimental part of what we do. In fact, we discontinued offering Discourse and Ghost in this kind of environment  a while back, and are far more interested in options like Cloudron, which makes hosting Ghost a breeze. That said, we have a couple of Discourse instances we still host and today the biggest one went down, which is always a bit of a scare for me given it is a unique environment. So, this post is simply going to retrace my steps in terminal to fix this because I always forget given it is not something I do often enough.

When I learned the server was down I figured I would try stopping and restarting the Container to see if that works. To do that I needed to go to var/discourse:

cd /var/discourse

From there, I tried to stop the container (to find the container name I looked in the /var/discourse/containers/ directory which has all the YAML files for each install, and the container names are everything before the .yml extension.

./launcher stop containername

That will stop the container and the following will restart it:

./launcher start containername

But when I went to stop the container I got the a storage full error, and when I ran a

df -h

on the server it was confirmed, the disk was full. I then proceeded to run the trusty NCDU command to get a sense of what was taking up all the space, and I have a suspicion it might be related to this overlay2 storage space issue others have complained about with Docker, but I took the easy route and deleted 10 GBs of old backups for the site and it was immediately back up and running. In the end a restart was not necessary, and I was able to solve a fairly random issue fairly quickly. 

Whoowns or Whoowens?

One of the cPanel scripts I’ve found really useful as of late is the whoowns script that let’s you know which account owns a specific domain. Let me provide a quick scenario.  You have an issue with a domain and you can’t figure out which account in lives in, which could mean it’s an addon domain that wasn’t registered through us, etc. Tracking it down can be a pain. You can figure out what server it is on by using a command like nslookup (nameserver lookeup) that will tell you the hostname and identify the server:

nslookup themissingdomain.tld

The above command will return something like beathap.reclaimhosting.com.  Which means the account is on the Beathap server, but given it is not the primary domain of an account it is not going to appear in the list of all cPanel account. And this is where I would get stuck.

But using whoowns will tell you the account owner, just log in via terminal and use the following command:

/scripts/whoowns themissingdomain.tld
themissi

That will tell you the account that domain lives in which means problem solved. A simple, useful script.

So, when extolling its virtues in Slack I wrote /scripts/whoowens —and soon after Tim had some fun and wrote his own script. So, when you run /script/whoowens on any of Reclaim’s servers you get the following:

That’s geeky and it’s awesome. Hosting humor #4life.

Sequel Pro’s SQL Inserts

Another tool I’ve  been becoming more familiar with for sites that don’t have phpMyAdmin to access the MySQL databases is Sequel Pro. It’s an open source application for managing SQL databases on the Mac.  I have come to appreciate it in newfound ways after the UNLV migration; it is to databases management what Transmit has been to moving around files via FTP.  Anyway, one think I discovered it can do is copy the structure of a database table, such as wp_users:

And then insert it as SQL code in something like PHPMyAdmin:

Sequel Pro does all SQL query structuring for me, which is awesome. Was a nice little bonus to discover, and another trick for the toolbox.

 

Digital Ocean’s One-Click Apps vs. Cloudron

Digital Ocean has been en fuego as of late. They announced a whole bunch of new droplet plans, and the price-point for all of them has gone down. This is very good news for Reclaim Hosting because it gives us some breathing room with our infrastructure costs allowing us to continue to keep costs low.  We have been slowly moving most of our infrastructure from Linode and ReliableSite to Digital Ocean, and we could not be happier. They are constantly improving their offerings, and being in a virtual environment where we can increase storage or scale CPU instantaneously makes our life (and our clients’) a lot easier.
One-click Apps at Digital Ocean

One-click Apps at Digital Ocean

In addition to new plans and pricing, I noticed they were featuring one-click apps as well (though not sure how new this is), and I took a peak to see what they offered. It was interesting to see that some of the application they featured, namely Discourse (the forum software) and Ghost (the blogging app), were apps Reclaim was offering beyond our shared hosting cPanel-based LAMP stack. Given we’ve been exploring a one-click option with Cloudron (I recently blogged about setting up Ghost using Cloudron) I wanted to compare Digital Ocean’s idea of one-click to Cloudron’s. Long story short, there is no comparison. Here is Digital Ocean’s command line interface for setting up Ghost:

Command line interface during Ghost setup on Digital Ocean’s one-click apps

Here is Cloudron’s:

One-click install of Ghost on Cloudron

Digital Ocean is amazing at what they do, but their idea of one-click installs still assumes a sysadmin level of knowledge, which, to be fair, make sense given they are a service designed for sysadmins. When I tried the Ghost app it was, indeed, installed on a droplet in seconds, but the actual configuration to setup required full-blown tutorial for command line editing the setup. In addition to the domain pointing, this was setting up SSL and Nginx, granted that simply meant typing “yes” or “no” and clicking enter, but even when you did the setup was not guaranteed. After following the tutorial to the letter I still got the Nginx 502 bad gateway error, which means I was stuck.

Ghost 502 Bad Gateway Nginx Error

I could have tried to troubleshoot the 502 error, but at this point it was just a test and from my experience it was far from one-click.

Discourse example

I then tried the Discourse, and this was definitely easier than Ghost. It still required a tutorial, but that was primarily focused on setting up an SMTP account through Mailgun so the application could send email. After that, the setup was simple, but again the one-click setup process on Digital Ocean assumes an understanding of API-driven transactional email services like Mailgun or Sparkpost. Cloudron does not have a Discourse installer, so no real comparison there, but if it could manage the SMTP email setup in the background, I imagine it would be just as simple as their Ghost installer. I’m glad I explored Digital Ocean’s one-click application offerings because it confirms for me the potential power of tools like Cloudron that truly make it simple to install applications. Our community by and large will not be folks with sysadmin level knowledge, so integrating a solution that is truly one-click, avoiding DNS and command line editing,  would be essential.

NCDU-fu

Sometimes it feels to have some meager sysadmin competencies, such as knowing how to quickly identity where large files are in a particular hosting account. This issue comes up from time-to-time when someone discovers all their storage space has been eaten up, but they are not sure where and why.  Often this is a symptom of a larger problem, such as an error_log run out of control which suggests bad process for a particular application, etc. That was the case on a ticket this morning, and luckily I knew the NCDU command. What is NCDU, you ask?

Ncdu is a disk usage analyzer with an ncurses interface. It is designed to find space hogs on a remote server where you don’t have an entire graphical setup available, but it is a useful tool even on regular desktop systems. Ncdu aims to be fast, simple and easy to use, and should be able to run in any minimal POSIX-like environment with ncurses installed.

In other words, a script for a remote server that finds big files. You can install it on your server, and then run it by navigating in command line to the offending account, which on our cPanel servers would live at /home/offendingaccount and running the command NCDU. After that, it will list all the directories and their sizes, followed by files.  You can then locate the directory with the largest file usage, and then change to that directory and run NCDU again until you find the offending file. In the example this morning, it was a 6 GB error_log in a directory running WordPress, easy fix to clean out space, and a good heads up things in that account need to be checked for a bad plugins, theme, etc.

The life of a Reclaimer is always intense

Set UMW Blogs Right to Ludicrous Speed

UMW Blogs was feeling its age this Spring (it officially turned ten this month—crazy!) and we got a few reports from the folks at DTLT that performance was increasingly becoming an issue. Since 2014 the site had been hosted on AWS (Tim wrote-up the details of that move here) with a distributed setup storing uploads on S3, the databases on RDS, and running core files through an EC2 instance. That was a huge jump for us back then into the Cloud, and the performance jump was significant. AWS has proven quite stable over the last two years, but it’s never been cheap—running UMW Blogs back then cost $500+ a month, and I’m sure the prices haven’t dropped significantly since.

Continue reading “Set UMW Blogs Right to Ludicrous Speed”

A WHMCS Invalid Token Error and the glory of blogging

I woke up this morning to find that our WHMCS portal for Reclaim Hosting was having some issues. WHMCS is software that enables you to manage the business of cPanel, effectively provisioning, invoicing, billing, renewing, etc. without it people can’t sign-up for new accounts, pay their bill, or access their client area. They can still access their sites through theirdomain.com/cpanel, but they would need to use their SFTP credentials to login their, so it would get bad quick support wise. So, when I discovered the 503 Service Unavailable error I knew I needed to fix this immediately. It happened at both a good and bad time. Good because it was late night in North America, so the demand was not peak. bad because my Reclaim partner Tim Owens was fast asleep ? But, in fact, that might have also been good because I tend to lean on him for this stuff given I’m afraid to mess shit up.

Continue reading “A WHMCS Invalid Token Error and the glory of blogging”

Changing Storage Quota for cPanel Accounts

This is a quick and easy tutorial for changing storage space quotas on specific cPanel accounts, perfect for a rainy Sunday morning. I often get this question from someone managing a Domain of One’s Own initiative that needs to modify an account to allow for more storage space.

This process is done in WHM, which is basically the GUI interface for managing all the accounts on cPanel. Once logged in you do a quick find using the word “list” (no quotes) in the left upper hand corner. Then click “List Accounts” which will allow you to search for the account you need. You can search by the username or domain as demonstrated below.
Continue reading “Changing Storage Quota for cPanel Accounts”

“Anything is Possible in Linux”

I was doing a major migration of various sites for Gary Stanton, a Historic Preservation professor I worked with on and off for a decade at the University of Mary Washington. About the same time I was leaving he was retiring, and we had worked together on a ton of WordPress sites. He is a folklorist by training, and he has an unbelievably eclectic interests in all sorts of awesome vernacular American culture. When he creates class sites, they usually weigh-in by the gigabyte given how many audio files, images, and documents he shares with his students. He’s been building sites like that for years, and when he asked if he could move his stuff to Reclaim Hosting after retirement I jumped at the chance. He has so much cool stuff to share, he’s one of those folks that makes the web a better pace by populating it with his closet of curiosities. And to think Reclaim can help make sure it’s online and stays around for the long haul is an honor and a privilege. Continue reading "“Anything is Possible in Linux”"

Installing and Customizing a Scalable WordPress Multisite with Linode’s StackScripts

I’ve been on a server admin crash course over the last 8 months or so, and I’ve been thoroughly enjoying myself. I have been fortunate to have the most patient and generous teacher I’ve ever studied under: the great Tim Owens. I truly have a deep respect for how much he has taught himself over the last 4 years, and trying to catch up with him gives me an even deeper appreciation of his mad skills. One of the turning points for Reclaim Hosting this semester has been taking on large-scale WordPress Multisite instances for institutions. We jumped in with both feet when we took over the hosting of VCU’s Ram Pages—a beast I have written about recently. Tim did a brilliant job scaling this extremely resource intensive WordPress Multisite, and I was eager to try my hand at the setup. Luckily Reclaim has no shortage of opportunities, and recently the University of North Carolina, Asheville was interested in experimenting with a pilot of WordPress Multisite, so I got my chance to work through the setup with a brand new install. Continue reading "Installing and Customizing a Scalable WordPress Multisite with Linode’s StackScripts"