Gallery Multisite Installation

This instructions are for installing Gallery2 with a common codebase for multiple sites. The main advantage to this is to be able to upgrade all your Gallery2 sites at once.

The instructions are based on the instructions provided in the Gallery2 documentation.

If you simply want to install Gallery in one site, you'll be better off with the One-Click Install provided by DreamHost which is fully supported by DH's team.

Prerequisites

 * Configure your shell account as explained in Unix account setup
 * Your web sites are supposed to be under   as explained in Unix account setup

Download and install Gallery2 codebase
export GALLERYVERSION=2.2.2
 * Download and open
 * 1) this is an EXAMPLE, replace the number with the actual version
 * 2) of Gallery2 that you are going to install
 * 3) !!!!! make sure this is the rigth version !!!!!

export G2CODEBASEPATH=${HOME}/www/codebase.example.net/g2 export G2CODEBASEURL=http://codebase.example.net/g2/
 * 1) this is an EXAMPLE, replace with the path to the web area of a domain
 * 2) (or, better yet a subdomain) you own which will be used *ONLY* to hold
 * 3) the Gallery2 codebase. This *HAS* to be accessible via web

export G2INSTALLERURL=${G2CODEBASEURL}install/ cd ${HOME}/soft wget http://prdownloads.sourceforge.net/gallery/gallery-${GALLERYVERSION}-full.tar.gz tar xvzf gallery-${GALLERYVERSION}-full.tar.gz

if [ -d ${G2CODEBASEPATH} ] then # the path already exists. Move the contents. mv -v ${HOME}/soft/gallery2/* ${G2CODEBASEPATH} else # the path doesn't exist. Move the directory. mv -v ${HOME}/soft/gallery2 ${G2CODEBASEPATH} fi
 * Move or copy the codebase

Global database
This is optional but recommended. If you are administering multiple gallery2 instances you might want to have only one database and differentiate instances with a table prefix. Create a new database and associate a user/password with it as explained in MySQL. If you prefer, you can create a different database/user/password for each instance.

That's it. Since this installation is only the codebase, you don't need to do anything else globally.

Create a new (multi)site
Gallery2 documentation refer to each instance (or site) as a multisite. This is a Gallery2 instance which will have its own URL and database table prefix (or database), thus Gallery2 users will be different among sites.

To create a new instance (multisite) you must run the install scripts from a browser and do the installation as follows.


 * First, create the domain/subdomain where you want this multisite. For example, if you created the domain example.org and want the new gallery site URL to be http: //www.example.org/pictures/, do the following:

export G2SITEPUBPATH=${HOME}/www/example.org/pictures export G2SITEURL=http://www.example.org/pictures/
 * 1) this is an EXAMPLE, replace with the path to the web area of the domain
 * 2) (and optionally path within the domain) where you want your new
 * 3) Gallery2 multisite
 * 4) This path *MUST BE DIFFERENT* from the one where the codebase
 * 5) resides (${G2CODEBASEPATH})

export G2SITEPRIVPATH=${HOME}/data/gallery2/example.org/pictures
 * 1) this is an EXAMPLE, replace with the proper path (this should be
 * 2) *OUTSIDE* the area visible within the web).

mkdir -pv ${G2SITEPUBPATH} mkdir -pv ${G2SITEPRIVPATH}
 * 1) Create the directories to hold the multisite public and private data

echo ${G2INSTALLERURL} if you're brave enough you could do this from inside your terminal shell with: links ${G2INSTALLERURL} but you'd rather do it from your favorite browser.
 * To see the install URL type in your terminal:


 * Load the URL (which will look something like http: //codebase.example.net/g2/install/) in your browser.

Step 1: Authenticate

 * Choose your language and click Begin Installation.

cat > ${G2CODEBASEPATH}/login.txt <<EOF 0123456789abcdeffedcba9876543210 EOF
 * You have to authenticate yourself to the codebase installer... the only way to do this is to verify that you have access to the physical directory where the codebase is installed. You'll see that the installer shows you a 32 character string and asks you to put it in a file called  in the directory where you installed the codebase (if you already run the installer once and created the   file you won't have to do this.
 * If the string you got from the installer is 0123456789abcdeffedcba9876543210 you can do this (in your terminal):
 * or create the  file with your favorite text editor. Put the actual string that you got from the installer and not the example string up here.


 * Now press the Authenticate me button.
 * Press Continue to Step 2.

Step 2: System Checks
This step is System Checks for now, ignore the warning about Output buffering being enabled.
 * Press Continue to Step 3.

Step 3: Installation Type
This is the Installation Type step. This is the IMPORTANT one, that is, this is where you tell the installer that you want to create a new multisite (rather than actually activate a gallery where the codebase is installed). echo ${G2SITEPUBPATH}
 * Choose Multisite Installation
 * Fill the installation path with the public directory you just created. To see this path, type in your terminal:
 * Press the Select Directory button.
 * Press Continue to Step 4.

Step 4: Storage Setup
This is the Storage Setup step. echo ${G2SITEPRIVPATH}
 * DON'T leave the proposed private directory path... in order to increase security, we'll put this outside the area reachable from the web (the Gallery installer can't know that we do, indeed, use a separate directory).
 * Fill the directory path with the private directory you just created. To see this path, type in your terminal:
 * Press the Save button.
 * Press Continue to Step 5.

Step 5: Database Setup
This is the Database Setup step.
 * In Database type choose MySQL (v3.23.34a and newer)
 * In DB Hostname put the hostname you chose when you created the . Note that in DreamHost this is never localhost.
 * In DB Username put the username you chose when you created the.
 * In DB Password put the password you chose when you created the.
 * In DB Name put the database name you chose when you created the.
 * In Table Prefix put a prefix specific to this instance (multisite)... you could put something like example_org_pictures_ or maybe something shorter, but that would inequivocally refer to this instance.
 * In Column Prefix you can leave the default value.
 * Press the Save button.
 * Press Continue to Step 6.

Step 6: Admin user Setup
This is the Admin user Setup step.
 * Fill in the fields with the username, password (twice), email address and real name for the administrator of this instance. This will be the username that will have access to configure the gallery instance, create users, etc.
 * Press the Create button.
 * Press Continue to Step 7.

Step 7: Create Config File
This is the Create Config File step. It should run automatically. It creates a file named  within   to hold the data gathered in the previous steps.
 * Press Continue to Step 8.

Step 8: Install Gallery Core
This is the Install Gallery Core step. It should run automatically.
 * Press Continue to Step 9.

Step 9: Install Plugins
This is the Install Plugins step.
 * Select the plugins you want
 * If you want to, press the Activate Selected Modules button. Some of the modules might require configuration later on.
 * Press Continue to Step 10.

Step 10: Check Security
This is the Check Security step. It should run automatically.
 * Press Continue to Step 11.

Step 11: Finish Installation
This is the Finish Installation step. It should run automatically.

There you are.

Login to the new (multi)site
Now load the URL for your new gallery instance (multisite). To see this URL, type in your terminal: echo ${G2SITEURL}
 * Login with the admin account you just created and start configuring and populating your Gallery.