Skip to main content

Installation

Posted in

cd /var/websites
mkdir photos
cd photos
mkdir logs

Download the latest version of Gallery2 (2.3.1 at time of writing):

Webserver Configuration

  • Lighttpd
    If you are using Lighttpd as your webserver, edit lighttpd.conf and add:
    $HTTP["host"] =~ "photos\.domainname\.com" {
    server.document-root = "/var/websites/photos/gallery2"
    accesslog.filename = "/var/websites/photos/logs/access.log"

    Restart lightty:
    svc -t /service/lighttpd

  • Apache
    If you are using Apache as your webserver, edit /usr/local/apache2/conf/extra/httpd-vhosts.conf and add:
    <VirtualHost *:80>
      ServerName photos.example.com
      DocumentRoot /var/websites/photos/gallery2

      <Directory /var/websites/photos/gallery2>
        Options Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
      </Directory>
      ErrorLog /var/websites/photos/logs/photos-error_log
      CustomLog /var/websites/photos/logs/photos-access_log combined
    </VirtualHost>

    Restart Apache:
    svc -t /service/apache

Gallery2 configuration
Load the Gallery2 installer at http://photos.domainname.com.
In general, follow the instructions provided by the Gallery2 installer.
Create the data directory:

cd /var/websites/photos
mkdir g2data
chmod 777 g2data

Create the database:
/usr/local/mysql/bin/mysqladmin -u <username> -p create <databasename>

Login to MySQL as an admin user:
/usr/local/mysql/bin/mysql -u <username> -p

Create the user for Gallery2:
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, INDEX,  CREATE
TEMPORARY TABLES, LOCK TABLES
ON databasename.*
TO 'username'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;

Gallery 2 Plugins
yum install ImageMagick-devel

The path to the ImageMagick/GraphicsMagick binaries is /usr/bin