Book Image

OpenShift Cookbook

By : Shekhar Gulati
Book Image

OpenShift Cookbook

By: Shekhar Gulati

Overview of this book

Table of Contents (19 chapters)
OpenShift Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Running OpenShift on a Virtual Machine
Index

Creating a WordPress application using the web console


In this recipe, you will create your first OpenShift application using the web console. The web console, as mentioned in the Introduction section, is a web interface to OpenShift that developers can use to quickly create and manage applications. You will use the OpenShift WordPress quickstart in order to create a fully configured application. If you do not have a blog, now is the time to have your own personal blog for free.

Getting ready

Open the login web page at https://openshift.redhat.com/app/login in your favorite web browser and log in using your OpenShift credentials.

How to do it…

Follow these steps to create a WordPress application using the web console:

  1. Go to the applications web page at https://openshift.redhat.com/app/console/applications and click on the Create your first application now web link.

  2. Under the Instant App section, click on the WordPress 3.9 instant app. At the time of writing this book, the WordPress version is 3.9, as shown in the following screenshot:

  3. Enter a name for the blog and click on the Create Application button. I have used blog as the name of the WordPress application, as shown in the following screenshot:

  4. After the application is created, you will be directed to a page that shows the MySQL connection details. You can view the newly created application details by clicking on Continue to the application overview page.

  5. Your WordPress blog will now be running at http://blog-{domain-name}.rhcloud.com/. Replace {domain-name} with your OpenShift account domain name.

How it works…

A quickstart is a preconfigured OpenShift application that provides a repeatable way to spin up an application with its source code and dependencies such as databases. You can view the list of actively maintained quickstarts at https://www.openshift.com/quickstarts. Note that the OpenShift team does not support these quickstarts. They are just to help you get your favorite project (mostly open source) running on OpenShift. In this recipe, you used WordPress quickstart to quickly scaffold a WordPress application. You selected the WordPress 3.x quickstart in the web console and gave it a name. An application name can contain 32 alphanumeric characters at most. The WordPress quickstart uses a public Git repository, which installs the WordPress application. It also defines the cartridges it will use. The WordPress quickstart uses the PHP 5.3 and MySQL 5.1 cartridges.

To create an application, click on the Create Application button. This will create an application container for us, called a gear, and set up all the required SELinux policies and cgroups configuration. OpenShift will also set up a private Git repository using the quickstart public Git repository. It will install the MySQL database on the application gear. The quickstart source code references the MySQL database using the environment variables. You will learn about OpenShift application details in Chapter 3, Creating and Managing Applications.

Finally, OpenShift will propagate the DNS to the outside world. The application will be accessible at http://blog-{domain-name}.rhcloud.com/. Replace the {domain-name} part with your own unique OpenShift domain name, sometimes called a namespace. Open the http://blog-{domain-name}.rhcloud.com/ link in your favorite browser and set up your WordPress installation. After the setup, you will have your own WordPress blog and you can start blogging.

There's more…

In this recipe, you learned how to create a WordPress application using the OpenShift web console. You can also view the application details by going to the Applications tab and then clicking on the application, as shown in the following screenshot:

In the preceding screenshot, you can see the state of the application, that is, Started. You can restart the application by clicking on the restart button next to Started. The application uses the PHP 5.3 and MySQL 5.1 cartridges. To view the database password, you can click on the show web link. To add the phpMyAdmin 4.0 MySQL web client, click on the Add phpMyAdmin 4.0 web link. Next, click on the Add Cartridge button to add the phpMyAdmin 4.0 cartridge.

The cartridge will be available at https://blog-{domain-name}.rhcloud.com/phpmyadmin/. The phpMyAdmin credentials are the same as the database credentials.

See also

  • The Uploading SSH keys using the web console recipe

  • The Cloning the application to the local machine recipe

  • The Deploying your first change recipe