One of the first thing I’ve been self hosting on my own server was a web photo gallery to let my family, friends, etc… follow some moment of my life, in photo. Facebook and co have never been my taste, as it is clear how they use our data and sell our privacy.
So I wanted to have my own gallery on my own server and at that time, I used Piwigo (I’ve already wrote an article about it) and I keep using it. But if Piwigo does not suit your needs (Want some simpler, etc..) Lychee might be your taste!
Lychee is a free and open source photo management app, to be run on your server. Easy to install (Only require LAMP), it will let you upload, manage and share your pictures in an easy manner.
It supports the XIF and IPTC Metadata and allow you to upload pictures from your computer, but also directly an URL or even from a Dropbox account.
You can have a look to their demo to have a first impression.
Interested to use? Let’s see how to install it!
You will need PHP and MySQL installed on top of a web server (Apache and co). If you don’t have, just check this tutorial.
1) Install the requisites
Lynchee requires the PHP extension exif, gd, json, mbstring, mysql, zip. To install them, simply run: (In root or with sudo)
apt-get install php5-cli php5-gd php5-common php5-mysql
2) Clone their latest release into your /var/www folder
Still in root, run:
git clone https://github.com/electerious/Lychee.git
3) Change the owner of the folder to the Web server user (www-data)
chown -R www-data:www-data /var/www/Lychee
4) Go to the web installer and follow the steps
http://YourIP/Lychee should point to the web installer
You will need to set few things:
– Database credentials
If you use MySQL, I can use PHPMyAdmin to create a dedicated database for Lychee.
– User account and password
When done, you will have a fully working Lychee photo management app, ready to upload all your pictures/photos and share them.
If like me, you wish to extend the upload size (2mb per default with PHP) and want to be able to upload big files in a batch, you will need to change couple of php.ini values or create a dedicated virtualhost with those values in it.
As I want to be able to access to my gallery using a dedicated domain name (Or sub domain) and force the SSL connection, the vhost solution is the must.
What you will need:
1) Create a A redirection in your DNS server/registrar with lyc.domain.tld to your IP
2) Have SSL certificate ready. If not you can read this tutorial. (Optional)
3) Create your virtualhost as following:
In /etc/apache2/sites-enabled/, create a file called lychee (In root):
and paste the following content:
Redirect / https://lyc.domain.tld
Options Indexes FollowSymLinks MultiViews
allow from all
php_value max_execution_time = 200
php_value post_max_size = 200M
php_value upload_max_size = 200M
php_value upload_max_filesize = 20M
php_value max_file_uploads = 100
php_value memory_limit = 256M
Adapt the content (Servername, webmaster email, SSL certificate, directory and PHP Values).
When done, save the file (CTRL+X then Yes) and reload apache: (In root)
Lychee should now be accessible through lyc.domain.tld, forcing HTTPS connection and allowing you to upload bigger file size.