Skip to main content

WordPress on Google Apps 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.






Comments

Popular posts from this blog

Alternative Social Networks

If you are planning to create your  social network  e.g. similar to Facebook. Here's a short list of alternative software's: Open Source and Free​ http://buddypress.org/  - Wordpress (Open Source and Free) http://elgg.org/  - (Open Source and Free) Commercial Social Networks software http://www.socialengine.com/  ($299 Stand Alone, $29/mo Cloud) http://www.jomsocial.com/  (run with Joomla, need to know CMS) http://www.boonex.com/  (very expensive, $399 for Standard) http://www.anahitapolis.com/ http://www.oxwall.org/ http://sharetronix.com/ http://www.moosocial.com/ http://www.jcow.net/ http://phpdolphin.com http://www.grou.ps  (from free to Commercial, I left my networks and they are selling it  http://www.phpfox.com/  (I used this before, it's hard to maintain. I moved to NING but left too after it was sold to another company) http://www.ning.com  (I don't recommend using this service, it's hard to export your data when it's time to move) S

Learning Vulnerability Scanning by KING.NET

Learning Vulnerability Scanning is fun and easy. So I hope you enjoy reading this short how to guide on how to use vulnerability scanning to secure your servers and networks. NMAP is the swiss tool that you need to learn if you're serious in Cyber Security profession. The NMAP tool can be use with NSE scripting (Nmap Scripting Engine) to automate your tasks. For example using NSE Script using a  single vulnerability (cold fusion)  to scan our test lab machine. root@kali:~# nmap -v -p 80  --script http-vuln-cve2010-2861  10.11.1.220 Starting Nmap 6.47 ( http://nmap.org ) at 2016-07-22 17:34 EDT NSE: Loaded 1 scripts for scanning. NSE: Script Pre-scanning. Initiating ARP Ping Scan at 17:34 Scanning 10.11.1.220 [1 port] Completed ARP Ping Scan at 17:34, 0.04s elapsed (1 total hosts) Initiating Parallel DNS resolution of 1 host. at 17:34 Completed Parallel DNS resolution of 1 host. at 17:35, 13.01s elapsed Initiating SYN Stealth Scan at 17:35 Scanning 10.11.1.220 [1 port] Comp