Coppermine Troubleshooting
From DreamHost
The first step in pinning down a problem with any software program is to make sure you have the latest version installed. If you do not, please go to the Coppermine website, download the latest version, and follow the program's instructions on how to upgrade. Also check for security patches and releases. Many high load situations are due to hackers using a vulnerable script to execute high-load commands on the server, or to send out thousands of spam email messages. This taxes the shared servers.
Coppermine has a handy debug mode you can enable. When logged into Coppermine as an admin, go to the "Config" menu, scroll to the bottom. There is an option to turn on debug mode, and let's you enable it for admin only. After saving the configuration with debug mode on, you can now go browse to a photo and find a bunch of array variables in a scroll box. What you're looking for is at the bottom - which is how many seconds it took for the page to be generated. Browse around your site and check these numbers. Perhaps you have a picture that is just taking a huge amount of load for some reason.
Due to the nature of image galleries, it could be that many of the requests to your site are users remotely linking your images (often referred to as bandwidth stealing!) If you wish to discourage this activity, a few simple lines in your .htaccess file may help drop your usage dramatically. First of all, you'll need to upload an alternative image to your website directory (for example, a simple image that has a small file size that simply states "Please download this image instead of linking it directly"). Let's call this image alt-image.jpg, and we'll store it in the images/ directory of our website (for example, you may call your image store something else entirely).
Now all you need to do is create a file called .htaccess (don't forget the leading dot!) In that file, put in the following lines:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://<yourwebsite.com>/.*$ [NC]
RewriteRule \.(png|PNG|gif|GIF|jpg|JPG)$ http://yourwebsite.com/alt-image.jpg [R,L]
The .htaccess file needs to be located in the document root of your website (so it needs to be yourwebsite.com/.htaccess). The permissions need to be set to 644 on it too (chmod 644 .htaccess on the command line).
If you have done all of the above and you're still seeing a high degree of load, check your traffic statistics. It could be that your gallery has become very popular. While our shared hosting servers are very good at handling quite a bit of traffic from our customers, there does come a point sometimes where a site will outgrow shared hosting and need to move onto the next step - a shiny new Dedicated server!

