Posted by: Michelle Greenlee
Cloud Services, Open Source, SaaS, Website Development, Website Hosting
Making a leap to the cloud can be a small hop if you start with a simple personal project. I’ve been curious about Red Hat’s OpenShift for a while so I decided to find out if I could set up a WordPress site on the service. I attempted the task without reading through lengthy documentation and relying on the short step by step wizard given after sign up. I decided to go ahead with the test despite my lack of experience with Git repositories. Why let a little learning get in the way? I soon found myself deep in documentation and forum posts after a misstep with a WordPress plugin. I aim to save you a lot of time with this post.
You Will Need:
- Red Hat or OpenShift Account
- IDE with Git support (I used CodeEnvy)
- Access to advanced DNS settings for your domain
- CloudFlare Account (optional)
OpenShift offers a free tier for its Platform as a Service. We’ll be working with OpenShift Online today.
The free plan allows three resource-constrained containers, called Gears. Each Gear offers a set amount of RAM and disk space. Software stacks called Cartridges can be added to each Gear. The free plan allows three small Gears. Small Gears offer 512MB of memory and 1GB of space each.
WordPress Updates on OpenShift
Before we dive into the set up process, you should be aware WordPress code is not maintained by OpenShift. Unlike traditional hosting, updates and Security are your responsibility. There’s also an issue cloning a WordPress repository on OpenShift. Cloning excludes the wp-content directory where themes and plugins are stored. Working from a local repository then pushing to OpenShift can wipe out all data in the remote repository. You must sync repositories to avoid erasing your site. If all of this sounds unappealing, you may want to stop here and have a look at WPEngine for your site. I set up a test site months ago and haven’t had to do anything to update or secure it.
Setting Up Your First OpenShift Application
We will be adding PHP, MySQL, and PHP MyAdmin for our WordPress application today. Creating a WordPress site is incredibly easy since there’s already a quick start version available. Choose WordPress from the Instant App category.
The configuration step is pretty straightforward. You’ll notice the WordPress app is not scaled by default. You can enable scaling in this step if you like. If you enable scaling in this step you will not be able to add PHP MyAdmin later. PHP MyAdmin is a shared resource that cannot be scaled with your application.
Once you’ve updated your application settings you’ll be presented with Git login instructions. Save these then test them. I used CodeEnvy. Cloning is the only option available for OpenShift repositories on CodeEnvy so I cloned my new WordPress application. If you can connect to your repository you’re good to move on to the next step, adding PHP MyAdmin to your new App.
I recommend adding PHP MyAdmin just in case you need a graphical user interface to review or update your WordPress database. Since beginning this journey to OpenShift I have learned I like having a GUI for my databases.
Most cartridges have dependencies. PHP MyAdmin requires PHP and MySQL, both were installed with the WordPress Instant App. From your application dashboard you’ll see a handy Add Cartridge button.
The resulting page will display all available cartridges for your App. Choose PHP MyAdmin from the list. Be sure to save the login information given once the installation is complete.
You’re not quite ready to add content to your WordPress site. We’ll explore this in Part 2 of this series on OpenShift.