-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

OPENSHIFT COOKBOOK
By :

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.
Open the login web page at https://openshift.redhat.com/app/login in your favorite web browser and log in using your OpenShift credentials.
Follow these steps to create a WordPress application using the web console:
blog
as the name of the WordPress application, as shown in the following screenshot:http://blog-{domain-name}.rhcloud.com/
. Replace {domain-name}
with your OpenShift account domain name.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.
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.
Change the font size
Change margin width
Change background colour