5 Great Pantheon Hosting Secrets for Developers [WordPress]
At Primitive Spark, we recommend Pantheon web hosting to all our WordPress clients — and we use it ourselves! Why? For starters, Pantheon is one of the best Managed Hosting providers for WordPress when it comes to price and performance (UPDATE: Pantheon asked us to refer to their service as Elastic Hosting – which we’ll happily oblige, since it’s definitely a smarter, more elegant take on traditional Managed Hosting). While there is no shortage of web hosting services that offer great performance, Pantheon’s novel approach to administration and deployment is what really impresses us. If you’re a developer or IT aficionado, read on for the nitty gritty. If you’re not a developer, pass this post along to someone who is. They’ll thank you for it, we promise.
For developers, what sets Pantheon apart from the rest is its Git-powered three environment workflow. Here’s how it works:
- Start by pushing a Git revision to the dev environment.
- If things look good in dev, you’re ready to experience the magic of Pantheon’s excellent web-based dashboard. With the press of a single button, Pantheon pushes the latest Git version up from dev to test while simultaneously pulling down the latest content changes from live to test. Now, in the test environment, you can review the effects of your code changes on up-to-date content.
- Once you’re satisfied with how things look in test, simply press one more button to push to live, and you’re done!
Pantheon’s distinctive approach to managed hosting makes following development best practices a snap. That said, we found solutions to a few Pantheon quirks that could trip you up and cost you unnecessary time. We figured it out so you don’t have to. So, in the spirit of giving back to the online community, here are 5 things developers should know about Pantheon:
1. Where the heck is the Uploads Folder?
The majority of WordPress files are read-only. One of the finer details of Pantheon’s approach is that it separates read-only files from read/write files. Keeping them separate allows Pantheon to efficiently scale WordPress, making it a truly elastic hosting service. However, grouping read/write files separately has one side effect — it can make the uploads/ folder tricky to find.
If you do a Git pull/clone to your local machine, the uploads/ folder vanishes. That’s because the uploads/ folder is a read/write folder. Pantheon places this folder outside the WordPress root directory in a folder called files/. Since WordPress requires the uploads/ folder to be present and writable, Pantheon put a symlink uploads/ folder where you’d expect the real uploads/ folder to be (you can tell it’s a symlink because there’s a little arrow in the corner of the folder). This symlink folder links to the real uploads/ folder, which is located outside the WordPress file structure. Git doesn’t typically recognize symlinks, so it skips the uploads/ folder when pulling down all the files within the WordPress file structure. To get these files to your local Git repository, you’ll have to connect via SFTP and download the files/ folder, which contains everything that the uploads/ folder would normally contain. Keep in mind any changes made to the local uploads/ folder will NOT be pushed back up to Pantheon via Git. You’ll have to use SFTP to add files to the files/ folder manually.
2. Server Timeouts
Imagine a scenario where you’re trying to access the MySQL server on your Pantheon site’s dev environment, and it’s not responding. This can happen for a number of reasons, but one explanation could be that Pantheon has spun down the entire environment due to inactivity. Pantheon’s Required Reading documentation states that containers for live sites will be spun down after roughly 12 hours of inactivity, and about 1 hour for everything else.
Luckily, a solution exists to keep your site’s dev environment from becoming inactive. Free services like uptimemonitor.com and followthatpage.com can be setup to hit a given environment with a ping every few minutes to maintain regular activity.
While this may not be an ideal long-term solution, it will work in a pinch. Put simply, you can wake any environment by simply navigating to it from a browser. In the future, we hope Pantheon will incorporate a sleep/awake state monitor like the one from Heroku (pictured above). Until then, you now have a simple workaround to troubleshoot server timeouts.
3. Free Automatic Daily Backups
Automatic daily and weekly backups are included in all Pantheon packages. However, automatic backups are not enabled by default. Our advice? Enable them, now. Go on. We’ll wait….
Why are we so adamant? Imagine you’ve made significant changes to your WordPress site’s source code or content, and a week later you realize that one of your pages is completely broken. In that situation, reverting back to a previous version may be the simplest solution, but you won’t have that option unless you enable automatic updates before disaster strikes. So save yourself some time and heartache in the future and schedule updates automatically now – it takes mere seconds and costs nothing.
After migrating several WordPress sites to Pantheon, the majority of those sites saw a slight increase in SEO rankings, but one saw a slight decrease. The site that saw an decrease in rankings was using a plugin called Google Sitemap by BestWebSoft. When paired with Pantheon, this plugin was unable to save its own changes because the uploads/ folder lives outside Pantheon’s read-only architecture. There was no clear solution to the problem, but some sleuthing on Pantheon’s website uncovered two explicit references to a different plugin called Google XML Sitemaps. After giving it a try, it turns out the Google XML Sitemaps plugin works seamlessly within Pantheon’s framework. Et voilà — SEO rebound!
5. Git Mode Errors
Whenever we tried to download a plugin through the site’s WordPress admin UI, we’d get a message we’d never seen before asking for FTP credentials.
If you’re running into this problem, it’s likely that your site is currently in Git mode in Pantheon. This means Pantheon is expecting any new code changes to come via a Git commit, which is not how the WordPress Add New Plugin button works. Here are a two ways to solve this problem:
- Download the code for the plugin to your local machine, unzip it, and put it in the plugins folder of your local dev repo. Push it to the dev site, commit the changes, and push it up to live. Then, use the admin UI on the plugins page to enable the plugin.
- Switch your dev site to SFTP mode from the Pantheon Dashboard. Then, go back to the plugin download UI and add it straight from WordPress. Commit the changes on Pantheon, and ta-da! Just don’t forget to switch back to Git mode when you’re done. Finally, push your code changes up the dev-test-live chain. Once you enable it, you’re plugged in and ready to go!
Now that you know some of the ins and outs of Pantheon, we hope your experience will be smooth and easy. Despite a few peculiarities, we think Pantheon is a fantastic service. We’ll be keeping an eye out for any other quirks, and will report back if and when we find them.