WordPress on Google App Engine

app-engine

Update: this website is not hosted by Google App Engine anymore. However hopefully the instructions below may still help those who want to install WordPress on this platform.

Hello and welcome! Today I created a small experiment. A wordpress blog on Google App Engine. It actually went better than I expected, although there were several caveats that I describe below.

What is the deal with hosting the WordPress on the App Engine? Well, we all know that it is fast, scalable and has 99.95% uptime. But my thoughts are not only about that. So follow along!

How to install?

This is a technical part. But without it the post would be incomplete. And I want you to know how to actually install it.

Basically, you have an AppEngine starter project created by Google. It allows you to download a project with a ready-to-install WordPress together with some plugins helping to run the blog in the cloud.

Most often you can just follow the instructions verbatim. However on some steps you would probably take a look into the GitHub sources of the project. Because they describe some parts of installation differently. But in combination they work quite well.

Nevertheless, there still were some parts where I got stuck. And here they are.

Caveats

First of all, I got stuck at the Cloud SQL database creation step. But after some googling and common sense, here is how you set it up:

  • I think the instructions are confusing and miss to clearly separate an Authorized IP and an Instance IP. At least these are not explained properly.
  • Basically, the Authorized IP is the IP of your computer on the web (at least we can define it so for our purposes now). You specify it in the Cloud SQL settings and it will allow you to connect to the Cloud SQL from your computer (e.g. to create a database). Just google for “my ip address” and you will get it and will be able to specify it for Cloud SQL.
  • The instance IP is the IP of the actual Cloud SQL host. This is not something you specify, but instead you find it out by visiting the Google Console and choosing your instance of Cloud SQL. It will be listed there. Well, and this is the Instance IP that you want to access to create or modify the wordpress database.

The second thing that stopped me was the password for the database. It is not described anywhere in the starter project how to set it up. But apparently, you need to explicitly specify it via the Console, by selecting Access Control menu on the Cloud SQL instance dashboard.

The third thing that prevented a smooth installation of the blog was a confusion about specifying the Cloud Storage bucket. The instructions say this: “Click Application Settings on the left nav, scroll to the bottom, and click the Create button underneath Cloud Integration.”. Unfortunately, there is nothing like that in the Console. Instead, you need to choose “Cloud Storage” menu and click the “New Bucket” button.

Update: I was using the link https://console.developers.google.com to access the administration panel. This same link is provided in the wordpress integration instructions. However apparently, you can (oh my..) access one more administration console – http://appengine.google.com and there really is the “Create” button in the Cloud Integration section.

After all that you would activate the plugins provided by the starter project – “Batcache Manager” and “Google App Engine”. You do this in the admin part of your wordpress blog and it will enable you to upload the media into the cloud and also provides the caching functionality. If you see the logo of Google App Engine in the beginning of the post – then it works. If not, please let me know!

Why the trouble?

So why all this trouble about setting up the wordpress? Well, I have a small idea that I haven’t time to test yet. Basically, I want to convert the wordpress blog into the restful CMS for the mobile apps. How?

There are several plugins that will allow you to convert the WordPress into the REST API. For example Thermal API or WP-API. Enabling those plugins will allow accessing the posts, pages and other parts of the website via REST requests. This means that it can be easily used by any frontend client – native apps, web apps, other websites. Then using a library like Angular JS or Backbone JS will make it a breeze to create an app based on this API.

As with any solutions, it will come with advantages and disadvantages:

Advantages:

  • It will decouple your backend and frontend – you can use any frontend, be it an app or website
  • You reuse the power of WordPress – an easy to use CMS allowing to change the content of your apps in real time
  • You can provide the users of your apps with the real “app” look and feel, while using the WordPress in the bottom

I think that is really powerful. However, there are a few disadvantages:

  • You will probably loose the functionality of some plugins that rely on the traditional WordPress architecture. However there are some themes using Angular JS created that try to address even this issue.
  • There will be a slight learning curve for the developers since it is not yet a standard way of doing things.

As I said, I did not have time to test it yet. However a CMS for web apps that can be hosted on highly scalable Google Cloud platform definitely sounds as something I want to try. Do you?

Leave a Reply

Your email address will not be published. Required fields are marked *