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
1232

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
1232

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
448

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

 

#6 2019-12-15 12:23:35

tijmen61
Member
2019-12-11
2

Re: Symlinks for galleries

Hi windracer,

I have installed piwigo using docker-compose, where can I find this Apache config?

Kind Regards,

Tijmen

Offline

 

#7 2019-12-15 15:53:45

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

Re: Symlinks for galleries

I'm not familiar with Docker, but if  it's just a Linux VM/container of some sort, the Apache stuff should be in the same place as usual: /etc/apache2.

I created a piwigo.conf under /etc/apache2/conf-available (symlinked to conf-enabled) that contains the code I'm referring to above.

Offline

 

#8 2020-01-01 18:47:49

Matthew79180
Member
2020-01-01
1

Re: Symlinks for galleries

Hello,

I was having same problem with Piwigo container and symlinks

As explained here : [Github] pigallery2 issue #39

A container can not access a path outside container
But it can if the volume is mapped before deploying container
Then the symlinks need to be to this volume that was previously mapped in the container (see advanced container settings => Volume mapping if you use Portainer, like me with OMV).

For example :

https://www.youtube.com/watch?v=9Gu3PePqLWg
or
https://www.networkshinobi.com/piwigo-o … ediavault/

Mount those volumes

Host path                                        Container path
/srv/dev-disk-by-label-1.42.6-4589/appdata/piwigo        /config
/srv/dev-disk-by-label-1.42.6-4589/photo                /pictures

Where /appdata is a sambashare, so you can access Piwigo config under /appdata/piwigo

Then ssh to linux server (like OMV) in order to create Symlinks :

cd /srv/dev-disk-by-label-1.42.6-7393/appdata/piwigo/www/gallery/galleries
ln -s /pictures/2018 2018
ln -s /pictures/2019 2019

'2018' and '2019' folders in '/srv/dev-disk-by-label-1.42.6-4589/photo' contain pictures

When you deploy again Piwigo container, pictures are automaticaly synchronized.

As the Piwigo version I am using is deployed with Nginx, I have added this line under \appdata\piwigo\nginx\nginx.conf and \appdata\piwigo\nginx\site-confs\default in order to enable symlinks, but now I am not sure this is required after doing all of the above :

    disable_symlinks off;

Context to use disable_symlinks: http, server, location

Kind regards

Last edited by Matthew79180 (2020-01-01 18:50:28)

Offline

 

#9 2022-03-20 18:40:51

lelbo
Member
2022-03-20
1

Re: Symlinks for galleries

hello


i have NAS Qnap, and Piwigo install and work.

But

i need syncronize my Picts in local folder.

But Symlink no work. No want Ftp and other.

I want just add folder local...


Tank you lot

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact