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:
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.
mysql> CREATE DATABASE cpg;
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:
=> ~cpg1.3.3.zip' Resolving dl.sourceforge.net... 188.8.131.52, 184.108.40.206,... Connecting to dl.sourceforge.net[220.127.116.11]: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) - ~cpg1.3.3.zip' saved [2924274/2924274]
4. Unpack the archive:
$ unzip cpg1.3.3.zip
Archive: cpg1.3.3.zip inflating: cpg133/addfav.php inflating: cpg133/xp_publish.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
• 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.
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.
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?
Compared to film cameras, digital cameras are easy to use, fun and extremely versatile. Every day there’s more features being designed. Whether you have the cheapest model or a high end model, digital cameras can do an endless number of things. Let’s look at how to get the most out of your digital camera.