Location : Web Hosting - Web Hosting Knowledge Base - Gallery 2 Tutorial

Gallery 2 installation Tutorial

Installing Gallery 2 photo album organizer is quite straight forward, just follow steps below carefully and you should be able to setup a basic online photo album within minutes.

Preparing hosting account

Gallery 2 requires PHP and MySQL to run, and a typical Linux server will have both of this setup properly.

Create a Gallery 2 data folder

FTP in to your hosting account and create a folder /home/username/g2data, set the folder permission to CHMOD 777, note that this folder is set away from the public_html to avoid the folder being able to access from the web while still maintain enough permissions for the webserver to write to the folder.

Create a MySQL database

You will need to create a MySQL database for the Gallery 2 installation, remember to write down the database connection information after created the database, you will need them later :-

  • DB Hostname: localhost
  • DB Username: myacctusr_mydbusr
  • DB Password: password_set_for_myacctusr_mydbusr
  • DB Name: myacctusr_mydbname

Preparing and Running the Gallery 2 installation

When you have the needed folder /home/username/g2data and mysql database created, you can proceed on to installing Gallery 2 :-

  1. Visit Gallery 2 official site and download the latest gallery 2 zip file
  2. Uncompress the file and go through the readme file to get an overall understanding of the program and what is to be done
  3. FTP upload it to your hosting account, place it in the appropriate folder in your hosting account :-

    public_html if you want to access gallery by entering http://www.yourdomain.com
    public_html/gallery2/ if you want to access gallery by entering http://www.yourdomain.com/gallery2/

  4. Open up your browser and enter the URL to the Gallery 2 installation folder http://www.yourdomain.com/gallery2/install/
  5. There will be eleven steps to complete the web installation process, not to worry as most of them are just a click to complete
  6. Welcome : In the first welcome screen, select the desired language and hit Begin Installation
  7. Authentication : You are required to copy the authorization code shown in this screen and paste it to a new text file and name it login.txt file, FTP upload this login.txt file into your Gallery 2 program folder. After uploading the file, click Authenticate Me to proceed to next step
  8. System Checks : Gallery installation script will then perform a series of checks on your hosting account to ensure it is ready for Gallery, check the errors and act accordingly , most of them are related to PHP default values and you can set them through entering them in the .htaccess file in your Gallery 2 program folder, if you are unsure of what to do with the errors, just copy the messages on screen and include it in a support request, web host technical support should be able to help you through. If there is no error, hit Continue to Step 2
  9. Installation Type : Select Standard installation and hit Continue to Step 4
  10. Storage Setup : In the Directory Path field, enter the gallery 2 data folder you have created earlier /home/username/g2data and click Save
  11. Database Setup : Enter the database connection info you have copied down earlier here :-

    • Database Type: MySQL (all versions)
    • DB Hostname: localhost
    • DB Username: myacctusr_mydbusr
    • DB Password: password_set_for_myacctusr_mydbusr
    • DB Name: myacctusr_mydbname
    • Table Prefix: g2_
    • Column Prefix: g_

    Click Save When done.
  12. Admin User Setup : Setup an admin user for the gallery program :-

    • Admin username: admin
    • Password: password_for_admin
    • (type again): password_for_admin
    • Admin email address: yourname@yourdomain.com
    • Admin full name (optional): Gallery Administrator

    Click Create when done.
  13. Create config file : Before clicking the Create config file, FTP into your hosting account and create a file config.php in your gallery 2 program folder, set the file permission to CHMOD 666, after setting up the file, click Create config file to allow gallery 2 to save important configuration data to the config.php file
  14. Install Gallery Core : This is an information screen showing gallery installation process has installed the core program files in your hosting account, if there is no error, click Continue to step 9
  15. Install other modules : Gallery offer a list of modules that you can add to your gallery website, for the installation, we will just accept the default setup, you can always install these modules after the installation by login to the gallery administration screen.
  16. Check Security : You will need to FTP in to your hosting account and set the file permission for config.php back to CHMOD 644 again, this is to avoid your config.php file from being modified by others, click Check again when done to ensure you pass the security check, if there is no more security risk, click Continue to Step 11
  17. Finished : This is a information screen showing that you have completed the installation process and your new gallery website is ready for action