Bikoo chose to run WordPress on Pagoda Box, a powerful, inexpensive and flexible PaaS system.
In preparation for the launch of our first book, Demon Hunters: Desires of the Flesh, Bikoo began developing a website to support the launch and give some insight into our work. Choosing a CMS was straightforward. WordPress is powerful, easy to develop and highly extensible. We are not a software development house, so we chose something that matched our skills while having enough flexibility to hit the design mockup.
Deciding on the infrastructure for the website was more difficult. At first, we were leaning towards running the site on a self managed AWS cloud infrastructure. The benefits are scalability and precise control. The drawbacks are managing the complexity of the site and over paying until we reach start hitting the limits of a micro instance.
During our search, we ran across a great article about Pagoda Box on Techcrunch.
A few nicely written articles about spinning up WordPress sites sealed the deal. Pagoda Box is an incredibly powerful service provider that combines the flexibility of AWS with straightforward management tools.
The following is how Bikoo set up our Pagoda Box development environment:
Local Instance
A simplified version of the WordPress guide for setting up a local instance on macs:
MAMP
PHPMYADMIN
WORDPRESS
database name: wordpress
database host/server: localhost
database user: root
database password: root
Git
Develop!
Now that WordPress is running locally and git is set, we can start developing. Bikoo chose to use BootstrapWP as our base theme. BootstrapWP is an implementation of Twitter Boostrap designed for theme builders. It makes the process of creating a custom theme incredibly fast and is built to be responsive.
Our Tools
Eclipse IDE for web development
WPML for Multilanguage support
Sociable for Social links
Akismet to anti-spam comments
Sequel Pro
LESS
Use whatever works best for you. Once you’re comfortable with the sites performance locally, it’s time to cloudify it and send it off to Pagoda Box.
Remote Instance
Pagoda Box
web1: #component type & number
name: wp #component settings
shared_writable_dirs:
- wp-content/upload
sDatabase
If you navigate to your newly deployed site, there will be a connection error. Pagoda Box has not yet been configured with a Database.
Setting Up Environment Variables
There are two ways to connect to the Pagoda Box database, either by hard coding the credentials or using environment variables. Environment variables are more secure, and if you plan on hosting the repository publically on GitHub, it is the only way to go.
define('DB_NAME', 'yourdbname');
define('DB_USER', 'yourdbuser');
define('DB_PASSWORD', 'yourdbpass');
define('DB_HOST', 'localhost');
if (isset($_SERVER['PLATFORM']) && $_SERVER['PLATFORM'] == ‘PAGODABOX’) {Pagoda Terminal
By using the Git push, we can now publish updates to the site code, but we still need to create a way to migrate databases and push content updates. Pagoda Box requires a tunnel to be setup to connect to writable directories and the database. The Pagoda Terminal client helps us create the setup for the tunnel.
sudo gem install pagoda
pagoda --app=yourAppName --username=yourUsername --password=yourPassword tunnel --component=db1
The tunnel is now open and you can connect via ssh or sftp.
Database Migration
Sequel Pro is a free and easy to use MySQL connection tool.
Name: local
Host: 127.0.0.1
Username: root
Password: root
Database: wordpress
Port: 8889
Name: Call it something
Host: 127.0.0.1
Username: Under DB Credentials
Password: Under DB Credentials
Database: wordpress
Port: 3306 (Confirm on the credentials page)
We can now connect to our Pagoda Box hosted site!
DNS Override
When developing locally, we want to maintain the site-url and home values as well as permalinks in WordPress. That means we need to setup a DNS override to point bikoo.jp (Or whatever your site name is) to the localhost.
sudo nano /etc/hosts
HOSTNAME IP address
bikoo.jp 127.0.0.1
bikoo.jp will now route to the local Apache server. When we make changes to the local database, they will all be entered with the bikoo.jp hostname, so we can easily migrate the database to production.
Regular Development Workflow
It is a lot of steps, but once we got passed the original setup, the development process has been a cinch. That coupled with easy management and headache free migrations makes Pagoda Box one of the most exciting services we have seen in a while.
The best part: Pagoda Box’s free tier is powerful enough to run our website and it’s FREE.
If this article has been useful, check out our first release, Demon Hunters: Desires of the Flesh – Baku Yumemakura’s sex-filled, brutally violent Sci-fi fantasy opus.