Ubuntu 8.04 + Gallery2.
+ I had a web server configured and working for over a year. Out of sight - out of mind. I failed to log all the pertinent information of how I made it happen. Upgrading from 6.06 was my downfall. Ill prepared, ill planned, I trashed my web server. Everything was gone because something happened to the database and I had no idea how to recover. Configurations got stomped upon by Apache update. I lost the whole site, in effect.
+ Back to square one. I am using a 64bit OS because I can, not that I need to. Attempts to use a desktop OS were not successful because I failed to understand the MySQL root+password difference from OS user+password from Gallery2 user+password. This how-to may work on Desktop versions, but the LAMP option in Server OS versions saved me time and sanity, so I stuck with it.
How-to for the impatient:
1) Install Server version of OS. During install, select "OpenSSH" and "LAMP", to facilitate remote access, and for Apache2, MySQL and PHP to be installed and pre-configured. This saves time and sanity for Gallery2 requirements. During install, MySQL will ask for a root user and password - BE SURE TO SAVE THIS INFORMATION FOR LATER!
Once the OS is installed verify webserver is working by browsing to http://<serverIP> or http://localhost. You should see an "It works!" message. This confirms the server is operational.
2) Install the following Gallery2 helper files before Gallery2 to make Gallery's setup easier later on:
dcraw - RAW file manipulation
ffmpeg - multimedia manipulation
imagemagick - graphics manipulation
zip - compression manipulation
libgd2-xpm - GD graphics library
jhead - EXIF manipulation
libjpeg-progs - JPEG manipulation
The following line should be run to simulate the install, to see if any dependencies or conflicts exist:
$ sudo apt-get install -s dcraw ffmpeg imagemagick zip libgd2-xpm jhead libjpeg-progs
Remove the "-s" and rerun to install for real:
$ sudo apt-get install dcraw ffmpeg imagemagick zip libgd2-xpm jhead libjpeg-progs
Test install Gallery2 for any dependencies or conflicts:
$ sudo apt-get install -s gallery2
If all is good, install Gallery2:
$ sudo apt-get install gallery2
Make an edit to a Gallery config file to point an alias to the install directory:
$ sudo nano /etc/apache2/conf.d/gallery2
Uncomment - #Alias /gallery2 /usr/share/gallery2 by deleting the "#". Save and close.
After Gallery2 installs, verify it is working by pointing your browser to http://<serverIP>/gallery2 or http://localhost/gallery2. You should see a configuration/welcome page. STOP!! Do not continue! That's right, close the browser and prepare for the Gallery2 configuration process.
I found it advantageous to prepare a Gallery image store prior to the install. A requirement of this is for the folder to be owned and writeable by the group 'www-data' which is what Gallery2 operates under.
$ sudo mkdir <path_and_name of_folder>
$ sudo chgrp www-data <path_and_name of_folder>
$ chmod 770 <path_and_name of_folder>
One more edit that I still do not fully understand why I need to do. I had to edit a php.ini file to doulbe a memory allocation. Without this, configuration would halt with an error.
$ sudo nano /etc/php5/apache2/php.ini
Find and change the line that says
"memory_limit" and change from 16m to 32m
Save and exit
Now restart Apapche to make changes effective.
$ sudo /etc/init.d/apache2 restart
Now you can go back and begin the Gallery2 initial configuration. Browse to http://<serverIP>/gallery2 or http://localhost/gallery2 and follow instructions. Create/save the authentication login.txt file, point to the image store folder created above, use the MySQL root user+password from prior, and you should complete the install successfully. You now should have a functional Galelry2 install ready for use. There are plenty of more detailed walk-throughs on this specific task on the web, should you need assistance.
Not being a Web guru, I was stumped with the final detail - how to make Gallery2 the default "home page" for visitors. I recognized that two issues needed to be combined. Apache2 was using the /var/www/index.html as the default starting point. That may be O.K. if I was a web-head and wanted to write pages, but not my intent. Gallery was using the default install path, /etc/usr/gallery, properly. I needed to 'bridge' the two together.
The answer was finally found by altering an Apache config file.
$ sudo nano /etc/apache2/sites-available/default
Find the folowing:
and change it to
Now restart apache
$ sudo /etc/init.d/apache2 reload
Now users will arrive at Gallery2 home page upon entering my url. I printed these instructions and made comments of users/passowrds/applications and paths, and placed inside the server(resides in my home, so security is not a major concern). Hoepfully I can read my own handwriting next time I need this info.
Yet to do:
Learn how to back up MySQL and Gallery2 image store folders. Just in case...