Ad Code

Ticker

6/recent/ticker-posts

Recent Posts

Detailed WordPress installation to Google App Engine

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.

Current issues.
  1. When it gets busy, the website(s) response time spike from an average of 1.5msecs to 8-10msecs.
  2. My current hosting provider can't see what's going on.
I will use the Quick Start WordPress for Google App Engine simple tutorial. Here's the link if you're interested or continue to read my adventure.
http://googlecloudplatform.github.io/appengine-php-wordpress-starter-project/

My own step by step procedure to complete my installation. 
I downloaded the following programs to prepare my installation.
  • Google App Engine SDK for PHP
  • MySQL Community Server
  • Python 2.7 (check the latest release at python.org website)
Steps to install.
  1. Install python and use the default installation.
  2. Install the Google App Engine SDK
  3. 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.
  4. 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.
  5. 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.
  6. In MySQL Workbench, create database wordpress_db, add this information e.g. root and db password to our wp-config.php file.
  7. 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.
  8. 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.
  9. 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.
  10. Browse to your WordPress (http://localhost:8080/) and check all if everything are working OK
  11. 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).
  12. 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.
  13. 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.
  14. 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.
  15. Activate the plugins e.g. Google App Engine for WordPress and Batcache Manager.
  16. 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.
  17. You should be able to see your website dashboard. Visit your website, and finish up using your own theme and plugins.
  18. Done. I hope this help you install your WordPress using Google App Engine.
Let me know if using Google App Engine improves the response time of your website, secure and economical to use Google for hosting. Share your thoughts.

Troubleshooting:
Issue#1
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>
    _run_file(__file__, globals())
  File "C:\Program Files (x86)\Google\google_appengine\dev_appserver.py", line 79, in _run_file
    execfile(_PATHS.script_file(script_name), globals_)
NameError: name 'execfile' is not defined
2014-11-05 10:55:59 (Process exited with code 1)
Answer:
I download python 2.7.8, installed.
In Google App Engine launcher, click Edit, Preferences. In Python Path, I have it as D:\Python27\pythonw.exe, where I installed python in my local D drive.

Issue#2
Use an application-specific password instead of your regular account password.
Answer:
Create application-specific password in your Google account security setting where you activated two-factor authentication.

Source: Whaddya.com


Post a Comment

1 Comments

  1. The one thing that can be a bit annoying is that you can not install themes and plugins right from the WP Admin while hosting on the App Engine and have to maintain a local copy of the WP website.

    Cloudways have recently integrated Google Compute Engine into our platform with an easy UI to launch a GCE instance and install WordPress and WordPress multisites.

    The advantage of GCE through our platform is that WordPress websites can be managed and customized online anything can be installed and backups are automated with many other features. here are details: Host Wordpress on Google Cloud

    ReplyDelete

Comments

Ad Code