How to Install Coppermine on Arch Linux

Introduction

Coppermine is a popular photo gallery software that allows you to create and manage online photo albums. In this tutorial, we will show you how to install Coppermine on an Arch Linux server.

Prerequisites

Before you begin, you must have the following:

Steps

Step 1: Install LAMP stack

Before installing Coppermine, you need to install the LAMP stack on your server. LAMP stands for Linux, Apache, MySQL, and PHP. Follow these commands to install the LAMP stack:

sudo pacman -S apache php php-apache mariadb

Step 2: Create a database

Next, you need to create a MySQL database for Coppermine. Log in to the MySQL shell as the root user:

mysql -u root -p

Once you are logged in, create a new database and user for Coppermine:

CREATE DATABASE cpg;
CREATE USER 'cpguser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON cpg.* TO 'cpguser'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Make sure to replace password with a secure password of your choice.

Step 3: Download and install Coppermine

Download the latest version of Coppermine from the official website:

cd /var/www/html
sudo wget https://github.com/coppermine-gallery/cpg1.6.x/archive/stable.zip
sudo unzip stable.zip
sudo mv cpg1.6.x-stable cpg

Change the ownership of the cpg directory to the http user:

sudo chown -R http:http cpg

Step 4: Configure Apache

Create a new virtual host configuration file for Coppermine:

sudo nano /etc/httpd/conf/extra/cpg.conf

Add the following configuration:

<VirtualHost *:80>
    DocumentRoot "/var/www/html/cpg"
    ServerName example.com

    <Directory "/var/www/html/cpg">
        Options FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog "/var/log/httpd/cpg-error.log"
    CustomLog "/var/log/httpd/cpg-access.log" combined
</VirtualHost>

Make sure to replace example.com with your domain or IP address.

Save and close the file.

Step 5: Restart Apache

Restart Apache to apply the new configuration:

sudo systemctl restart httpd

Step 6: Run the installer

Open a web browser and navigate to your domain or IP address, followed by /cpg/install.php. For example:

http://example.com/cpg/install.php

Follow the on-screen instructions to complete the installation. When prompted for the database information, enter the following:

Once the installation is complete, delete the install.php file:

sudo rm /var/www/html/cpg/install.php

Conclusion

Congratulations! You have successfully installed Coppermine on your Arch Linux server. You can now upload your photos and start creating your photo galleries.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!