Installing Gallery2 on Gandi AI

Gallery2 is a widely used application, allowing you to create and administer image galleries on your website.

Creating a dedicated database

It's wise to have a database dedicated to your gallery. Let's go crazy, and call it “gallery”.

If you don't (yet) know how to go about this, please read this tutorial.

Creating a directory

You have a choice here. For “neatness'” sake, such applications are generally placed in a folder within the www sub-domain (www.example.com/gallery) or in a specific sub-domain of its own (gallery.example.com).

If you prefer to have your store in a folder

Easy! Just make sure the you create a specific folder for the store (as in www.example.com/gallery)

If you prefer to have a sub-domain specifically dedicated to your store, such as gallery.example.com

Two things to do:

  • Configure your server for this sub-domain, as explained in this tutorial.
  • Configure your sub-domain to point to the server you have just configured, as explained in this tutorial.

This is the option we will be using in the rest of the tutorial.

Fetching Gallery2

To begin with, we need to download it. At the time of writing, the latest version was 2.2.4.

Nothing beats the official site to get the intial compressed file. I therefore recommend this link.

Now that you've downloaded the file onto your favorite hard drive, decompress it. You now have a folder (let's rename it gallery) containing all of the Gallery2 files.

Launch your favorite FTP client (we recommend FileZilla) and log in as admin onto your server. Then, open the folder corresponding to the VirtualHost you had initially defined.

In our example, the path of the FTP would therefore be:

/srv/d_my-gandai-ai/www/gallery.example.com/htdocs

…that is, unless you've changed the initial configuration of the web files. If that's the case, however, I'm assuming you knew what you were doing. :)

At this stage, we can upload the Gallery2 files onto your server.

  • If you created a gallery.example.com kind of virtual host, you will want Gallery2 to come up as the front page (i.e. not within a folder in the sub-domain) and you should therefore upload the content of the gallery folder into the htdocs folder of your sub-domain.
  • If you're not a fan of sub-domains and prefer a good old example.com/gallery, then you need to upload the complete folder into htdocs (or another folder if you want).

Preparing the Gallery2 files

For Gallery2 to configure properly, certain folders and files will need specific rights. In most cases, to change these rights with your FTP client, all you need to do is right-click on the file concerned and chose the right term in the menu (could be Rights, CHMOD, Properties…). Supposing you were using FileZilla, this is how the client would operate:

Right-click the concerned file and select “File Attributes…”. The window that has just opened gives you two different methods to change the file rights: boxes to tick and numeric values.

The point of the tutorial not being to teach the numeric values of rights in UNIX, let's just say you can simply replace the numeric value of the 'gallery' folder by 777.

Installing Gallery2

Launch your web browser and open your Gallery2's folder on your website.

You should be greeted by the Gallery2 welcome page. Choose your language and click Begin installation.

1. Authenticate

Follow Gallery2's security measure, download the login.txt and upload it into Gallery2's directory. Once you have, click Authenticate me.

2. System Checks

If Gallery2 has been uploaded properly, you should be able to click Continue to Step 3.

3. Installation Type

Pick a standard setup, unless you need a multi-site setup.

4. Storage Setup

Choose the folder in which you're pictures will be stored. As the setup interface says, it is advised, for security reasons, to pick a oflder outisde of the gallery folder itself, as well as add a random chain of characters after the folder name. We therefore do not have any advice to give you on how to name your image folder. :) However, you do need to make sure that the folder within which you place your image folder has sufficient rights, so that Gallery2 can create its path for you.

5. Database Setup

Fill-in the fields as follows:

Database type: MySQL (v3.23.34a and newer)

DB Hostname: localhost

DB Username: this is the user name you needed to have created along with a database name, as explained at the very beginning of this tutorial.

DB Password: the password associated to the above user name.

DB Name: the database name.

Table Prefix: g2_

Column Prefix: g_

6. Admin User Setup

Define a username, password, e-mail address, etc. for the gallery administrator's account.

7. Create Config File

This step should confirm a config file has been created successfully.

This step should confirm the Gallery Core has been successfully installed.

9. Install Plugins

Choose the plugins you wish to install with Gallery2. By default, you can leave them all ticked. You can also choose to skip this step and add no plugin at all.

Once installed, Gallery2 will tell you which modules will need specific configuration once the basic setup is complete.

10. Check Security

In order to finish the setup, Gallery2 will need you to modify the rights on its folder, in order to remove the writing permissions you had activated at the beginning of the tutorial.

Use the same method as the first time, except that you should change the Gallery2 folder's numeric value from 777 to 755.

11. Finish Installation

Congratulations! The installation is finished, you can start uploading photos!

For further info on how to configure Gallery2, please consult the official support page.

Last modified: 10/18/2012 at 20:14 by Thomas S. (Gandi)