Gallery2:Installation on centos5 - Gallery Codex
Personal tools

Gallery2:Installation on centos5

From Gallery Codex

I did it so many time in the last few days, I figured, I'd add a wiki page for it (I wish there was one before I started...) It's going to be messy (sorry), but functional. I wrote it while actually doing it yet again.

Installing Gallery2 on centos5 - 5.3

Starting off with a fresh install of Centos 5.3 on Mosso (Rackspace cloud).

We're going to install the basic dependencies first. I know it's considered bad practice, but for god's sake log in as root, so we don't have to keep elevating privileges.

Run:

 yum install mysql mysql-server apache2 php php-mysql gd php-gd ImageMagick

This installs most of everything needed.

Download the preinstaller - here. Extract. Take the file called "preinstall.php", and open it as text. At the very top you'll find a $passPhrase parameter. Put something in there, just to keep on the safe side.

Upload this php file to /var/www/html. Use SSH or whatever else.

Start the services:

 service httpd start
 service mysqld start

You probably want to change the root password on MySQL. I'm going to skip this part - but if you're going to do it, do it now (if this is a production system, you MUST do it!)

Now we'll create the blank database: mysql -uroot -p (enter your password for mysql) create database gallery2;

If you want to create a special user on MySQL that will be used for gallery2 operation, do it now.

type 'exit' to exit the mysql client

Turn off any firewall on the server (but don't forget to put it back on later on, especially if this is production) - In order to turn off the cents internal firewall:

 service iptables stop

With your browser go to: http://<your server>/preinstall.php

Keep following the instructions, starting at #6 in Preinstaller instructions. It's one of the most amazing and convenient installation processes (considering it's a LAMP stack).

A few tips:

  • gallery2 will be installed in /var/www/html/gallery2 . This is where you want to place login.txt.
  • php.ini is under /etc. Look for the output_buffer=4096, and change it Off. Otherwise you'll get a warning in the installation process (you can ignore it, but it's not recommended)
  • While you're at it, in php.ini, look for memory_limit, and bump it up to at least 128Mb.
  • In step 9, activate all modules (try, at least). The installation process is long and may seem stuck sometimes (browser at "done"). If it is, just reload the browser page and it will start again, but this time will get stuck at a later point. Keep going until you're outa there. This is especially true if you haven't bumped up your memory allocation for php.
  • After installation is done, Before you do anything, log in as admin, go into the plugins section and activate ImageMagick and GD. Your uploads would function poorly otherwise. Plugin activation is beyond the scope of this document, but it's important that you do it.
  • In the ImageMagick configuration, you'll get a warning about known vulnerabilities. Check to checkbox to ignore it.
  • In the installation process, the installer gives you tips on how to set up permissions once you're done. LISTEN. Especially if this is a production environment.
advertisements