lychee-webroot
lychee-webroot copied to clipboard
How to install
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...
Hi, Before starting you should know what is your web server? (apache, nginx, etc..)
Hi, thank you for reply. I loged in phpMyAdmin, and It say Apache. What now?
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
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?
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]
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)
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
Thanks again for your time but using this makes my photos not showing. Only the alt description and the icon of "missing" photo appears...
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...
It's really strange. Are you sure you're not still connected? Do you try with chrome incognito mode?
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?
Still not working, dont know what am I doing wrong...
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.
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?
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]