User Tools

Site Tools





<note important>On Debian Lenny you need Debian backports to install gallery2.</note>

Select the languages that should be used

Find out if all the locale you need are available

locale -a

Select missing locales if necessary:

dpkg-reconfigure --priority=low locales

Installing Gallery2

Install the package and answer the questions of the Debian configuration wizard:

aptitude install gallery2 imagemagick php5 php5-curl

Gallery2 needs to be able to write to the .htaccess file to activate mod_rewrite for shorter URLs:

touch /usr/share/gallery2/.htaccess
chmod 666 /usr/share/gallery2/.htaccess

Web configuration wizzard

Step 1: select your language

Nothing special here. Move on.

Step 2: authenticate yourself as server owner

When you run the web interface of Gallery the first time you must authenticate yourself as the server owner. Gallery displays a generated random number which you have to put into the file /usr/share/gallery2/login.txt.

Once you have done this you can proceed with the web-based configuration wizard.

Step 3: System check

On Debian Lenny the wizard warns you about missing, outdated or modified files in step 3. You can safely ignore this for now.

Step 4: installation type

For your private gallery a single site installation will do.

Step 5: configure the data storage

In the next step you configure the data diretory. The Linux file system hierarchy standard says you should install this under /var/…. I prefer /data as root directory for my most valuable data. This way backup is easier.

mkdir /data/gallery2
chmod 755 /data/gallery2
chown www-data:www-data /data/gallery2

Step 6: configure database access

Don't be tempted to use the database root user. Use a dedicated database user with restricted rights instead.

Step 7: configure the admin user account


Step 8: create the configuration file

In this step Gallery2 creates the configuration file from your choices. Nothing to do here for you.

Step 9: installing the core

As in the last step everything should run automatically. Proceed.

Step 10: plug-in installation

The way I see it, it is more important here to get rid of plug-ins that you don't need.

You probably won't need:

  • Migration
  • WebCam
  • The shopping cart and most of the other “business” plug-ins
  • Flash-Video (*yuk!*)
  • mp3

Now you can proceed and activate your selection of plug-ins. You will be notified about modules that must be configured before you can use them.

Step 11: security check

Gallery2 checks whether your configuration looks safe.

Step 12: finish

All done.


Putting Gallery2 into debug mode

In the file /etc/gallery2/config.php switch debugging on:


On the console type:

apachectl restart

Don't forget to switch debug mode of later.

Check if the database server runs

Before you start hunting for problems in the configuration and installation of Gallery check if the database server actually runs.

In your web servers error log you might find hints like this that tip you of that Gallery can't communicate with the database server:

[Sat May 21 17:10:38 2011] [error] [client] PHP Warning:  mysqli_real_connect()
[<a href='function.mysqli-real-connect'>function.mysqli-real-connect</a>]:
(HY000/2002): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'
(2) in /usr/share/php/adodb/drivers/ on line 110


gallery2.txt · Last modified: 2015/05/17 17:44 (external edit)