Tutorials - New CGI Platform > Help Installing Gallery
Tutorials & FAQs: Scripts: How to install phpBBIf you use your account to run your own website, one feature you might like to add is a gallery to share your photographs. This tutorial provides guidance for installing Gallery a sophisticated piece of software for displaying photographs on a website.
Expertise required
You'll be able to install this software very easily if you follow the step-by-step instructions methodically and accurately type what you see.
- In two places, you will be required to transfer a file to the CGI server machine. If you have a graphical FTP software package, such as CuteFTP, you may use that. Otherwise, you may use a command line interface (instructions given). However, to do this you'll need to know how to bring up a Command Prompt (possibly called a DOS command,or DOS box) on your operating system and how to then change directory.
- The installation process also requires you to log on to the CGI server machine. Don't worry, all the commands you'll need are given within the tutorial, so even relatively inexperienced users should not be put off.
- Non-Windows users should have little difficulty in interpreting the instructions for their operating systems. Very little is actually done on the local host, so the procedure is essentially operating system neutral in this respect.
Getting started with Gallery
Prior to starting, make sure you have activated both MySQL and CGI usage for your account. (The Website Settings link of the Portal provides tools for doing this. If you do not see the MySQL and CGI configuration tools when you select Website settings, you'll need to upgrade to an account type which includes them.)
For simplicity, red text has been used to indicate text which must be entered exactly as shown. Do not alter it at all (unless you know what you are doing).
Using Gallery with your CGI webspace
Obtaining the Gallery software
- Visit the Gallery website to obtain the Gallery software.
- Click on the Download Now link.
- Several different packages are available for downloading. Select the "Full Package", and because we're going to be installing on a Linux machine, download the "gzip" version.
- Place it in any convenient directory on your home PC (this is just a temporary location from where you can copy it to the CGI server machine).
Transferring the Gallery package to the CGI server
In this step, we're concerned with placing a copy of the Gallery gzip file onto the PlusNet CGI server.
You use FTP to copy the package to the server. If you have graphical FTP software (such as CuteFTP) you can use that to put it in your home directory on the CGI server. (You'll see there's already a directory called cgi-bin in your home directory - do notput the Gallery file in this directory, it should go in your home directory.)
If you don't have a graphical FTP software package (or if you'd like to try the command line for a change) follow the detailed instructions below for using a command line interface. Note that commands are sent by typing the command and then 'sending' it by pressing the Return or Enter key.
- Bring up a Command Prompt.
- Switch to the directory containing the Gallery file you've downloaded.
drive:\dir> cd <directory name>
Now FTP the Gallery file to the CGI server:
drive:\dir> ftp cshell.plus.net
Connected to <CGI server name>.
220 ProFTPD 1.2.10 Server (ProFTPD) [212.159.7.170]
User (<CGI server name>:(none)): <your username>
331 Password required for <your username>
Password: <your password for the CGI server machine>
230 User <your username> logged in
ftp> bin
200 Type set to I.
ftp> prompt
Interactive mode Off
ftp> mput gallery*
200 PORT command successful
150 Opening BINARY mode data connection for gallery-15.tar.gz
226 Transfer complete
ftp: 544080 bytes sent in 17.13Seconds 31.77Kbytes/sec.
ftp> quit
221 Goodbye
drive:\dir> (Back at the Windows Command Prompt)
Keep the Command Prompt window open - we use it in the next step!
Extracting the software on the CGI server
Your gzip Gallery package is now in your home directory on the CGI server. You now need to unpack it: :
- Log on to the CGI server machine using telnet.
- If you used graphical FTP software to transfer the package to the CGI server, this is the point at which you need to open a Command Prompt.
drive:\dir> telnet cshell.plus.net
[Connecting]
Linux 2.6.11-PlusNet-cgi (<timestamp>)
login: <your username>
Password: <your password for the CGI server machine>
Last login: <timestamp> from <your username>.plus.com
username@cshell1 username $
You have now logged on, and you're at a Linux 'shell' prompt (a Linux way of saying 'Command' Prompt). A feature of the shell is that if you write a few letters of a filename and then press the tab key, it will complete the rest of the name, based on the files in the directory. We'll make use of that feature here, so you don't have to remember the full name of the file we're interested in.
Note: Linux systems are case sensitive (i.e. it matters whether you type in upper case or lower case). Use exactly the same case as is shown here, otherwise Linux won't understand. If you type 'gallery' this is not the same as 'Gallery', for example.
Extracting the files from the Gallery package:
| username@cshell1 username $ tar xvzf gallery<press the tab key, then enter> |
You'll see each file listed as it is extracted, and when extraction has finished you should now have a directory called gallery which contains all your Gallery files. The tar.gz file will still be there, and you'll have another directory, cgi-bin, which was there from before you started.
Deciding on a directory name for your gallery
This step is optional, but it will determine the URL (web address) used to access your gallery (<ccgi.username.plus.com>).
- The next part of the URL is the directory name in which the Gallery software resides. By default, it is /gallery, so you would access the forum with this URL: http://<gallery hostname>/gallery
- If you don't like the directory name 'gallery', now is the time to change it. Iit is more difficult to change later, although it can be done (the name is stored in the MySQL database). For example, you might prefer to call it 'photos', which would then make your gallery's web address: http://<forum hostname>/photos
- If you want to change the directory name, you do it from your telnet session (e.g. change from 'gallery' to 'photos')
| username@cshell1 username $ mv gallery photos |
In the remainder of this tutorial, this directory will be referred to as <gallery directory>. If you decided not to change it, type gallery wherever you see this; otherwise type the name you gave the directory (e.g. 'photos' in the example above).
The web address used to access your gallery (shown as <your gallery address> later in this tutorial) is: http://<galleryhostname>/<gallery directory>
Changing file permissions
In order to allow php files to be executed we need to change the permissions of all the php files using the following command.
This is because by default php files being text files are not executable. Fortunately there is a script that will do this easily for you.
| username@cshell1 username $ chmod -R u+x <gallery directory> |
We also need to change create two blank files '.htaccess' and 'config.php' and make them world writeable.
| username@cshell1 username $ cd <gallery directory> username@cshell1 username $ touch config.php .htaccess] username@cshell1 username $ chmod 777 config.php .htaccess |
You now need to create a directory to hold Gallery's albums. You can create the directory anywhere in your web space (accessible via the web). It is easiest to just create another directory in your gallery/ directory. You will also need to create a tmp directory as the new CGI platform doesn’t have a shared temporary directory.
| username@cshell1 username $ cd .. username@cshell1 username $ mkdir albums tmp This directory must be chmodded 777 username@cshell1 username $ chmod 777 albums tmp For use a bit further down the line we also need to know the absolute path to your cgi folder on the cgi platform using the pwd command username@cshell1 username $ pwd /files/home4/pugtest08 The CGI server will respond with the absolute path of the form /files/homeX/username where X is 1, 2 , 3 or 4, and username is your username. Make a note of this for later. Stay logged on in your telnet session! |
Installing the software
The next step of the installation is carried out from your web browser on your PC.
- Browse to <your gallery address> which we've just determined: http://<gallery hostname>/<gallery directory>/setup/ index.php.
- You'll now be presented with the Gallery Configuration Wizard.
- The first page (Step 1) will check for errors that could block you from installing Gallery. If you get all green, you're passing with flying colors! If some tests fail with a warning (i.e. yellow), you're usually OK. You may also see a red warning regarding Register Global, this is fine to ignore.
- Click Next Step.
- You now need to customise your Gallery settings with the Gallery Configuration Wizard.
- You'll be presented with a number of tabs (e.g. General Settings, Locations and URLs etc.). Click on and work through each tab, completing all the required information. Anything with a red * must be completed .
- Start with General Settings.Give your gallery a title as well as setting up an administration password.
- Move on to Locations and URL’s. Gallery doesn’t auto-complete all of these fields. Therefore, you will need to change:
- Album directory to: the form /files/homeX/username/albums that you recorded above.
- Temporary Directory to: the form /files/homeX/username/tmp.
- Album directory to: the form /files/homeX/username/albums that you recorded above.
- The remaining tabs under Step 2 of the Gallery Configuration Wizard contain various configuration information can be skipped. (Alternatively there’s more information available in the Gallery documentation).
- Click Next Step.
- Step 3 of the Galley Configuration Wizard covers the default values for new albums. If you need to change anything here you can do, then click Next Step.
- You should now be presented with a page stating ' Your configuration has been successfully saved' , with a script output underneath. If there’s anything in red then you’ve done something wrong and will need to re-check Steps 1-3 of the Gallery Configuration Wizard.
- Click Save Config.
Completing the Installation
- Congratulations, your configuration has been completed.
- Go back to your telnet window and secure your config.php and .htaccess files as suggested
| username@cshell1 username $ cd <gallery directory> username@cshell1 username $ chmod 644 config.php .htaccess |
Disconnecting from the CGI Server
Now exit from telnet:
| username@cshell1 username $ exit logout Connection to host lost. drive:\dir> exit (closes the Windows Command Prompt) |
Next Steps
- Click Enter the Gallery and Login with the username Admin and the password you created earlier and you can start creating your albums. The admin section of Gallery includes detailed help pages on setting up and using the Gallery software.
- Start off by clicking New Album and adding your pictures.
Useful link: Gallery help
Acknowledgements
This document was originally hosted on the PlusNet Portal, and has been reproduced here at the request of PlusNet Staff.
Original Article by: csogilvie - Edited by: csogilvie
