Announcement

#1 2018-07-22 10:39:16

fbafkis
Member
2018-07-22
2

Symlinks for galleries

Hi everybody!

I have a Centos 7 server. I want to add to piwigo some pictures that I have on another directory (a disk mounted in an point outside of the DocumentRoot of Apache). I tried to create symlinks to this directory in the ./galleries directory in piwigo, but it can't see the links. If I try to go to serveraddress/piwigo/galleries/symlinkfolder I get 403 access denied error.

My problem is that the web server is on a disk with not a lot of storage and the pictures are on another raid system of drives mounted in /mnt directory. Is there a way to import pictures in piwigo from an outside location without copying them physically in the piwigo directory?

Thank you for the support!


Piwigo version: 2.9.4
PHP version: 5.6
MySQL version: 15

Offline

 

#2 2018-07-22 11:12:32

nicolas
Former Piwigo Team
2004-12-30
1176

Re: Symlinks for galleries

Hi,

how did you import the photos you already had in piwigo ? When I see your question, I imagine you import them using the legacy way with synchronize. But as far as I remember I think the script does not follow the symlink (I need to double check).

Offline

 

#3 2018-07-22 11:22:24

nicolas
Former Piwigo Team
2004-12-30
1176

Re: Symlinks for galleries

I read the code and as I said before the process to synchronize directories and database exclude symlink  (or at least only include real files and directories) :

[Github] Piwigo file admin/site_reader_local.php@L91
[Github] Piwigo file admin/site_reader_local.php@L112

Offline

 

#4 2018-07-22 14:35:45

fbafkis
Member
2018-07-22
2

Re: Symlinks for galleries

Yes, I supposed it worked that way. Is there a way to modify the script so that it works with the symlinks too?

Thank you for support!

Offline

 

#5 2018-07-27 02:49:37

windracer
Member
St. Pete, FL
2014-12-28
229

Re: Symlinks for galleries

I use symlinks in my galleries folder:

Code:

20:45:48 /usr/local/piwigo/galleries:$ ls -la
total 12
drwxr-xr-x  2 www-data www-data 4096 Dec 28  2014 .
drwxr-xr-x 13 www-data www-data 4096 Feb 16  2017 ..
lrwxrwxrwx  1 root     root       26 Dec 28  2014 events -> /mnt/media/Pictures/Events
-rwxr-xr-x  1 www-data www-data 1765 Apr 24  2017 index.php
lrwxrwxrwx  1 root     root       24 Dec 28  2014 misc -> /mnt/media/Pictures/Misc
lrwxrwxrwx  1 root     root       26 Dec 28  2014 people -> /mnt/media/Pictures/People
lrwxrwxrwx  1 root     root       26 Dec 28  2014 places -> /mnt/media/Pictures/Places

Make sure you have

Code:

Options FollowSymLinks

in your Apache config for your Piwigo folder. For example:

Code:

<Directory "/usr/local/piwigo/">
        Options FollowSymLinks
        Options +MultiViews -ExecCGI -Includes -Indexes
        IndexIgnore *
        AllowOverride Limit Options FileInfo
        Require all granted
...

Offline

 

Board footer

Powered by FluxBB

github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2019 · Contact