Tejesh Mallikarjuna
Published at 24.01.2019
anynines recently released its a9s MySQL Data Service offering on our a9s Public PaaS. Most of the bloggers around the world use WordPress as their blogging tool.
Now, it is time for all bloggers to host WordPress on our a9s Public PaaS. Let us walk down with all the required steps to install WordPress in this blog post.
Table of Contents
We create an a9s Data Service instance to connect the WordPress application with a MySQL server.
Let us consider an audience with no technical knowledge and also, most of the WordPress users have no technical background and come without any prior knowledge of Cloud Foundry. Come on, let’s deploy a WordPress application smartly on a9s Public PaaS with few steps and experience the magic practically.
Before going ahead to further steps, we would like to assume all the audience have knowledge about command line terminal of any Operating System.
To use our a9s Public PaaS to host a WordPress application, you need the following prerequisites:
After user creation, run cf login. Please enter your credentials, select your organization name and space name.
Code Example
1
$ cf login https://api.de.a9s.eu
Now, we can view all the services available at anynines CF marketplace.
a9s MySQL offers various service plans.
After login, run cf marketplace
.
Code Example
1$ cf marketplace -s a9s-mysql101
2
3Getting service plan information for service a9s-mysql101 as your_username...
4OK
service plan
description
free or paid
mysql-cluster-medium
a medium replica set
paid
mysql-cluster-small
a small replica set
paid
mysql-single-medium
a medium single instance
paid
mysql-single-small
a small single instance
free
From the above list, we can choose the required service plan for deploying WordPress. mysql-single-small
plan is more than sufficient to deploy WordPress and it is free!
For any custom requirements and queries, please feel free to contact our support.
To provision a MySQL database, run cf create-service
.
Code Example
1$ cf create-service a9s-mysql101 mysql-single-small my-mysql-service
Depending on your infrastructure and service broker utilization, it may take several minutes to create the service instance.
Run cf services to view the creation status. This command displays a list of all your service instances. To view the status of a specific service instance, run
Code Example
1$ cf service NAME-OF-YOUR-SERVICE
Or
Code Example
1$ cf services
After your database is created, we have to follow the below three steps to complete the deployment process:
Download the latest WordPress source code.
Code Example
1$ curl -L -o wordpress-latest.zip https://wordpress.org/latest.zip
Now, extract them and remove zip file:
Code Example
1$ unzip wordpress-latest.zip && rm wordpress-latest.zip
Let us modify the required configuration before pushing the application into our a9s Public PaaS.
Create manifest.yml
file by using any text editor with the below contents inside WordPress directory.
Please edit with your desired application name and route sections shown below. Also, edit services section with the above-created service name.
Code Example
1applications:
2- name: <your_app_name>
3 memory: 128M
4 path: .
5 route: .de.a9sapp.eu
6 buildpack: php_buildpack
7 services:
8 - <your_mysql_instance_name>
Now, copy the sample configuration file.
Code Example
1$ cp wordpress/wp-config-sample.php wordpress/wp-config.php
Now edit wordpress/wp-config.php, replace the database configuration lines with the following:
Code Example
1// ** Read MySQL service properties from _ENV['VCAP_SERVICES']
2$services = json_decode($_ENV['VCAP_SERVICES'], true);
3$service = $services['a9s-mysql101'][0]; // pick the first MySQL service</em>
4
5// ** MySQL settings - You can get this info from your web host ** //
/**
6The name of the database for WordPress */
7define('DB_NAME', $service['credentials']['name']);
8
9/** MySQL database username */
10define('DB_USER', $service['credentials']['username']);
11
12/** MySQL database password */
13define('DB_PASSWORD', $service['credentials']['password']);
14
15/** MySQL hostname */
16define('DB_HOST', $service['credentials']['hostname'] . ':' . $service['credentials']['port']);
17
18/** Database Charset to use in creating database tables. */
19define('DB_CHARSET', 'utf8');
20
21/** The Database Collate type. Don't change this if in doubt. */
22define('DB_COLLATE', '');
Configure the remainder of wp-config.php
as you normally would for a new WordPress site.
Before adding extension files, let us create directories inside WordPress directory.
Code Example
1$ mkdir -p .bp-config/php/php.ini.d
Now, create extensions file .bp-config/php/php.ini.d/wp-extensions.ini
by using any text editor with the below contents:
Code Example
1extension=mbstring.so
2extension=mysqli.so
3extension=gd.so
4extension=zip.so
5extension=openssl.so
6extension=sockets.so
Also, create the file .bp-config/options.json
and add the following contents:
Code Example
1{
2"WEBDIR": "wordpress",
3"PHP_VERSION": "{PHP_71_LATEST}"
4}
You can also use other PHP versions like replacing PHP_VERSION
value with PHP_70_LATEST
for PHP 7.0 and so on.
Let us start the application by pushing the application into a9s Public PaaS by using cf push
Code Example
1$ cf push
Now, verify the application by using cf app
:
Code Example
1$ cf app
2
3Showing health and status for app wordpress in org your_org_name / space your_space_name as ...
4
5name: <your_app_name>
6requested state: started
7instances: 1/1
8usage: 128M x 1 instances
9routes: .de.a9sapp.eu
10last uploaded: Tue 30 Oct 11:18:26 CET 2018
11stack: cflinuxfs2
12buildpack: php_buildpack
13
14state since cpu memory disk details
15#0 running 2018-10-30T10:19:11Z 0.2% 96.5M of 128M 234.8M of 512M
Visit http://<your_app_name>.de.a9sapp.eu to set up your WordPress application.
WordPress application deployment can be done with only a few steps on our a9s Public PaaS. This is going to save a lot of time in deployment and configuring your WordPress web server all by yourself.
I hope you are all able to set up WordPress with the above step by step tutorial. Also, please note that Cloud Foundry uploads all of your plugin code inside containers and if you scale your applications or do restage your application, then you have to place plugin code in local source code to get the desired state.
© anynines GmbH 2025
Products & Services
© anynines GmbH 2025