Quantcast
Channel: git – Platform as a Service Magazine
Viewing all articles
Browse latest Browse all 24

Host and Share Your Photos on OpenShift With Gallery 3

$
0
0

In this blog post I will detail how to get the popular open source photo sharing application, Gallery 3, installed and configured using the OpenShift Online platform as a service. At the time of this writing, the most recent version of Gallery 3 is version 3.0.9.

Gallery 3 is an intuitive application, written in PHP, that provides the ability to share and view photos, videos, and audio using your own website. This is a popular choice for people who want to keep their media in a more controlled environment outside of the plethora of social media options available today.

Step 1: Create an OpenShift Account

If you don’t already have an OpenShift account, head on over to the website and signup. It is completely free and Red Hat gives every user three free Gears on which to run your applications. At the time of this writing, the combined resources allocated for each user is 1.5 GB of memory and 3 GB of disk space.

Step 2: Install the client tools on your machine

Note: If you would rather watch a screencast of this step, check out the following videos where I demo how to install the client tools.

The OpenShift client tools are written in a very popular programming language called Ruby. With OSX 10.6 or later and most Linux distributions, ruby is installed by default so installing the client tools is a snap. Simply issue the following command on your terminal application:

sudo gem install rhc

Step 3: Create an OpenShift application

Now that we have an OpenShift account and the client tools installed, lets get started installing Gallery 3. The first thing we need to do is create a gear that will hold our application code and database. I will be using the command line tools that we installed in step 2, but you can perform the same action via the web console or using our IDE integration.

$ rhc app create gallery php-5.3

This will create an application container for us, called a gear, and setup all of the required SELinux policies and cgroup configuration. OpenShift will also setup a private git repository for you and propagate your DNS out world wide. This whole process should take about 30 seconds.

Once the application has been has been created, you can verify that it is working properly by loading the following URL in your web browser:

http://{yourAppName}-{yourNamespace}.rhcloud.com

For example, if you named your application gallery, like the example above and if you namespace or domain is mycoolapps, the url would be:

http://gallery-mycoolapps.rhcloud.com/metrics

Step 4: Add the mysql database cartridge

One of the requirements for Gallery 3 is the installation of a MySQL database. Luckily, OpenShift provides users with the ability to embed this database into any of their applications with a single command.

$ rhc cartridge add mysql-5.1 -a gallery

The above command will install the cartridge onto our gear and display the credentials needed to use the database. Make a note of these as we will need them when we run the Gallery 3 install process.

Step 5: Download the Gallery 3 source code

The source code for the Gallery 3 application can be downloaded directly from [sourceforce.net] (http://downloads.sourceforge.net/gallery/gallery-3.0.9.zip). This will download a zip file that you need to place in the following directory:

{$path to your application}/php

Once you have downloaded the zip file that contains the source code, extract the contents into the PHP directory of your application. This will create a new directory called gallery3.

{$path to your application}/php/gallery3

Step 6: Add the source code to your git repository and push the changes

At this point, you should have the source code downloaded and extracted to the gallery3 directory inside of your application/php directory. The next step is to add, commit, and push the source up to your OpenShift gear.

$ cd ${path to your application}
$ git add .
$ git commit -am “Adding Gallery 3 source code”
$ git push

Step 7: Install Gallery 3

The Gallery 3 source code should be publicly available on your OpenShift gear. The last step of the process is to install and configure the application. In order to complete this step, you will need the MySQL credentials that were provided in step 4 above.

Open up your web browser and enter the following URL:

http://gallery-{$yourDomain}.rhcloud.com/gallery3/installer/

Follow the instructions to complete the installation.

Contribute to the OpenShift Community

At OpenShift, we try to make the installation of popular open source projects extremely easy for users. If you would like to install other popular open source projects, check out our quickstarts on github.

Want to power up your OpenShift skills? Try creating a quickstart for the Gallery 3 application by following the directions in this blog post. When you have accomplished this task, and you are the first one to get it done, shoot me an email at openshift@redhat.com and I will fork your code into the main OpenShift quickstart github area.

What's Next?

The post Host and Share Your Photos on OpenShift With Gallery 3 appeared first on Platform as a Service Magazine.


Viewing all articles
Browse latest Browse all 24

Latest Images

Trending Articles





Latest Images