Deploy WordPress on OCI using MDS – updated version

This blog post was first published on FoggyKitchen.com.

Hello fine gourmets, for my first dish in the FoggyKitchen.com, I decide to present you how to deploy WordPress on OCI using MySQL Database Service aka MDS.

I wrote some Terraform recipes that you can find on my GitHub repository: oci-wordpress-mds.

In this first post, I will show how easy it’s to deploy directly from OCI’s dashboard using Resource Manager’s stack. I will also share the recent additions.

The first think to do is to download the stack in releases from GitHub:

When the zip file is downloaded locally, you can login in OCI’s dashboard and open the Stacks section:

You can click on Create Stack and follow the wizard:

In the next screen, you need to select ZIP file and upload the previously downloaded file from the release:

You can click next.

The next screen you will see is split in multiple sections. Let’s have a look at them:

The first one is related to the mandatory information needed to proceed. They are easy to understand:

The next section, is related to Webservers (this is something new). As you certainly know, WordPress is a PHP application running on a web server. Apache is used in this environment. This means we need to deploy a Compute Instance where the web server will run and where WordPress will be installed. We also have the possibility to deploy multiple web servers that will use the same MDS instance. If we want to deploy that option, we need to check the next box:

When checked, the box will appear like this:

You can then choose the amount of web servers (compute machines) you want to deploy and you can also specify if you want to have a dedicated schema (database) to be created (with a dedicated user too) for each web server.

This means you can deploy multiple instances of the same WordPress (and use a load balancer in front of them for example) or deploy multiple different WordPress sites. In the later, the WordPress user name and schema for MySQL will have a suffix added with the index of the instance.

This means that if you deploy 2 web servers and enable that checkbox, the following users and schema will be created with the default value above:

default values:
---------------
user: wp        schema: wordpress

deployed values:
----------------
user: wp1       schema: wordpress1
user: wp2       schema: wordpress2

You can also enable the second check box if you want to have your web servers in different Availability Domains (AD). If not, different Fault Domains (FD) will be used if possible.

The next section is related to the Shapes to be used:

Pay attention that E2 shapes have reached right now the end of orderability (see this post).

And the next new feature in this stack is the possibility to use some existing resources:

Indeed, if you deploy many different stacks and also manual resources, you might sometimes to share the same VCN or Internet Gateway, etc… you have now the possibility to perform this too:

This is maybe the most advanced section as it required you to know where to find the OCID’s you need.

You can check the video at the end of this post for more information.

After that, you can click next and Create Stack after reviewing the options.

You can now Apply the created stack and that will deploy your architecture to OCI:

This will take some time…

When everything is deployed, you will get in the log all the information:

And of course the important values required to finish the WordPress installation are also available in the output section of your job, you can also find the ssh key created for you to connect to your web servers:

Now you can use the public IP’s to finish the WordPress installation from your browser !

I hope you enjoyed this first menu and bon appétit !

In the video below, I also added how to use HTTPS with a generated certificate using Let’s Encrypt:

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

As MySQL Community Manager, I am an employee of Oracle and the views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

You can find articles I wrote on Oracle’s blog.