Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to install #1

Open
qaywsxedcrfvtgb opened this issue Jan 26, 2016 · 15 comments
Open

How to install #1

qaywsxedcrfvtgb opened this issue Jan 26, 2016 · 15 comments

Comments

@qaywsxedcrfvtgb
Copy link

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...

@Bramas
Copy link
Owner

Bramas commented Jan 26, 2016

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

@qaywsxedcrfvtgb
Copy link
Author

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

@Bramas
Copy link
Owner

Bramas commented Jan 27, 2016

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

@qaywsxedcrfvtgb
Copy link
Author

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?

@Bramas
Copy link
Owner

Bramas commented Jan 29, 2016

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]

@qaywsxedcrfvtgb
Copy link
Author

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)

@Bramas
Copy link
Owner

Bramas commented Feb 2, 2016

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

@qaywsxedcrfvtgb
Copy link
Author

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
Copy link
Author

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...

@Bramas
Copy link
Owner

Bramas commented Feb 5, 2016

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

@qaywsxedcrfvtgb
Copy link
Author

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
Copy link
Author

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

@Bramas
Copy link
Owner

Bramas commented Mar 17, 2016

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.

@qaywsxedcrfvtgb
Copy link
Author

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?

@daftu
Copy link

daftu commented May 4, 2016

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]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants