How to Access phpMyAdmin on Google Cloud Compute on your Mac

I’ve been doing a small bit of Google Cloud Compute(GCP) configurations to run this blog. I thought I’ll start sharing some of the steps I’ve gone through which could be useful to others out there. So I’ve setup a GCP instance and configured it with a WordPress Bitnami stack. I’ve got some videos of those in this playlist if you want to follow along.

But on this post I would be discussing about accessing phpMyAdmin on GCP via an SSH Tunnel on your Mac.

In order to access phpMyadmin on a WordPress Bitnami stack from Google Cloud Compute you need to do this using an SSH tunnel. On the WordPress Bitnami stack, phpMyAdmin is blocked from the public and only accessible from the localhost. This is where SSH tunnel comes in. Basically you access the localhost on a particular port on your computer that forwards that information to the remote server on an encrypted channel and then the remote server sends the content back to the local computer.

Here is an illustration on how that access is provided via the SSH tunnel.

Another example of using SSH tunnel is when a website is blocked from your company firewall or proxy filter, you can use SSH tunnel to bypass the proxy and connect to a remote computer that has no restriction and can access the blocked website.

With that said, lets connect via SSH tunnel on your Mac.

  1. Open the terminal and change directory to where your private key is located
  2. Type in following, replace the private key name, user and IP to match yours. Enter passphrase when prompted.
    • ssh -N -L 8888: -i <keyfile> <username>@<ip>
  3. If successful it would not prompt any errors. If you want to login to the instance you can strip out the -N parameter.
    • ssh¬† -L 8888: -i <keyfile> <username>@<ip>
  4. Open your brower and enter
  5. You should be able to view phpMyAdmin


Here is a video I made for the process.


That should be it. If you have questions or comments please use the section below and feel free to subscribe to my youtube channel.

Fixing Apache after upgrading to MacOS High Sierra

If your previous Apache setup stopped working after updating to MacOS High Sierra, then this post should be useful for you. On every update of the MacOS it ships with its own version of Apache and PHP and creates a new install that overrides your configuration.

Read the rest of this entry »

How to Install Apache Ant on a Mac

Created a video for installing apache ant on Mac running on MacOS Sierra and here is the steps to follow along.

  1. Download Apache Ant to your desktop and unzip the files
  2. Rename the folder to ant
  3. Open the Terminal
  4. Move the files to /usr/local
  5. Fix the permission
  6. Edit the bash_profile with your favorite editor
  7. Add the path to the ant bin directory
  8. Save and exit your editor
  9. Test out if ant was successfully installed.


Other Notes: If you are getting an error when you run any commands:

Unable to locate tools.jar. Expected to find it in /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/tools.jar

This means you do not have the Java JDK installed. Go to and download and install the JDK.

Edit your bash_profile and update the path for the JAVA_HOME.

Subscribe to my Youtube channel for more how to video tutorials.

How to run on WordPress on a LEMP stack on Amazon EC2

At last, finally found time to move my blog on LEMP(Linux, Nginx, MySQL and PHP-FPM) stack and it just one of the many goals I have set for starting overhauling this blog and over the coming days I’ll be optimizing it further and come up with a fresh new design. I’ve been running this blog on Amazon EC2 LAMP stack on t1.micro instance. With micro instances you have limited processing power and memory. Running apache is kinda like an overkill, MySQL most often times crashes due to running out of memory and this layout design is outdated and not responsive. I’ve been focused too much on Salesforce development that I’ve completely snobbed this blog and first love which is designing, web development.

Here a short 3 part tutorial for setting up EC2, LEMP and WordPress

    Part 1 Setup EC2 instance

  • Sign up for AWS account
  • Create a new instance
  • Select Linux distro either Ubuntu 14.04 or higher (HVM preferred)
  • Select t2.micro instance and run through the wizard
  • Edit the security group and make sure you add SSH and HTTP rules
  • Then launch and download your key
  • Once launched get the public IP
  • On Mac SSH using pem key to the IP
    eg. sudo ssh -i my.pem ubuntu@
  • Part 2 Setup Nginx,MySQL and PHP-FPM

  • Once connect make sure you update your distro local package (sudo apt-get update)
  • Next install nginx
    sudo apt-get install nginx
  • Install MySQL Server
    sudo apt-get install mysql-server
  • Setup MySQL structure
    sudo mysql_install_db
  • Run secure MySQL script and follow the prompts
    sudo mysql_secure_installation
  • Install PHP
    sudo apt-get install php5-fpm php5-mysql
  • Install PHP
    sudo apt-get install php5-fpm php5-mysql
  • Secure PHP
    sudo vi /etc/php5/fpm/php.ini
    Uncomment and set to cgi.fix_pathinfo=0
  • Restart PHP
    sudo service php5-fpm restart
  • Edit nginx configuration to read PHP
    sudo vi /etc/nginx/sites-available/default
  • Add index.php to be parsed
    index index.php index.html index.htm;
  • Restart nginx
    sudo service nginx restart
  • Setup server permissions
    sudo chown -R demo:www-data /var/www/html/*
    sudo chown -R www-data /var/www/wordpress
  • Sweet! Finally you can install your wordpress.

Forbidden You don’t have permission to access /~username/directory in Mac OS X

I have this weird issue with my website backups. When I store them inside my Sites folder and try to view them from the browser.

1. They do not appear listed when I do a directory listing
2. Accessing the folder manually produces the error

You don’t have permission to access on localhost /~username/mydirectory

This is well known and documented on Apple here.

But my issue is it is only a problem for this backups, the existing directories I have in my system works fine.

The solution is not straightforward but this works.

Follow the solution from Apple website. edit your username.conf file using terminal and then add the following line before closing.

Options +FollowSymLinks

So it looks like this.

<Directory “/Users/username/Sites/”>
Options Indexes MultiViews
AllowOverride All
Order allow,deny
Allow from all
Options +FollowSymLinks

Then restart apache

service apachectl restart