Piwigo on OMV5 via Portainer - Quick Install

    • Offizieller Beitrag

    Go to the guides section of this forum and look for a guide by macom on setting up Nextcloud/Letsencrypt. It has the pattern for a safe online deploy that will do what you want. I’m away from my computer right now or I would give you the link. Just modify the yml file you have running to include Swag, which is what Letsencrypt is now called. You will also need a domain name, which is where DuckDNS comes in.

    • Offizieller Beitrag

    Re the shared folders, I am using OMV5 for this and I should have seen my error here but I was using this guide, and, typical me, I just followed along blindly! Do you guys think I need to move stuff, will this be okay going forwards?

    If you created this folder "sharedfolders" the pictures (end everything else in it) will end up on your root filesystem. That is probably not what you want.

    On OMV4 "sharedfolders" were created when creating a shared folder and were pointing to another filesystem.

    You can check on which filesystem a folder is, if you cd into that folder and type df .

    Note the "." at the end. It stands for "current directory".

  • Go to the guides section of this forum and look for a guide by macom on setting up Nextcloud/Letsencrypt. It has the pattern for a safe online deploy that will do what you want. I’m away from my computer right now or I would give you the link. Just modify the yml file you have running to include Swag, which is what Letsencrypt is now called. You will also need a domain name, which is where DuckDNS comes in.

    Great stuff, I will go and root around to find that.


    It would be great to be able to send this to the family so that they all had access to it.


    Thanks for your help, much appreciated.


    EDIT: Thank you, I have found the guide.

    I ride bikes a long way.
    longbikejourney.com


    omv 6.9.2-1 (Shaitan) | 64 bit | Linux 6.1.0-0.deb11.11-amd64 | Intel(R) Xeon(R) CPU E3-1220 V2 @ 3.10GHz | Dell PowerEdge R210 8GB RAM

    Einmal editiert, zuletzt von Nick0 ()

  • If you created this folder "sharedfolders" the pictures (end everything else in it) will end up on your root filesystem. That is probably not what you want.

    On OMV4 "sharedfolders" were created when creating a shared folder and were pointing to another filesystem.

    You can check on which filesystem a folder is, if you cd into that folder and type df .

    Note the "." at the end. It stands for "current directory".

    Ah, so this is is basically on the thumb drive (system drive)? That's not good as I suppose it'll be full up in no time!


    Here's what I have:


    root@omvpeR210up: /sharedfolders# df .


    Filesystem: /dev/sdc1

    1K-blocks: 7020032

    Used: 608558

    Available: 558128

    Use%: 92%

    Mounted on: /


    Its obvious to me now, /sharedfolders is on the root drive as can be seen by the forward slash at the command prompt and also by the output of df . The mariadb-photos and piwigo directories should be stored in a directory on one of my data drives (first two devices in left column) :


    dev-disk-by-uuid-4ca5a313-a7f8-46fc-9434-d29c6e83fbc7 ftp

    dev-disk-by-uuid-81765f11-ef08-48ae-a597-e891180b2df2 pillar

    f86f37f0-c4cf-4576-a93b-a6be71977269 salt


    So I will need to move the mariadb-photo and piwigo directories out of sharedfolders to somewhere on the data drive? Then I suppose that I update piwigo to tell it where this new location is?


    OK, I'm glad that Agricola and your good self found this further incompetence of mine out as I am very near to filling up the system drive.


    I'm going to poke around in the data drive to see where I might move things to. I'm probably going to need some help again here unless you have a 'how-to' you could send me, or I am happy to register on the Piwigo forums and ask there if you've had enough of me!


    Have to say that I am learning heaps and really starting to enjoy doing new things with the CL, which was like some sort of black magic to me not that long ago that I just blindly pasted stuff into when told. Now I am starting to understand and learn how to work out things for myself.


    Thank you!

    Nick.

    I ride bikes a long way.
    longbikejourney.com


    omv 6.9.2-1 (Shaitan) | 64 bit | Linux 6.1.0-0.deb11.11-amd64 | Intel(R) Xeon(R) CPU E3-1220 V2 @ 3.10GHz | Dell PowerEdge R210 8GB RAM

    • Offizieller Beitrag

    Here is a small how-to for moving the folders.


    1. stop the container for piwigo and mariadb in portainer
    2. move the folders for piwigo and mariadb from directory sharedfolders to one of the data drives (but not on the mergerfs mountpoint)
    3. modify the docker-compose files for the piwido stack so the volumes now point on the new location on the data drives
    4. deploy the modified stack
  • OK, many thanks - that's great.


    I have spent some time doing this but I am faced with the install screen when I navigate to the IP address where Piwigo should be.


    Here are the steps I took.


    1. Stop the containers for piwigo and mariadb in portainer


    2. Move directories (and contents) mariadb-photo and piwigo out of /sharedfolders/appdata and into /srv/dev-disk-by-uuid-81765f11-ef08-48ae-a597-e891180b2df2/appdata


    Using:


    root@omvpeR210up:/sharedfolders/appdata# mv * /srv/dev-disk-by-uuid-81765f11-ef08-48ae-a597-e891180b2df2/appdata


    Later, I will delete /sharedfolders


    3. Modify the stack so the volumes now point to the new location on the data drive...


    Line 11 from: - /sharedfolders/appdata/piwigo:/config to - /srv/dev-disk-by-uuid-81765f11-ef08-48ae-a597-e891180b2df2/piwigo:/config

    Line 27 from: - /sharedfolders/appdata/mariadb-photo:/config to - /srv/dev-disk-by-uuid-81765f11-ef08-48ae-a597-e891180b2df2/mariadb-photo:/config


    4. Deploy the stack.


    Then I checked the containers and they were running.


    Thanks,

    Nick.

    I ride bikes a long way.
    longbikejourney.com


    omv 6.9.2-1 (Shaitan) | 64 bit | Linux 6.1.0-0.deb11.11-amd64 | Intel(R) Xeon(R) CPU E3-1220 V2 @ 3.10GHz | Dell PowerEdge R210 8GB RAM

    Einmal editiert, zuletzt von Nick0 ()

  • Yes, well spotted - need to concentrate more!


    Both lines needed the appdata directory in them, so now we have:


    - /srv/dev-disk-by-uuid-81765f11-ef08-48ae-a597-e891180b2df2/appdata/piwigo:/config

    and

    - /srv/dev-disk-by-uuid-81765f11-ef08-48ae-a597-e891180b2df2/appdata/mariadb-photo:/config


    But now I get this:


    Warning: mysqli::__construct(): (HY000/2002): Connection refused in /config/www/gallery/include/dblayer/functions_mysqli.inc.php on line 52
    Warning: my_error(): Couldn't fetch mysqli in /config/www/gallery/include/dblayer/functions_mysqli.inc.php on line 848
    Warning: my_error(): Couldn't fetch mysqli in /config/www/gallery/include/dblayer/functions_mysqli.inc.php on line 848


    Piwigo encountered a non recoverable erro

    Code
    [mysql error ] Can't connect to server
    
    #1	my_error /config/www/gallery/include/common.inc.php(113)
    #2	include_once /config/www/gallery/index.php(11)

    Sorry about this...

    I ride bikes a long way.
    longbikejourney.com


    omv 6.9.2-1 (Shaitan) | 64 bit | Linux 6.1.0-0.deb11.11-amd64 | Intel(R) Xeon(R) CPU E3-1220 V2 @ 3.10GHz | Dell PowerEdge R210 8GB RAM

  • Thanks, this is great!


    OK, so the original appdata directory was in /sharedfolders.


    root@omvpeR210up:/sharedfolders# ls -al

    drwxr-xr-x 2 root root 4096 Jan 6 15:57 appdata


    New appdata permissions are:


    root@omvpeR210up:/srv/dev-disk-by-uuid-81765f11-ef08-48ae-a597-e891180b2df2# ls -al

    drwxr-sr-x 4 root users 4096 Jan 6 15:55 appdata


    Permissions on mariadb-photo and piwigo are


    root@omvpeR210up:/srv/dev-disk-by-uuid-81765f11-ef08-48ae-a597-e891180b2df2/appdata# ls -al

    drwxr-sr-x 4 nick users 4096 Jan 4 11:11 mariadb-photo

    drwxr-sr-x 7 nick users 4096 Jan 4 11:11 piwigo


    So, we have:

    Original appdata: owner rwe; group r-x; users r-x

    And all new directories: owner rwx; group r-s; users r-x


    So there is indeed a difference, it would seem. So I know what the rwx stand for, but the 's'? setuid/setgid permissions, says the internet, but all a bit above my head.


    So, do I change the permissions?


    Thanks!

    Nick.


    EDIT: OK, so I have changed permissions to:


    drwxr-xr-x 4 root users 4096 Jan 6 15:55 appdata

    drwxr-xr-x 4 nick users 4096 Jan 4 11:11 mariadb-photo

    drwxr-xr-x 7 nick users 4096 Jan 4 11:11 piwigo


    No change though. :thumbdown:

    I ride bikes a long way.
    longbikejourney.com


    omv 6.9.2-1 (Shaitan) | 64 bit | Linux 6.1.0-0.deb11.11-amd64 | Intel(R) Xeon(R) CPU E3-1220 V2 @ 3.10GHz | Dell PowerEdge R210 8GB RAM

    Einmal editiert, zuletzt von Nick0 ()

  • Okay, thanks so much for all of your help! I see they have forums for Piwigo so I am going to go and trawl through them. I've learned so much doing this and you've been so patient to teach me.


    Cheers,

    Nick.

    I ride bikes a long way.
    longbikejourney.com


    omv 6.9.2-1 (Shaitan) | 64 bit | Linux 6.1.0-0.deb11.11-amd64 | Intel(R) Xeon(R) CPU E3-1220 V2 @ 3.10GHz | Dell PowerEdge R210 8GB RAM

  • In the end, I rolled back the system to a previous incarnation, before I had installed Piwigo, then I ended up setting Piwigo up my third (and final) server. This will be a dedicated place for me to put the photos gallery, a development site for a website that I am doing as a favour for somebody, and a backup of the system (OMV) disk. It will all be on a 500GB drive, and I have another 500GB drive in the bay next door to it.


    Tagging the photos is going to take forever, there are about 20 years worth of them, and I would need a backup of the website, and system backup directory. What would be the best way to back this up? I basically want to make a copy of the drive (mirror it to the spare drive?), that I can plug in after unplugging the old (damaged) drive.


    If possible, I would like this automated. One problem I can see already is that the Piwigo install will refer to a different drive uuid.


    Tell me if I should post this elsewhere, please.


    Thank you,

    Nick.

    I ride bikes a long way.
    longbikejourney.com


    omv 6.9.2-1 (Shaitan) | 64 bit | Linux 6.1.0-0.deb11.11-amd64 | Intel(R) Xeon(R) CPU E3-1220 V2 @ 3.10GHz | Dell PowerEdge R210 8GB RAM

    • Offizieller Beitrag

    What would be the best way to back this up? I basically want to make a copy of the drive (mirror it to the spare drive?)

    Rsync. Here's a pic of a mirrored backup between two disks on the same machine. It is run from Scheduled Jobs.

    If you want to backup your media folder to a disk on another (backup) server on the same lan, the two following pics are how I do that. These two pics are from the backup server. This is run from the Rsync plugin.

    If you want to have versioned backups then Rsnapshot plugin is what you want.

  • Hi Agricola,


    Many thanks, so rsync is the way to go! That's great as I already have rsync jobs on my two old desktops. Thanks for the pictures as that makes it very easy!


    The only concern I have is that the mirrored drive will have a different uuid to the old one and will that caus me problems with Piwigo as the stack refers to the uuid of the current disk:


    volumes:

    - /srv/dev-disk-by-uuid-81765f11-ef08-48ae-a597-e891180b2df2/piwigo:/config


    ... or is this just a simple matter of changing the uuid to match the new disk if ever they were swapped over?


    Thanks again!

    Nick.

    I ride bikes a long way.
    longbikejourney.com


    omv 6.9.2-1 (Shaitan) | 64 bit | Linux 6.1.0-0.deb11.11-amd64 | Intel(R) Xeon(R) CPU E3-1220 V2 @ 3.10GHz | Dell PowerEdge R210 8GB RAM

    Einmal editiert, zuletzt von Nick0 ()

    • Offizieller Beitrag

    Lets say, you need to adjust the path. As you know until recent the filesystems were mounted "by-label" before that and now again they are mounted by UUID. So you need to check how drives are mounted if/when you have to swap them.


    And it is usually best to test those things before you need them ;)

    • Offizieller Beitrag

    Nick0 it magic. All of the data is there, right down to your shared folders. If you were to ssh into your server and cd to the backup disk and run ls -al you would get a list of all of them, but you don’t need to do that. In crashtest ’s Getting Started guide there is a section on mirrored backup that walks you through repointing your shares. It starts on page 60. It’s an easy read. Now it will break file paths in your containers and your docker storage path, but that’s easy to fix.

  • Lets say, you need to adjust the path. As you know until recent the filesystems were mounted "by-label" before that and now again they are mounted by UUID. So you need to check how drives are mounted if/when you have to swap them.


    And it is usually best to test those things before you need them ;)

    Yes, these will be using the uuids, since they are very recent installations of OMV5. Very good idea that I check before I need them - I will defo do that. :thumbup:

    Nick0 it magic. All of the data is there, right down to your shared folders. If you were to ssh into your server and cd to the backup disk and run ls -al you would get a list of all of them, but you don’t need to do that. In crashtest ’s Getting Started guide there is a section on mirrored backup that walks you through repointing your shares. It starts on page 60. It’s an easy read. Now it will break file paths in your containers and your docker storage path, but that’s easy to fix.

    Great, many thanks and I'll be heading over to page 60 soon!


    But first...


    In my excitement in getting the last server up-and-running, I hurredly reinstalled Piwiko, and somehow set up Docker and portainer on one of the other servers. What a weapons grade idiot! Anyway, it all works fine but I don't like the fact that 192.168.1.201 holds Docker/Portainer, and 192.168.1.37 holds the Piwiko files and directories.


    So, I have set up Docker/Portainer on the .37 server and I remember that the IP address of the Piwigo database (container) needs to be set in Piwigo, during setup, (part 5 in the guide at the top of this thread). i.e. Piwigo needs to know where the database is kept. So, I now know that .120 server database is at 172.17.0.3 and the .37 database is at 172.17.0.4, so this is going to need to be set in Piwigo, somewhere.


    I have ssh'd into the server and downloaded a copy of good ole functions_mysqli.inc.php, but the IP is not to be found in there, so the question is, do you guys know where I need to go to change this?


    I am truly sorry for this stupid mistake. The good thing is though, with every mess up i make, I seem to learn heaps more stuff - I know this benefits me, rather than you, but I'm sure you know that everything you are teaching me is much appreciated! :D


    All the best,

    Nick.

    I ride bikes a long way.
    longbikejourney.com


    omv 6.9.2-1 (Shaitan) | 64 bit | Linux 6.1.0-0.deb11.11-amd64 | Intel(R) Xeon(R) CPU E3-1220 V2 @ 3.10GHz | Dell PowerEdge R210 8GB RAM

    • Offizieller Beitrag

    Are you saying you set your Docker storage path to a disk on another server? I'm confused. How do you do that trick?

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!