In this tutorial we will show you how to install Gallery3 on Ubuntu 14.04. For those of you who didn’t know, Gallery3 is an open source photo sharing web application, based on PHP and MySQL. Gallery 3 has intuitive photo management administration and you can use it into your own website no matter whether you’re running a small personal site or a large community portal.
This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Gallery3 in Ubuntu 14.04 server.
Install Gallery3 on Ubuntu 14.04
Step 1. First of all make sure that all packages are up to date.
1 2 | apt-getupdate apt-getupgrade |
Step 2. Install LAMP server and include some PHP extension.
1 2 3 | sudoapt-getinstallapache2 sudoapt-getinstallmysql-server sudoapt-getinstallphp5php5-cliphp5-gdphp5-commonphp5-mysqlphp5-mbstring |
Next, edit your PHP configuration file and set the following:
1 2 | ### nano /etc/php5/apache2/php.ini short_open_tag=On |
Start service Apache web server and MySQL also enable it to start on boot of the server:
1 2 | /etc/init.d/apache2start /etc/init.d/mysqlstart |
Step 3. Configure MySQL Database for Gallery3.
By default, MySQL is not hardened. You can secure MySQL using the mysql_secure_installation script. you should read and below each steps carefully which will set root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MySQL.
1 | mysql_secure_installation |
Next we will need to log in to the MySQL console and create a database for Gallery3. Run the following command:
1 | mysql-uroot-p |
This will prompt you for a password, so enter your MySQL root password and hit Enter. Once you are logged in to your database server you need to create a database for the Gallery3 software:
1 2 3 | mysql>CREATEDATABASEgallery3; mysql>GRANTALLONgallery3.*TOgallery3@localhostIDENTIFIEDBY'54YfQndxln'; mysql>\q |
Step 4. Install Gallery3.
Download the latest stable version of Gallery3, At the moment of writing this article it is version 3.0.9:
1 2 3 4 | wget-O/tmp/gallery3.ziphttp://downloads.sourceforge.net/project/gallery/gallery3/3.0.9/gallery-3.0.9.zip unzip-d/var/www/html/tmp/gallery3.zip cd/var/www/html/gallery3 chownwww-data:-R../gallery3/ |
Step 5. Accessing Gallery3.
Gallery3 will be available on HTTP port 80 by default. Open your favorite browser and navigate to http://yourdomain.com/gallery3 or http://server-ip/gallery3 and complete the required the steps to finish the installation. If you are using a firewall, please open port 80 to enable access to the control panel.
Congratulation’s! You have successfully installed Gallery3. Thanks for using this tutorial for installing Gallery3 in Ubuntu 14.04 system. For additional help or useful information, we recommend you to check the official Gallery3 web site.