Newbie’s G2 Fast Install Guide

stoffer
stoffer's picture

Joined: 2005-02-10
Posts: 75
Posted: Sat, 2005-03-19 14:46

This is meant as a help to us newbie users who wants to get G2 installed quickly and easily, but could do with a step-by-step quickie guide.

Edit: As valiant points out the guide is fairly specific because you need ssh/telnet access on your website. Please keep that in mind. If available, you should be to enable it under shell options in your control panel.

So here goes:

1) First of all, you need to create a database to run Gallery2. Some webhosts let you create one yourself by logging into a control panel that lets you customize your website. If so go ahead and fill out the DB (database) name, DB hostname, DB username and DB password. Write these down, as you need them during the G2 Install Guide later on. If you haven’t got a control panel of sorts, you may have to ask your web host to create the database for you.

Now you should try to log into your new database with your DB username and DB password just to make sure that it works properly (it should show up via phpMyAdmin). Then just log out without making any changes to the database.

2) Next step is the download Gallery2 software. You can get the latest G2 version from one of these two websites:

http://galleryupdates.jpmullan.com/
http://www.fw2.net/files/gallery/

Go ahead and download the file with the latest date in the filename aka gallery2-2005-03-19.tar.gz.

You can either download a .zip or .tar.gz version. I recommend that you go for the .tar.gz (which is a UNIX compressed archive) because you then can take advantage of the neat trick to decompress the .tar.gz archive after the upload to the web.

Edit: as valiant notes, you can also use the .zip archive which can be decompress in the same manner.

Anyway, it should be much faster to upload the single archive than uploading and writing more than 2300 files to your website!

3) Now upload the gallery2.tar.gz to the root of your website. You do not need to create any folders or directories as they (including the base folder gallery2) will be created automatically during extraction of the .tar.gz archive. (Note that the archive might be renamed to tar.tar during download. If so change it back to the proper .tar.gz)

4) Okay, now you need to work a bit with a UNIX command line tool on your website. (note: You need to enable Shell Access first!) It works a lot like good old DOS command line, so no need to worry at all.

We’re going to use the Telnet and SSH client PuTTY, so download it from:

http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

Just launch the program, type in your host name like www.mydomain.com and click the Open button. Now you just need to type in the username and password that your webhost provided you with and you’re ready for the next steps.

5) Lets decompress the uploaded .tar.gz archive.

At the command line (denoted by a $) in Putty type:

dir

The directories will be listed. One of them should be your website like mydomain.com.

Let’s move into that by typing:

cd mydomain.com

Then type:

dir

A list of the files and directories at the root of your website will by shown. Now eyeball that tar.gz archive that your uploaded before and type:

tar -xvzf gallery2-2005-03-19.tar.gz

(or whatever the date is)

You should now see a long list of files as Gallery2 is decompressed. Once it is done, type:

dir

... just to make sure that the gallery2 directory is now created.

6) As a last step in Putty you need to create the directory g2data where G2 will store your photos. The developers recommend that you don’t create in the web root (or inside the gallery2 directory) for security reasons. If so, anybody can get directly to your images with their web browser which circumvents G2’s security.

Instead they recommend that you create the g2data directory outside (below) the web root directory which is where you arrived the first time you logged in with Putty.

To get back to that place, type:

cd $HOME

You can type dir if you want to see that you’re now actually outside (below) the directory that contains your website. Now, to create the g2data directory, in Putty type:

mkdir g2data

This directory must be writable by the web server, so type:

chmod 777 g2data

Now you’re done! Type:

logout

... to exit Putty.

Last step is to point your browser to www.mydomian.com/gallery2/install in order to begin the G2 install guide.

Once you get to the step where you need to tell the path to the storage directory (g2data) just change the path that the installer suggest by deleting the /mydomain.com/gallery2/ part so that it reads something along the lines of: /home/yourusername/g2data

Any corrections and improvements are welcome!

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2005-03-19 15:31

1. G2 isn't "compiled" (apart from some non php things) ;)
2. the howto is neat, but it is very specific for your webhost. i'd guess that most 5-15$/month webhosts don't offer ssh/telnet access.
3. tar.gz is smaller, but .zip would work as well, just use "(g)unzip gallery2.zip" via putty.
4. tar -xzf (non verbose) may be a little faster.

alternatives for users without ssh/telnet access:
- use the control panel if you have something like that for your domain. use the file browser of this control panel, if available. upload the gallery2.tar.gz, select it in this file browsers and check if there's an "extract" option. this does the same as the whole telnet / putty session described above.
- if no control panel/file browser with extract option is available, you could extract the archive via php. upload gallery2.tar.gz in the directory where you would like to install G2. create a php file extract.php with following contents
<?php exec('tar -xzf gallery2.tar.gz',$ret); ?>
upload extract.php into the same directory as you uploaded gallery2.tar.gz, browse to extract.php with your webbrowser, you're done. now delete extract.php and gallery2.tar.gz from the server.
maybe this works, maybe not. a more elaborate scripts could check for some edge cases etc. but that's another task.

 
stoffer
stoffer's picture

Joined: 2005-02-10
Posts: 75
Posted: Sat, 2005-03-19 15:44
valiant wrote:
1. G2 isn't "compiled" (apart from some non php things) ;)
2. the howto is neat, but it is very specific for your webhost. i'd guess that most 5-15$/month webhosts don't offer ssh/telnet access.
3. tar.gz is smaller, but .zip would work as well, just use "(g)unzip gallery2.zip" via putty.
4. tar -xzf (non verbose) may be a little faster.

Thanks for the feedback!

1) :oops:
2) True, it is fairly specific for my webhost (again :oops: ), but regarding ssh/telnet access for 7-8$/month: webhosts like dreamhost (that I have) and bluehost both offer it, so I thought it was fairly common.
3) Well, I didn't know - I am a newbie after all! :wink:

 
stoffer
stoffer's picture

Joined: 2005-02-10
Posts: 75
Posted: Mon, 2005-03-21 09:49

Hmmm, by the lack of feedback I think it wasn't the brightest idea to post this “guide

 
Einstein
Einstein's picture

Joined: 2003-10-13
Posts: 105
Posted: Mon, 2005-03-21 15:00
 
Einstein
Einstein's picture

Joined: 2003-10-13
Posts: 105
Posted: Mon, 2005-03-21 15:03
stoffer wrote:
Hmmm, by the lack of feedback I think it wasn't the brightest idea to post this “guide

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2005-03-21 18:54

two weeks ago, i was writing a preinstaller for G2. basically, it does some tests, tries to find the tar/unzip/wget executables on the server and offers two options:
- download G2 from a url, i.e. jesse mullans snapshots page
- extract the archive (either uploaded manually via ftp or downloaded from another server directly).

then i started doing more tests and thinking about possible issues, like that the directories/files created would be owned by the webserver user if it wasn't a cgi/suExec setup. and i started coding functions like move gallery folder from server path x to y. delete gallery folder, etc.

bottom line: i could finish it, but i fear all the stupid support questions lol.
and there's a big disclaimer at the top of the script explaining why this is the last resort. only use this script if there's no other option (other options explained).

 
Xirian

Joined: 2007-04-29
Posts: 3
Posted: Sun, 2007-04-29 03:59

I used this installer and everything worked fine. I'm just curious if I should remove the gallery2.zip file from my website root or leave it there? The Gallery2 folder is there intact with all of the correct information, but the gallery2.zip is there as well.

~Xirian~

 
wrathchild60

Joined: 2010-02-22
Posts: 25
Posted: Tue, 2010-03-16 23:20

I would like to thank you for your step by step guide.
With your help I managed to install gallery.
So thank you Stoffer

wrathchild

 
defianted

Joined: 2010-03-15
Posts: 1
Posted: Thu, 2010-03-18 01:30

i was confused about the installation so i was gonna post something about i wish there's easier way to install G2 but then here it so...i'm gonna try this method to see if i can make it work...thank you. ~ ed