In this post I’ll go through the steps for installing phpBB in the cloud, Google’s cloud in this case. More specifically, I will show how to do it using their Google Compute Engine, which offers Infrastructure as a Service (IAAS). In this example I use the prebuilt (and free) Bitnami solution. It won’t get into advanced topics, like fine-tuning phpBB to run on the Google platform.
Creating a virtual machine on the Google Cloud
The first step is to create a virtual machine on the Google Cloud. This is your personal web server, but it is virtualized so that you have complete control over it, but it’s actually on a machine shared with many others. To create a virtual machine on the Google Cloud, you first need to have a Google Cloud account. No sweat there. Google will give new users a $300 credit to play with its infrastructure. Or you can use a micro instance at no cost. Here I show installing a micro instance of a virtual machine.
- Go to Google Cloud at https://cloud.google.com/.
- Create an account on the Google Cloud platform if you haven’t already. You might want to click on the Get started for free button if you are new to the Google cloud. If you have an account already, then click on the Console link near the top right corner of the page.
- On the blue navigation bar near the top, if you have any projects defined you will see a list of them. Regardless, open the dropdown to the left of the search field. Then select New project.
- Enter a project name in the field. I entered “My phpBB forum”. This is only for your reference and isn’t seen by the public. You probably don’t want to attach the project to an existing project since you are probably new to the Google Cloud. If so, ignore the Organization field. Then press the Create button.
- Generally it takes a minute or two to create the project. Eventually a dashboard page appears for your new project.
- Under Getting Started, select Deploy a Pre-built solution.
- In the search field, type “phpBB“. One or more pre-built solutions may appear. If you click on a prebuilt solution, it will give you the estimated cost per month to run the solution. The actual cost depends on the traffic your site gets, how much you use in the way of Google’s resources, and whether your prebuilt solution comes with a monthly charge. I suggest picking “phpBB Certified by Bitnami“. Note that Bitnami does not charge a monthly usage fee, so your costs are solely based on the resources you use. The package contents on the left shows you what is installed by the solution. The operating system should be Debian (a version of Linux) and phpBB should be the most recent version. You will get an Apache webserver, a recent version of PHP, a MySQL community edition database as well as a few other tools, most noticeably phpMyAdmin, which lets you manipulate the database directly.
- Click on the Launch on Compute Engine button. You will get a screen that lets you configure the instance of your virtual server, which will include phpBB.
- The Deployment name doesn’t matter, but should be something you will recognize
- Zone is where the server hardware is physically located. Generally pick a zone close to you or where you expect a majority of your users will be.
- Machine type directly affects cost. This can be changed later. The default micro instance is fine for getting started but probably not sufficient unless your forum is very lightly trafficked. You can choose micro, small, or a number of variations based on the number of virtual CPUs you need.
- Boot disk size defaults to 10GB for the micro instance
- Change other settings if desired, but it’s likely that the defaults are okay.
- Finally, click the Deploy button. It will take a while for your virtual server to be deployed, but it will be created with phpBB installed.
Accessing the forum
After deployment, a number of useful links are on the right sidebar. Your phpBB forum is installed, but is only accessible by an IP address, ex: http://188.8.131.52/. Click on the Visit the Site button to login to phpBB, which is in the web root folder. The username to use is probably “user” and is in the sidebar. The password is below it. Write these down. You can get into the Administration Control Panel with the same username and password.
Accessing the virtual terminal
SSH (Secure shell) access is provided, but it is rudimentary. Click on the SSH dropdown button. It will open a pop up terminal window. You can enter any Linux commands here to administer your virtual server, as well as upload or download a file using the little wheel icon at the top right corner of the window. This is a convenient way to issue commands on your virtual server for occasional use. Since you can only upload or download one file at a time, it’s not a very practical interface for daily use.
Setting up SSH remotely
To use FTP productively, you will need to access SSH more easily using a terminal application on your local machine. This video may help in setting up a SSH connection.
Using FTP with a FTP client
Once your virtual machine has a set of SSH keys, you can access SSH remotely from your machine. But also you can now use Secure FTP to transfer files. The attached screenshot shows Filezilla configured for my virtual machine instance. Notice I’ve linked it to a key file created in the last step. This assumes you set up a BitNami instance of phpBB. You will find phpBB in the /opt/bitnami/apps/phpbb/htdocs directory
You may need to directly manipulate your database. You can do this from SSH if you are Linux savvy with the mysql command.
It is generally more convenient to use phpMyAdmin, a web-based tool for accessing MySQL and MariaDB databases. It takes some configuration to use it remotely, however. This article shows how to set up remote access to phpMyAdmin using the key file you acquired in your last step. The approach requires a proxy command like this that seems to work only as long as the process remains active and will look similar to this example:
ssh -N -L 8888:127.0.0.1:80 -i google-cloud-phpbb firstname.lastname@example.org
To access it, you use the localhost IP of 127.0.0.1, essentially http://127.0.0.1:8888/phpmyadmin. To login use the credentials in your forum’s config.php file. You will have to sudo su root in the Google console to see the contents of the file.
To kill your local process, type CTRL-C.
Getting a static IP address
You start out with an ephemeral IP address that could change. If you want to attach a good ranking domain which you can find on https://www.spamzilla.io to your IP address, you should convert your ephemeral IP address into a static IP address. This document describes how to do this.
Creating nameservers and attaching your server to your domain
Next, you need to create some nameservers for your virtual server. This video documents how this is done:
Once you have nameservers defined, you go to your domain registrar and point the domain name to the nameservers created in the Google Compute Console. Then wait a few hours until the changes are broadcast to your local DNS server.
Generally at this point you want to get phpBB configured. I won’t document here how to do these steps. Some of these might be:
- Moving phpBB into a subdirectory. This is pretty easy to do with SSH access if you know Linux commands. You will need to change phpBB’s server settings, and possibly the cookie settings as well.
- Add styles
- Add extensions
- Create forums, permissions and policies. phpBB’s documentation is voluminous but will tell you what you need to know.
- Set up HTTPS. You may have to pay a bit extra for this service. See this page.
If you want to move your existing forum now to the Google Cloud platform, I can help. At this point though I don’t consider myself competent at tuning the Google Cloud for phpBB.
Basically you need to move the files and the database. Use FTP to move the files and an extract of the database. phpMyAdmin can be used to load the database in many cases. There are things that can trip up this process, such as if the PHP version is not the same between systems. I am happy to help in the process. See my rehosting page.
There is more to using the Google Cloud platform in phpBB that I may cover in future posts.