{"id":12877,"date":"2019-03-29T00:38:52","date_gmt":"2019-03-29T00:38:52","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=12877"},"modified":"2019-03-29T00:38:52","modified_gmt":"2019-03-29T00:38:52","slug":"lychee-a-great-looking-photo-management-system-for-linux","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/29\/lychee-a-great-looking-photo-management-system-for-linux\/","title":{"rendered":"Lychee \u2013 A Great Looking Photo Management System for Linux"},"content":{"rendered":"<p><strong>Lychee<\/strong>\u00a0is a free, open source, elegant and easy-to-use photo-management system, which comes with all the necessary features you need for securely managing and sharing photos on your server. It allows you to easily manage (upload, move, rename, describe, delete or search) your photos in seconds from a simple web application.<\/p>\n<div id=\"attachment_31138\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/12\/Lychee-Photo-Management.jpeg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-31138\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/12\/Lychee-Photo-Management.jpeg\" sizes=\"auto, (max-width: 1070px) 100vw, 1070px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/12\/Lychee-Photo-Management.jpeg 1070w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/12\/Lychee-Photo-Management-768x661.jpeg 768w\" alt=\"Lychee Photo Management Tool\" width=\"1070\" height=\"921\" aria-describedby=\"caption-attachment-31138\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-31138\" class=\"wp-caption-text\">Lychee Photo Management Tool<\/p>\n<\/div>\n<h4>Lychee Features<\/h4>\n<ul>\n<li>A stunning, beautiful interface to manage all your photos in one place, right from your browser.<\/li>\n<li>One click photo and album sharing with password protection.<\/li>\n<li>View all your images in full-screen mode with forward and backward navigation using your keyboard or let others browse your photos by making them public.<\/li>\n<li>Supports importing of photos from various sources: localhost, Dropbox, remote server, or using a link.<\/li>\n<\/ul>\n<p>To install Lychee, everything you need is a running web-server such as\u00a0<strong>Apache<\/strong>\u00a0or\u00a0<strong>Nginx<\/strong>\u00a0with\u00a0<strong>PHP 5.5<\/strong>\u00a0or later and a\u00a0<strong>MySQL-Database<\/strong>.<\/p>\n<p>For the purpose of this article, I will be installing\u00a0<strong>Lychee<\/strong>\u00a0photo-management system with\u00a0<strong>Nginx<\/strong>,\u00a0<strong>PHP-FPM 7.0<\/strong>and\u00a0<strong>MariaDB<\/strong>\u00a0on a\u00a0<a href=\"https:\/\/www.linode.com\/?r=64ebb9f723fed8b32fda84b6594006df08ad24b6\" target=\"_blank\" rel=\"nofollow noopener\">CentOS 7 VPS<\/a>\u00a0with domain name\u00a0<strong>lychee.example.com<\/strong>.<\/p>\n<h3>Step 1: Install Nginx, PHP and MariaDB<\/h3>\n<p><strong>1.<\/strong>\u00a0First start by installing\u00a0<strong>Nginx<\/strong>,\u00a0<strong>PHP<\/strong>\u00a0with needed extensions and\u00a0<strong>MariaDB<\/strong>\u00a0database to setup a hosting environment to run\u00a0<strong>Lychee<\/strong>.<\/p>\n<h4>On Cent\/RHEL 7<\/h4>\n<pre># yum install https:\/\/dl.fedoraproject.org\/pub\/epel\/epel-release-latest-7.noarch.rpm\r\n# yum install http:\/\/rpms.remirepo.net\/enterprise\/remi-release-7.rpm\r\n# yum install yum-utils\r\n# yum-config-manager --enable remi-php70   [Install PHP 7.0]\r\n# yum install nginx php php-fpm php-mysqli php-exif php-mbstring php-json php-zip php-gd php-imagick mariadb-server mariadb-client\r\n<\/pre>\n<h4>On Ubuntu 16.04 and 18.04<\/h4>\n<pre>$ sudo apt install nginx php php-fpm php-mysqli php-exif php-mbstring php-json php-zip php-gd php-imagick mariadb-server mariadb-client\r\n<\/pre>\n<p><strong>2.<\/strong>\u00a0Once you have installed the necessary packages, start\u00a0<strong>nginx<\/strong>,\u00a0<strong>php-fpm<\/strong>\u00a0and\u00a0<strong>mariadb<\/strong>\u00a0services, enable them at boot time and check if these services are up and running.<\/p>\n<pre><strong>------------ CentOS\/RHEL ------------<\/strong>\r\n# systemctl start nginx php-fpm mariadb\r\n# systemctl status nginx php-fpm mariadb\r\n# systemctl enable nginx php-fpm mariadb\r\n<\/pre>\n<pre><strong>------------ Debian\/Ubuntu ------------<\/strong>\r\n$ sudo systemctl start nginx php7.0-fpm mysql\r\n$ sudo systemctl status nginx php7.0-fpm mysql\r\n$ sudo systemctl enable nginx php7.0-fpm mysql\r\n<\/pre>\n<p><strong>3.<\/strong>\u00a0Next, if you have a firewall enabled on your system, you need to open the port\u00a0<strong>80<\/strong>\u00a0and\u00a0<strong>443<\/strong>\u00a0in the firewall to allow client requests to the\u00a0<strong>Nginx<\/strong>\u00a0web server on the\u00a0<strong>HTTP<\/strong>\u00a0and\u00a0<strong>HTTPS<\/strong>\u00a0respectively, as shown.<\/p>\n<pre><strong>------------ Debian\/Ubuntu ------------<\/strong>\r\n$ sudo  ufw  allow 80\/tcp\r\n$ sudo  ufw  allow 443\/tcp\r\n$ sudo  ufw  reload\r\n<\/pre>\n<pre><strong>------------ CentOS\/RHEL ------------<\/strong>\r\n# firewall-cmd --zone=public --permanent --add-port=80\/tcp\r\n# firewall-cmd --zone=public --permanent --add-port=443\/tcp\r\n# firewall-cmd --reload\r\n<\/pre>\n<p><strong>4.<\/strong>\u00a0In order to run\u00a0<strong>Lychee<\/strong>\u00a0effectively, it is recommended to increase the values of the following properties in\u00a0<code>php.ini<\/code>\u00a0file.<\/p>\n<pre># vim \/etc\/php\/php.ini\t\t\t#CentOS\/RHEL\r\n$ sudo vim \/etc\/php\/7.0\/fpm\/php.ini     #Ubuntu\/Debian \r\n<\/pre>\n<p>Search for these PHP parameters and change their values to:<\/p>\n<pre>max_execution_time = 200\r\npost_max_size = 100M\r\nupload_max_size = 100M\r\nupload_max_filesize = 20M\r\nmemory_limit = 256M\r\n<\/pre>\n<p><strong>5.<\/strong>\u00a0Now configure\u00a0<strong>PHP-FPM<\/strong>\u00a0to set the user and group, listen socket\u00a0<code>www.conf<\/code>\u00a0file as explained.<\/p>\n<pre># vim \/etc\/php-fpm.d\/www.conf\t\t        #CentOS\/RHEL\r\n$ sudo vim \/etc\/php\/7.0\/fpm\/pool.d\/www.conf\t#Ubuntu\/Debian\r\n<\/pre>\n<p>Look for the directives below to set the Unix user\/group of processes (change\u00a0<strong>www-data<\/strong>\u00a0to\u00a0<strong>nginx<\/strong>\u00a0on\u00a0<strong>CentOS<\/strong>).<\/p>\n<pre>user = www-data\r\ngroup = www-data\r\n<\/pre>\n<p>Also change the\u00a0<strong>listen<\/strong>\u00a0directive on which to accept\u00a0<strong>FastCGI<\/strong>\u00a0requests to a Unix socket.<\/p>\n<pre>listen = \/run\/php\/php7.0-fpm.sock\r\n<\/pre>\n<p>And set the appropriate ownership permissions for the Unix socket using the directive (change\u00a0<strong>www-data<\/strong>\u00a0to\u00a0<strong>nginx<\/strong>\u00a0on\u00a0<strong>CentOS\/RHEL<\/strong>).<\/p>\n<pre>listen.owner = www-data\r\nlisten.group = www-data\r\n<\/pre>\n<p>Save the file and restart the\u00a0<strong>nginx<\/strong>\u00a0and\u00a0<strong>php-fpm<\/strong>\u00a0services.<\/p>\n<pre># systemctl restart nginx php-fpm              #CentOS\/RHEL\r\n$ sudo systemctl restart nginx php7.0-fpm      #Ubuntu\/Debian\r\n<\/pre>\n<h3>Step 2: Secure MariaDB Installation<\/h3>\n<p><strong>6.<\/strong>\u00a0In this step, you should secure the\u00a0<strong>MariaDB<\/strong>\u00a0database installation (which is unsecured by default if installed on a fresh system), by running the security script which comes with the binary package.<\/p>\n<p>Run the following command as root, to launch the the script.<\/p>\n<pre>$ sudo mysql_secure_installation\r\n<\/pre>\n<p>You will be prompted to set a\u00a0<strong>root<\/strong>\u00a0password, remove anonymous users, disable root login remotely and remove test database. After creating a root password, and answer\u00a0<code>yes\/y<\/code>\u00a0to the rest of questions.<\/p>\n<pre>Enter current password for root (enter for none):\r\nSet root password? [Y\/n] <code>y<\/code> Remove anonymous users? [Y\/n] <code>y<\/code> Disallow root login remotely? [Y\/n] <code>y<\/code> Remove test database and access to it? [Y\/n] <code>y<\/code> Reload privilege tables now? [Y\/n] <code>y<\/code><\/pre>\n<h3>Step 3: Install Lychee Photo Management System<\/h3>\n<p><strong>7.<\/strong>\u00a0To install\u00a0<strong>Lychee<\/strong>, first you need to create a database for it with appropriate permissions using following commands.<\/p>\n<pre>$ sudo mysql -u root -p\r\n<strong>MariaDB [(none)]&gt;<\/strong> CREATE DATABASE lychee; \r\n<strong>MariaDB [(none)]&gt;<\/strong> CREATE USER 'lycheeadmin'@'localhost' IDENTIFIED BY '=@!#@%$Lost';\r\n<strong>MariaDB [(none)]&gt;<\/strong> GRANT ALL PRIVILEGES ON  lychee.* TO 'lycheeadmin'@'localhost';\r\n<strong>MariaDB [(none)]&gt;<\/strong> FLUSH PRIVILEGES;\r\n<strong>MariaDB [(none)]&gt;<\/strong> exit\r\n<\/pre>\n<div class=\"google-auto-placed ap_container\">\n<p><strong>8.<\/strong>\u00a0Next, move into the web document root and grab the latest version of\u00a0<strong>Lychee<\/strong>\u00a0using the\u00a0<a href=\"https:\/\/www.tecmint.com\/use-git-version-control-system-in-linux\/\" target=\"_blank\" rel=\"noopener\">git command line tool<\/a>, as shown.<\/p>\n<pre>$ cd \/var\/www\/html\/\r\n$ sudo git clone --recurse-submodules https:\/\/github.com\/LycheeOrg\/Lychee.git\r\n<\/pre>\n<p><strong>9.<\/strong>\u00a0Then set the correct permissions and ownership on the installation directory as shown (replace\u00a0<strong>admin<\/strong>\u00a0with a username on your system).<\/p>\n<pre><strong>------------ CentOS\/RHEL ------------<\/strong>\r\n# chown admin:nginx -R \/var\/www\/html\/Lychee\r\n# chmod 775 -R \/var\/www\/html\/Lychee\r\n<\/pre>\n<pre><strong>------------ Debian\/Ubuntu ------------<\/strong>\r\n$ sudo chown admin:www-data -R \/var\/www\/html\/Lychee\r\n$ sudo chmod 775  -R \/var\/www\/html\/Lychee\r\n<\/pre>\n<p><strong>10.<\/strong>\u00a0In this step, you need to setup\u00a0<strong>composer<\/strong>\u00a0in the\u00a0<strong>lychee<\/strong>\u00a0installation directory, which will be used to install PHP dependencies.<\/p>\n<pre># cd Lychee\/\r\n# php -r \"copy('https:\/\/getcomposer.org\/installer', 'composer-setup.php');\"\r\n# php -r \"if (hash_file('sha384', 'composer-setup.php') === '93b54496392c062774670ac18b134c3b3a95e5a5e5c8f1a9f115f203b75bf9a129d5daa8ba6a13e2cc8a1da0806388a8') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;\"\r\n# php composer-setup.php\r\n# php -r \"unlink('composer-setup.php');\"\r\n# php composer.phar update\r\n<\/pre>\n<h3>Step 4: Configure Nginx Server Block for Lychee<\/h3>\n<p><strong>12.<\/strong>\u00a0Next, you need to create and configure a Nginx server block for the\u00a0<strong>Lychee<\/strong>\u00a0application under\u00a0<strong>\/etc\/nginx\/conf.d\/<\/strong>.<\/p>\n<pre># vim \/etc\/nginx\/conf.d\/lychee.conf\r\n<\/pre>\n<p>Add the following configuration in the above file, remember to use your own domain name instead of\u00a0<strong>lychee.example.com<\/strong>\u00a0(this is just a dummy domain).<\/p>\n<pre>server {\r\n\tlisten      80;\r\n\tserver_name\t <strong>lychee.example.com<\/strong>;\r\n\troot         \t\/var\/www\/html\/Lychee\/;\r\n\tindex       \tindex.html;\r\n\r\n\tcharset utf-8;\r\n\tgzip on;\r\n\tgzip_types text\/css application\/javascript text\/javascript application\/x-javascript \timage\/svg+xml text\/plain text\/xsd text\/xsl text\/xml image\/x-icon;\r\n\tlocation \/ {\r\n\t\ttry_files $uri $uri\/ \/index.php?$query_string;\r\n\t}\r\n\tlocation ~ \\.php {\r\n\t\tinclude fastcgi.conf;\r\n\t\tfastcgi_split_path_info ^(.+\\.php)(\/.+)$;\r\n\t\tfastcgi_pass unix:\/run\/php\/php7.0-fpm.sock;\r\n\t}\r\n\tlocation ~ \/\\.ht {\r\n\t\tdeny all;\r\n\t}\r\n}\r\n<\/pre>\n<div class=\"google-auto-placed ap_container\">\n<p>Then save the file and restart the\u00a0<strong>Nginx<\/strong>\u00a0web server and\u00a0<strong>PHP-FPM<\/strong>\u00a0to apply the recent changes.<\/p>\n<pre># systemctl restart nginx php-fpm              #CentOS\/RHEL\r\n$ sudo systemctl restart nginx php7.0-fpm      #Ubuntu\/Debian\r\n<\/pre>\n<h3>Step 5: Complete Lychee Installation Via Web Browser<\/h3>\n<p><strong>13.<\/strong>\u00a0Now use the URL\u00a0<code>lychee.example.com<\/code>\u00a0to open Lychee web installer in your browser and provide your database connection settings and enter the name of the database you created for lychee and click\u00a0<strong>Connect<\/strong>.<\/p>\n<div id=\"attachment_31139\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/12\/Lychee-Database-Settings.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-31139\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/12\/Lychee-Database-Settings.png\" sizes=\"auto, (max-width: 912px) 100vw, 912px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/12\/Lychee-Database-Settings.png 912w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/12\/Lychee-Database-Settings-768x621.png 768w\" alt=\"Lychee Database Settings\" width=\"912\" height=\"737\" aria-describedby=\"caption-attachment-31139\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-31139\" class=\"wp-caption-text\">Lychee Database Settings<\/p>\n<\/div>\n<p><strong>14.<\/strong>\u00a0Next, enter a\u00a0<strong>username<\/strong>\u00a0and\u00a0<strong>password<\/strong>\u00a0for your installation and click\u00a0<strong>Create Login<\/strong>. After login, you will land in the admin dashboard which contains the default\u00a0<strong>Albums<\/strong>\u00a0as shown in the following screenshot.<\/p>\n<div id=\"attachment_31140\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/12\/Lychee-Dashboard.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-31140\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/12\/Lychee-Dashboard.png\" sizes=\"auto, (max-width: 912px) 100vw, 912px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/12\/Lychee-Dashboard.png 912w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/12\/Lychee-Dashboard-768x621.png 768w\" alt=\"Lychee Admin Dashboard\" width=\"912\" height=\"737\" aria-describedby=\"caption-attachment-31140\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-31140\" class=\"wp-caption-text\">Lychee Admin Dashboard<\/p>\n<\/div>\n<p>To upload a photo or import from a link or import from\u00a0<strong>Dropbox<\/strong>\u00a0or from another server or add an album, click the\u00a0<code>+<\/code>\u00a0sign. And to view photos in an album, simply click on it.<\/p>\n<p>For more information, visit Lychee Homepage:\u00a0<a href=\"https:\/\/lycheeorg.github.io\/\" target=\"_blank\" rel=\"nofollow noopener\">https:\/\/lycheeorg.github.io\/<\/a><\/p>\n<p><strong>Lychee<\/strong>\u00a0is an open source, easy-to-use and elegant PHP photo-management system to manage and share photos. If you have any questions or comments, use the form below to write to us.<\/p>\n<p><a style=\"font-size: 1rem;\" href=\"https:\/\/www.tecmint.com\/lychee-photo-management-system-for-linux\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Lychee\u00a0is a free, open source, elegant and easy-to-use photo-management system, which comes with all the necessary features you need for securely managing and sharing photos on your server. It allows you to easily manage (upload, move, rename, describe, delete or search) your photos in seconds from a simple web application. Lychee Photo Management Tool Lychee &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/29\/lychee-a-great-looking-photo-management-system-for-linux\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Lychee \u2013 A Great Looking Photo Management System for Linux&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-12877","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12877","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=12877"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12877\/revisions"}],"predecessor-version":[{"id":12878,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12877\/revisions\/12878"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=12877"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=12877"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=12877"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}