How to install Zenphoto on Ubuntu 14.04

Zenphoto_logoZenphoto is a free and open souce, PHP based content management system (CMS) for creating gallery focused websites. Zenphoto features support for various media formats and integrated blog and custom pages. It is the ideal CMS for personal websites of artists, illustrators, photographers, designers, film makers and musicians. In this guide we will explain how to install Zenphoto on an Ubuntu 14.04 VPS.

At the time of writing this tutorial, Zenphoto 1.4.11 is the latest stable version available and it requires:

– Apache web server.
– PHP (version 5.2 or better) with GD graphics library and mbstring extension library.
– MySQL(version 5.0 or better) installed on your Linux VPS.

INSTRUCTIONS:

Login to your VPS via SSH

ssh user@vps_IP

Update the system

[user]$ sudo apt-get update && sudo apt-get -y upgrade

Install MySQL so you can create the database needed. Run the following command:

# apt-get install mysql-server mysql-client

Now run the post-installation script ‘mysql_secure_installation’ in order to set the MySQL root user password:

# mysql_secure_installation

- Set root password? [Y/n] y

- Remove anonymous users? [Y/n] y

- Disallow root login remotely? [Y/n] y

- Remove test database and access to it? [Y/n] y

- Reload privilege tables now? [Y/n] y

So, you set the MySQL root password to your liking. Next thing you need to do is to create a database. Login to your MySQL service as root:

[user]$ mysql -u root -p

mysql> CREATE DATABASE zenphoto;

mysql> GRANT ALL PRIVILEGES ON zenphoto.* TO 'zenphotouser'@'localhost' IDENTIFIED BY 'your-password';

mysql> FLUSH PRIVILEGES;
mysql> \q

Do not forget to replace ‘your-password’ with a strong password.

Install Apache2 web server

[user]$ sudo apt-get install apache2

Install PHP and required PHP modules

To install the latest stable version of PHP and all necessary modules, run:

[user]$ sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt php5-mysql php5-gd

Download and extract the latest version of Zenphoto on your server

[user]$ sudo cd /opt && wget https://github.com/zenphoto/zenphoto/archive/zenphoto-1.4.11.zip
[user]$ sudo unzip zenphoto-1.4.11.zip
[user]$ sudo mv zenphoto-zenphoto-1.4.11/ /var/www/html/zenphoto/

All files have to be readable by the web server, so set the proper ownership:

Need a fast and easy fix?
✔ Unlimited Managed Support
✔ Supports Your Software
✔ 2 CPU Cores
✔ 2 GB RAM
✔ 50 GB PCIe4 NVMe Disk
✔ 1854 GeekBench Score
✔ Unmetered Data Transfer
NVME 2 VPS

Now just $43 .99
/mo

GET YOUR VPS
[user]$ sudo chown www-data:www-data -R /var/www/html/zenphoto

Create a new virtual host directive in Apache. For example, create a new Apache configuration file named ‘zenphoto.conf’ on your virtual server:

[user]$ sudo touch /etc/apache2/sites-available/zenphoto.conf
[user]$ sudo ln -s /etc/apache2/sites-available/zenphoto.conf /etc/apache2/sites-enabled/zenphoto.conf
[user]$ sudo nano /etc/apache2/sites-available/zenphoto.conf

Then, add the following lines:

<VirtualHost *:80>
ServerAdmin admin@your-domain.com
DocumentRoot /var/www/html/zenphoto/
ServerName your-domain.com
ServerAlias www.your-domain.com
<Directory /var/www/html/zenphoto/>
Options FollowSymLinks
AllowOverride All
</Directory>
ErrorLog /var/log/apache2/your-domain.com-error_log
CustomLog /var/log/apache2/your-domain.com-access_log common
</VirtualHost>

Restart the Apache web server for the changes to take effect:

[user]$ sudo service apache2 restart

Open your favorite web browser, navigate to http://your-domain.com/ and if you configured everything correctly the Zenphoto installer should be starting. You should follow the easy instructions on the install screen inserting the necessary information as requested.

Once you finish the installation you can access the admin section at:

http://yourdomain.com/zp-core/admin.php

Of course you don’t have to do any of this if you use one of our Linux VPS Hosting services, in which case you can simply ask our expert Linux admins to install ZenPhoto for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

2 thoughts on “How to install Zenphoto on Ubuntu 14.04”

  1. Thank you for the information but the syntax is incorrect for the mysql sequence. You will need to add the user zenphotouser before the granting of privileges and that statement does not need the IDENTIFIED BY clause.

    Reply
    • The syntax is correct, it is a SQL syntax that creates and grants privileges to a user to access and manage the database. The IDENTIFIED BY is also needed to set the password for the user.

      Reply

Leave a Comment