Install Apache, PHP, MySQL on Google Compute Engine

I am so happy to get access for Google Compute Engine Limited Preview ๐Ÿ™‚

Google Compute is a service that provides virtual machines on Google infrastructure. Google Compute (virtual machines with distributed computing power) provides some options that enable to configure, deploy, and manage multiple virtual machines in multiple data centers.

– Command-line tool called gcutil
– SSH Keys

Instructions on Installing and using gcutil; the command-line tool that is used to manage your Google Compute resources.

Run virtual machines at Google Scale

Google Compute Engine offers scalable and flexible virtual machine in the cloud to solve large scale processing and analytic problems on Googleโ€™s computing, storage, and networking infrastructure.

Google Compute Engine
Google Compute Engine

You need to generate your keys using ssh-keygen.. check more details here

Google Compute Engine - Add ssh Keys
Google Compute Engine – Add ssh Keys

You SSH Keys looks something like ….

ssh-rsa DfgdfeDFDFdghGHg ……………………..

Then you can login to server using Google Compute Engine’s external IP and PPK (Private key for authentication) file..


If all goes well you will get nice screen ๐Ÿ˜‰

SSH Google Compute Engine using SSH Keys
SSH Google Compute Engine using SSH Keys

This is typical Ubuntu server and you can easily install Apache, PHP, MySQL here

First I tried “Hello World” Application provided in instructions

Before installing Apache you need to add port 80 to firewall ๐Ÿ˜‰

$ gcutil addfirewall http2 –description=”Incoming http allowed.” –allowed=”tcp:http”
INFO: Waiting for asynchronous operation to complete. Current status: RUNNING. Sleeping for 5s.

$ gcutil getfirewall http2

Install Apache HTTP Server

$ sudo apt-get update

$ sudo apt-get install apache2

Install PHP & MySQL

$ sudo apt-get install apache2 mysql-server php5 php-pear php5-suhosin php5-mysql

$ sudo apt-get install php5 libapache2-mod-php5

Restart Apache

$ sudo /etc/init.d/apache2 restart

Install PHPMyAdmin

$ sudo apt-get install phpmyadmin

Follow steps for phpmyadmin ๐Ÿ˜‰

Set mysql root password

$ mysql -u root

mysql> SET PASSWORD FOR ‘root’@’localhost’ = PASSWORD(‘yourpassword’);

Your Apache, PHP, MYSQL and phpMyAdmin is ready in Ubuntu on Google Compute Engine, start clouding….