lychee-webroot icon indicating copy to clipboard operation
lychee-webroot copied to clipboard

How to install

Open qaywsxedcrfvtgb opened this issue 9 years ago • 15 comments

Hi, I am new to github and to coding, I would like to install this webroot to my lychee on webhosting I own. Can you help me please? Which files I should copy or modify and where? I do not use git...

qaywsxedcrfvtgb avatar Jan 26 '16 09:01 qaywsxedcrfvtgb

Hi, Before starting you should know what is your web server? (apache, nginx, etc..)

Bramas avatar Jan 26 '16 12:01 Bramas

Hi, thank you for reply. I loged in phpMyAdmin, and It say Apache. What now?

qaywsxedcrfvtgb avatar Jan 26 '16 12:01 qaywsxedcrfvtgb

You have to download the plugin and put it in the plugins folder of your lychee. Change the default folder of your website: instead of the root folder of lychee, put the folder of the webroot plugin. add a .htaccess in the folder of the webroot directory with that

RewriteEngine On
RewriteRule ^/uploads/([^\/]+)/(.*)$ /getPhoto.php?type=$1&url=$2   [L] 

Then visit your website and tell me what happen

Bramas avatar Jan 27 '16 21:01 Bramas

So, I downloaded the plugin and I copied it to the plugins folder. But I dont know how to change the default folder of my website, because my lychee is directly in "www" folder. So I added this to my .htaccess file, whicch is also in the "www" folder:

DirectoryIndex plugins/lychee-webroot-master/index.php

RewriteEngine On
RewriteRule ^/uploads/([^\/]+)/(.*)$ /getPhoto.php?type=$1&url=$2   [L]

But nothing has changed and photos inside password protected folders are still accessible with direct link.

What did I do wrong?

qaywsxedcrfvtgb avatar Jan 29 '16 12:01 qaywsxedcrfvtgb

The root directory of your website can be changed in the configuration of apache (VirtualHost)

Otherwise, you can try this (in the root ie, in www/)

Options -MultiViews
RewriteEngine On 
RewriteBase /
RewriteRule ^uploads/([^\/]+)/(.*)$ plugins/lychee-webroot-master//getPhoto.php?type=$1&url=$2   [L]

Bramas avatar Jan 29 '16 13:01 Bramas

Thanks for reply, It seems that my only chance is to change .htacces, but the code

Options -MultiViews
RewriteEngine On 
RewriteBase /
RewriteRule ^uploads/([^\/]+)/(.*)$ plugins/lychee-webroot-master//getPhoto.php?type=$1&url=$2   [L] 

gives me error 500, internal server error. Maybe this could help in case there is typo somewhere? http://kb.wedos.com/cs/htaccess/mod-rewrite.html (website of my hosting provider)

qaywsxedcrfvtgb avatar Jan 31 '16 21:01 qaywsxedcrfvtgb

I tried quickly, and this works: in the htaccess in the root directory of your Lychee installation:

RewriteEngine On 
RewriteRule ^uploads/([^\/]+)/(.*)$ plugins/lychee-webroot-master/getPhoto.php?type=$1&url=$2   [L]

Also, I fixed a bug so be sure to get the last version

Bramas avatar Feb 02 '16 20:02 Bramas

Thanks again for your time but using this makes my photos not showing. Only the alt description and the icon of "missing" photo appears...

qaywsxedcrfvtgb avatar Feb 02 '16 22:02 qaywsxedcrfvtgb

So, I updated the plugin, and that solved the missing photo icon and the photos are shown properly, but the photos inside locked albums are still accesible with direct link without need to type password...

qaywsxedcrfvtgb avatar Feb 05 '16 13:02 qaywsxedcrfvtgb

It's really strange. Are you sure you're not still connected? Do you try with chrome incognito mode?

Bramas avatar Feb 05 '16 15:02 Bramas

I tried it in incognito mode. Here is link for test photo: http://vplusi.cz/uploads/big/82bb8492a8c0ec4c62b41d9d41b34038.jpg

This is my .htacces:

Options -Indexes

# ---
# Uncomment these lines to change PHP parameters if you are using the PHP Apache module
# ---
#<IfModule mod_php5.c>
#   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
#</IfModule>

# ---
# Uncomment these lines when you want to allow access to the Lychee API from different origins
# ---
#Header add Access-Control-Allow-Origin "*"
#Header add Access-Control-Allow-Headers "origin, x-requested-with, content-type"
#Header add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS"

RewriteEngine On 
RewriteRule ^uploads/([^\/]+)/(.*)$ plugins/lychee-webroot-master/getPhoto.php?type=$1&url=$2   [L]

What about atributes of plugins folder? Does it matter?

qaywsxedcrfvtgb avatar Feb 05 '16 18:02 qaywsxedcrfvtgb

Still not working, dont know what am I doing wrong...

qaywsxedcrfvtgb avatar Mar 14 '16 12:03 qaywsxedcrfvtgb

It works fine with my installation. Are you sure the photo is private? and the album too?
Attention: an album protected with a password is public and there is no way to know if the password has been given, so getPhoto.php always displays the photos that are in an album protected by password.

Bramas avatar Mar 17 '16 19:03 Bramas

So if I understand it correctly, It is not possible to make an album with photos that can´t be accessed with direct link, in case that the album is vissible for evervyone and protected by password at the same time?

qaywsxedcrfvtgb avatar Mar 17 '16 20:03 qaywsxedcrfvtgb

Best way is not to modify .htaccess but Your VirtualHost configuration:

DocumentRoot /var/www/lychee/plugins/webroot  
RewriteEngine On
RewriteRule ^/uploads/([^\/]+)/(.*)$ /getPhoto.php?type=$1&url=$2   [L]

daftu avatar May 04 '16 10:05 daftu