Installing a Web Application Coppermine Photo Gallery

Photography Jobs Online

Learn Digital Photography Now

Get Instant Access

Once your LAMP server is operational, you can begin installing or creating applications to run on it. One such application is Coppermine Photo Gallery (CPG), the installation of which is demonstrated in this section. CPG is a Web-based photo gallery management system written in PHP. Through its Web interface, you can upload pictures to your own photo galleries, which will be available on the Web through your LAMP server.

You can install CPG under a virtual host or under a user's home directory on your main host. A single server can easily support many CPG installations using either of these methods.

To install CPG on the Debian system described in this chapter, follow these steps:

1. Install the unzip and imagemagick programs. Unzip is used to unpack the CPG program after downloading, and imagemagick is used to resize images and create thumbnails:

# apt-get install unzip imagemagick

2. Create a MySQL database for CPG. You can use a database name other than cpg if you wish. The database username (the part before the @'localhost' in the GRANT statement) and the database name do not need to match. Be sure to replace mypassword with something different:

Enter password:

Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 to server version: 4.0.24_Debian-10-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.


Query OK, 1 row affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON cpg.* TO 'cpg'@'localhost' IDENTIFIED BY 'mypassword';

Query OK, 0 rows affected (0.00 sec)

3. Log in as the user that will own the CPG installation and download the latest version from the Internet:

$ wget


=>' Resolving,,... Connecting to[]:80... connected. HTTP request sent, awaiting response...200 OK Length: 2,924,274 [application/zip]

100%[===============>] 2,924,274 58.02K/s ETA 00:00

19:31:36 (57.08 KB/s) -' saved [2924274/2924274]

4. Unpack the archive:

$ unzip

Archive: inflating: cpg133/addfav.php inflating: cpg133/xp_publish.php [...]

inflating: cpg133/zipdownload.php

5. Rename the freshly unpacked cpg directory, and then set the permissions so that files can be uploaded from PHP:

$ mv cpg133 photos $ cd photos $ chmod 777 include

$ find albums -type d | xargs chmod 777

6. Go to a Web browser on any machine that can reach your LAMP server over the network and open the install.php script under your coppermine directory.

• If you're installing CPG under a user directory under your main host, the

URL is http://servername/~username/photos/install.php.

• If you're installing CPG under a virtual host, the URL is http:// virtualhostname/photos/install.php.

Figure 24-2 shows the installation page.

7. Configure CPG to work with your installation by filling in the following fields and selecting Let's Go!:

• Username and Password — The administrative login and password that you will use to administer CPG.

• MySQL Host — The server name that CGP will connect to for the database. In this case, you want to use localhost.

• MySQL Database Name—The name of the database that you created in Step 2. (In the example, I used cpg.)

• MySQL Username and Password — The username and password that you created in Step 2 for accessing the database. (In the example, I used cpg and mypassword, respectively.)

• MySQL table prefix — The prefix for the tables that will be used by CPG. The default value (cpg133_) is fine.

• ImageMagick path — The directory containing the imagemagick binary. On Debian systems, this is /usr/bin.

Figure 24-2: The Coppermine Photo Gallery installation page.

8. You're now done installing CPG. At this point you can click Let's Continue to see the default Coppermine Photo Gallery page. You can use this CPG Web interface to create photo galleries and upload photos. Figure 24-3 shows a sample gallery.

Figure 24-3: A sample Coppermine photo gallery.

While a complete description of the dozens of features of the Coppermine Photo Gallery is beyond the scope of this example, here are a few tips if you want to continue setting up a working photo gallery. To begin, go to the home page of the photo gallery you just created (http://server/~user/photos) and log in with the administrative user and password you created. Then do the following:

♦ Add an Album — Click the Albums button and then click New. Type a name for the album and select Apply modifications. Then select Continue as instructed.

♦ Upload files—Click the Upload file link at the top of the page. From the Upload file page, add either the full paths to file names (File Uploads) or Web addresses (URI/URL Uploads) of the images you want to install. Then click Continue. If the uploads were successful, click Continue again.

At this point, you can add information to be associated with each image you just uploaded. Select the Album each will go into, a file title, and a description, and then select Continue. After you have added information for all you uploaded images, click Continue again to return to the main photo gallery. There you can see your images sorted by album, as random file, or by latest additions.

If you installed Coppermine on a public server, you can give the Web address of that server to your friends and family and they can begin viewing your photo albums. There is a lot you can do to customize your Coppermine Photo Gallery. You can begin by going through the settings on the Configuration page (click the Config link to get there). Click the Users or Groups links to create user or group accounts that give special access to upload or modify the content of your gallery.

Was this article helpful?

0 0
Digital Photography Mastery

Digital Photography Mastery

Insider Secrets Revealed By the Pro Showing You How to Become a Professional Photographer! Discover The Secret Tips & Techniques On How To Be A Professional Photographer, Start Producing High Quality Pictures and Skyrocket Your Photography Business Income Revenue To The Roof TODAY! You're About to Discover the Powerful Strategies and Method to Start Taking Sharp, Clear and High Quality Pictures Like the Professional Photographer Without Paying a Single Penny to the Expert!

Get My Free Ebook

Post a comment