Piwigo Installation and Configuration on gallery.deome.net
Overview
This page provides step-by-step instructions to install and configure Piwigo as a photo gallery on gallery.deome.net. This includes setting up the Apache virtual host, database configuration, and SSL with Let’s Encrypt.
1. Prerequisites
- Web Server: Apache (see Apache wiki page).
- Database: MariaDB (refer to MariaDB setup page).
-
PHP: Ensure PHP is installed along with the necessary modules:
sudo apt install php php-mysql php-xml php-mbstring php-gd php-curl -y
2. Download and Install Piwigo
-
Create the Document Root Directory:
- Create a directory for Piwigo:
sudo mkdir -p /var/www/gallery
- Create a directory for Piwigo:
-
Download Piwigo:
- Navigate to the gallery directory and download the latest Piwigo release:
cd /var/www/gallery sudo wget https://piwigo.org/download/dlcounter.php?code=latest -O piwigo.zip sudo unzip piwigo.zip sudo mv piwigo/* ./ sudo rm -rf piwigo piwigo.zip
- Navigate to the gallery directory and download the latest Piwigo release:
-
Set File Permissions:
- Make sure Apache has the correct permissions to access and modify the files:
sudo chown -R www-data:www-data /var/www/gallery sudo chmod -R 755 /var/www/gallery
- Make sure Apache has the correct permissions to access and modify the files:
3. Configure the Database
-
Log in to MariaDB:
sudo mysql -u root -p -
Create a Database and User for Piwigo:
CREATE DATABASE piwigodb; CREATE USER 'piwigouser'@'localhost' IDENTIFIED BY 'your_password'; GRANT ALL PRIVILEGES ON piwigodb.* TO 'piwigouser'@'localhost'; FLUSH PRIVILEGES; EXIT;
4. Configure Apache Virtual Host for gallery.deome.net
-
Create the Virtual Host File:
- Open a new virtual host configuration file for gallery.deome.net:
sudo nano /etc/apache2/sites-available/gallery.deome.net.conf
- Open a new virtual host configuration file for gallery.deome.net:
-
Add the Virtual Host Configuration:
- Use the following configuration:
<VirtualHost *:80> ServerName gallery.deome.net DocumentRoot /var/www/gallery <Directory /var/www/gallery> AllowOverride All Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/gallery_error.log CustomLog ${APACHE_LOG_DIR}/gallery_access.log combined </VirtualHost>
- Use the following configuration:
-
Enable the Site and Rewrite Module:
- Enable the virtual host and rewrite module, then reload Apache:
sudo a2ensite gallery.deome.net.conf sudo a2enmod rewrite sudo systemctl reload apache2
- Enable the virtual host and rewrite module, then reload Apache:
5. Set Up SSL with Let’s Encrypt
-
Install Certbot:
- If Certbot is not already installed:
sudo apt install certbot python3-certbot-apache -y
- If Certbot is not already installed:
-
Generate SSL Certificate:
- Use Certbot to obtain an SSL certificate for gallery.deome.net:
sudo certbot --apache -d gallery.deome.net
- Use Certbot to obtain an SSL certificate for gallery.deome.net:
-
Enable Auto-Renewal:
- Certbot will automatically handle renewal. Test the setup with:
sudo certbot renew --dry-run
- Certbot will automatically handle renewal. Test the setup with:
6. Complete Piwigo Setup
-
Access the Piwigo Installation Wizard:
- Open a browser and go to
https://gallery.deome.net. You should see the Piwigo setup wizard.
- Open a browser and go to
-
Follow the Setup Wizard:
- Enter the database information:
-
Database Name:
piwigodb -
Database User:
piwigouser -
Database Password:
your_password
-
Database Name:
- Configure the admin account and complete the setup.
- Enter the database information:
7. Testing and Verification
-
Access Piwigo:
- Verify that Piwigo loads correctly at
https://gallery.deome.net.
- Verify that Piwigo loads correctly at
-
Check Logs:
- Monitor the Apache logs if any issues arise:
sudo tail -f /var/log/apache2/gallery_access.log sudo tail -f /var/log/apache2/gallery_error.log
- Monitor the Apache logs if any issues arise:
8. Maintenance and Updates
-
Database Backup:
- Set up regular database backups:
mysqldump -u root -p piwigodb > /path/to/backup/piwigodb.sql
- Set up regular database backups:
-
Updating Piwigo:
- Periodically check for updates in the Piwigo admin dashboard.
This setup should get Piwigo running smoothly on gallery.deome.net. Let me know if you need any specific configurations or additional settings!