I am moving my website(s) from VPS Server to Google App Engine (Google Cloud). It's too early to list the benefits of using Google Cloud while still building my infrastructure and making it work the way it suppose to.
A little background of the existing hosting environment.
I'm using a dedicated VPS Server with Solid State and 6.5GB Memory to host a multisites using WordPress for Content Management Systems (CMS).
The VPS Server is only hosting the WordPress files e.g. CMS core files, themes, plugins, etc.
I am using Amazon RDS for database so I don't have to worry about managing database server.
And I'm using Amazon CloudFront for images storage.
- When it gets busy, the website(s) response time spike from an average of 1.5msecs to 8-10msecs.
- My current hosting provider can't see what's going on.
- Google App Engine SDK for PHP
- MySQL Community Server
- Python 2.7 (check the latest release at python.org website)
- Install python and use the default installation.
- Install the Google App Engine SDK
- Install MySQL Community Server. Use the windows installer to simplify the installation of MySQL. Select the "Developer Default" to continue the install. If the supporting requirements are not installed, select "put check on it", then click Execute. Repeat the process till you complete all requirements for MySQL.
- Sign up for Google Cloud Platform, and setup Cloud SQL instance named it as "wordpress" to match the config file. Assign IP Address, and add your home/work IP Address to the list of Authorized IP Address so you can connect to you Cloud SQL instance.
- Edit app.yaml and wp-config.php replacing any instance of your project-id to match the Project ID you entered in the Cloud Console when you signed up for a Google Cloud Platform project.
- In MySQL Workbench, create database wordpress_db, add this information e.g. root and db password to our wp-config.php file.
- To launch WordPress locally on Windows, you can use the Google App Engine launcher by going to File > Add Existing Application. In Application Path, browse to the location of your wp-appengine folder. For my setup, I have my wp-appengine folder in d:\wp-appengine. Click on Add to continue.
- Click Run. Now, with App Engine running locally visit http://localhost:8080/wp-admin/install in your browser and run the setup process. If you're having issue, check the troubleshooting issues below.
- Continue the wordpress setup, e.g. Site Title, Username, Password, Email Address, etc. Click Install WordPress. Wait to complete the setup, you will see SUCCESS.
- Browse to your WordPress (http://localhost:8080/) and check all if everything are working OK
- Update your WordPress, Plugins and Themes. If all looks good, you can upload your application, select the project and click Deploy (or by using this command $ appcfg.py update APPLICATION_DIRECTORY).
- If all looks good, upload your application using Google App Engine launcher. Click Deploy, it will prompt you to enter your Google email address and password, check the Project name just to make sure. Click OK to continue.
- Just like you had to do with the local database, you will need to setup the Cloud SQL instance. Start MySQL client to connect to Cloud SQL using assigned static IP, root, and password. If you haven't update the password, go to Control Access to update the root password.
- You need to run the install script again for the live site, replace the <PROJECT_ID> with your project ID. visit http://<PROJECT_ID>.appspot.com/wp-admin/install.php to complete the setup.
- Activate the plugins e.g. Google App Engine for WordPress and Batcache Manager.
- In Google App Engine for WordPress, go to Settings to check the default bucket name using your project id .e.g <PROJECT_ID.appspots.com. Click Save to finish.
- You should be able to see your website dashboard. Visit your website, and finish up using your own theme and plugins.
- Done. I hope this help you install your WordPress using Google App Engine.
When I first click Run, it does not work. I checked the logs and got this information.
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\dev_appserver.py", line 83, in <module>
File "C:\Program Files (x86)\Google\google_appengine\dev_appserver.py", line 79, in _run_file
NameError: name 'execfile' is not defined
2014-11-05 10:55:59 (Process exited with code 1)