Home‎ > ‎unix/linux‎ > ‎Centos Systems‎ > ‎gallery‎ > ‎

Gallery 2 on Centos5

Prep Install: 

Minimum stuff: 
yum install mysql mysql-server apache2 php php-mysql gd php-gd ImageMagick

If you plan on installing all the additional packages for gallery, include the following: 


get requirements
yum -y install zlib-devel openssl-devel cpio expat-devel gettext-devel
cd /usr/local/src
wget http://git-core.googlecode.com/files/git-1.7.9.tar.gz
tar xvzf git-1.7.9.tar.gz
cd git-1.7.9
make install
mkdir git-test
cd git-test
git init
If all goes well, you should see similar output: Initialized empty Git repository in /root/git-test/.git/

Install other packages: 
yum install dcraw qffmpeg-libs netpbm

PreInstaller Script:

Download Preinstaller from here, and unzip

Add a password to $passPhrase
vim preinstall.php
    $passPhrase = "{add_password_here}";

copy to the Apache dir:
cp preinstall.php /var/www/html/.


add root password and remove test accounts

Create a "gallery2" database: 
/usr/bin/mysqladmin  -u root -p create gallery2
then enter root password

Create gallery user:
mysql gallery2 -uroot -p -e"GRANT ALL ON gallery2.* TO gallery@localhost"
then enter root password

Set password for gallery user: 
mysql gallery2 -uroot -p -e"SET PASSWORD FOR gallery@localhost=PASSWORD('{put_password_here}')"
then enter root password


comment out output buffering in the php config file
vim /etc/php.ini
    ; output_buffering = 4096


enable mod_rewrite.  Add the following at the bottom of the httpd.conf file. 
vim /etc/httpd/conf/httpd.conf

# enable access to gallery for mod_rewrite
<Directory /var/www/html/gallery2>
AllowOverride FileInfo Options

Start Services:

Start up apache and mysql (start or restart)
service httpd restart
service mysqld restart

For initial testing, you might want to disable IPTables temporarily: 
service iptables stop

Run Gallery 2 Pre-Installer: 

From your web browser, go to the servers website: 
The first question is what the password is that you set above in the $passPhrase variable.  

This script goes to the gallery site, downloads gallery and installs it on your server.  

Once this is complete, it cranks up the Gallery Installer to get Gallery running properly.