From f1d2b62e6a197d28e4a80e009177cf49b9c34941 Mon Sep 17 00:00:00 2001
From: ildyria Advanced Setups
s3fs-fuse - Instructions from developer
sudo dnf install s3fs-fuse
+sudo dnf install s3fs-fuse
sudo echo ACCESS_KEY_ID:SECRET_ACCESS_KEY > /etc/passwd-s3fs
sudo chmod 600 /etc/passwd-s3fs
Configure SELinux to allow access to the new filesystem
-setsebool -P httpd_use_fusefs 1
+setsebool -P httpd_use_fusefs 1
Setup a permanent mounting point
Create S3 Object mount point:
-sudo mkdir /mnt/bucket
+sudo mkdir /mnt/bucket
-Edit fstab to create a new mount on boot:
-Add the following line to: /etc/fstab
-
-<bucket> /mnt/bucket fuse.s3fs _netdev, allow_other, enable_noobj_cache, url=<s3_endpoint>, use_cache="", passwd_file=/etc/passwd-s3fs, mp_umask=0002 0 0
-
-Example:
- <bucket> mybucket (name used in your cloud provider)
- <s3_endpoint> https://eu-central-1.linodeobjects.com
-
-Parameters are explained below:
- allow_other Allow other users to access the bucket
- mp_umask Mask permissions for mount point
- enable_noobj_cache Performance improvement - Enable when bucket is exclusively used by s3fs
- use_cache="" Disabled
- use_cache=/var/cache/s3fs Enabled (to be used with care, because the cache can grow out of control. Also, I haven't noticed much difference using it)
+Edit fstab to create a new mount on boot:
+Add the following line to: /etc/fstab
+<bucket> /mnt/bucket fuse.s3fs _netdev, allow_other, enable_noobj_cache, url=<s3_endpoint>, use_cache="", passwd_file=/etc/passwd-s3fs, mp_umask=0002 0 0
-Reboot your server to confirm S3 Object Storage is mounted correctly.
-Create Lychee's mount point:
-sudo mkdir /mnt/bucket/uploads
+Example:
+
+ mybucket (name used in your cloud provider)
+ https://eu-central-1.linodeobjects.com
+
+Parameters are explained below:
+
+allow_other
Allow other users to access the bucket
+mp_umask
Mask permissions for mount point
+enable_noobj_cache
Performance improvement - Enable when bucket is exclusively used by s3fs
+use_cache=""
Disabled
+use_cache=/var/cache/s3fs
Enabled (to be used with care, because the cache can grow out of control. Also, I haven't noticed much difference using it)
+
+Reboot your server to confirm S3 Object Storage is mounted correctly.
+Create Lychee's mount point:
+sudo mkdir /mnt/bucket/uploads
Create and run Lychee container
-From now on, Lychee will see the Object Storage mount transparently like any other mount. The container's volume /uploads
needs to point to the new created mount:
-sudo podman run --rm -d --name myphotos -v /mnt/bucket/uploads:/uploads -e PUID=33 -e PGID=1000 ... docker.io/lycheeorg/lychee
+From now on, Lychee will see the Object Storage mount transparently like any other mount.
+The container's volume /uploads
needs to point to the new created mount:
+sudo podman run --rm -d --name myphotos -v /mnt/bucket/uploads:/uploads -e PUID=33 -e PGID=1000 ... docker.io/lycheeorg/lychee
Configure .ENV
To avoid latency when clicking Diagnostics, my suggestion is to disable BasicPermissionCheck. Otherwise, depending on the number of photos in your gallery, this task can take hours.
-```/var/lib/containers/storage/volumes/lychee-conf/_data/.env
- SKIP_DIAGNOSTICS_CHECKS=BasicPermissionCheck
-
-### Limitations to be considered
-As explained before, recursive tasks are penalised in Object Storage, so if you have an existing bucket and the container runs for the first time, it will take long time to review and set the permissions in your mount. Depending on the number of photos, it can take several hours.
-
-## Hosting Lychee in a subpath with Apache
-
-To serve Lychee in a subpath, e.g. `https://my.url/photos/`, we can use Apaches's [Alias](https://httpd.apache.org/docs/2.4/mod/mod_alias.html#alias)-directive.
-
-In this example we assume the web root to be located at `/var/www/html`, the web user and group to be `www-data`, and install [from the master branch](installation.html#from-the-master-branch).
-
-Before getting started, make sure your system qualifies the [Server Requirements](installation.html#server-requirements).
-
-### Setup Lychee
-
-Clone the repository to outside the web root, e.g. `/var/www/`:
-
-```bash
-sudo git clone https://www.github.com/LycheeOrg/Lychee /var/www/
+# /var/lib/containers/storage/volumes/lychee-conf/_data/.env
+SKIP_DIAGNOSTICS_CHECKS=BasicPermissionCheck
+
+Limitations to be considered
+As explained before, recursive tasks are penalised in Object Storage, so if you have an existing bucket and the container runs for the first time, it will take long time to review and set the permissions in your mount. Depending on the number of photos, it can take several hours.
+Hosting Lychee in a subpath with Apache
+To serve Lychee in a subpath, e.g. https://my.url/photos/
, we can use Apaches's Alias-directive.
+In this example we assume the web root to be located at /var/www/html
, the web user and group to be www-data
, and install from the master branch.
+Before getting started, make sure your system qualifies the Server Requirements.
+Setup Lychee
+Clone the repository to outside the web root, e.g. /var/www/
:
+sudo git clone https://www.github.com/LycheeOrg/Lychee /var/www/
Set the file ownership and permissions:
sudo chown -R www-data:www-data /var/www/Lychee
sudo chmod -R 2775 /var/www/Lychee
-Install composer in /var/www/Lychee
as instructed in here. Then, from /var/www/Lychee
, install the project dependencies:
+Install composer in /var/www/Lychee
as instructed in here.
+Then, from /var/www/Lychee
, install the project dependencies:
sudo -u www-data php composer.phar install --no-dev
Setup Apache
-Link https://my.url/photos/
to /var/www/Lychee/public
by adding the following to your Apache configuration for Aliases. In Apache 2.4 running on Debian, the correct configuration file is /etc/apache2/mods-available/alias.conf
.
+Link https://my.url/photos/
to /var/www/Lychee/public
by adding the following to your Apache configuration for Aliases.
+In Apache 2.4 running on Debian, the correct configuration file is /etc/apache2/mods-available/alias.conf
.
Alias /photos /var/www/Lychee/public
<Directory /var/www/Lychee/public>
@@ -379,7 +380,8 @@ Setup Apache
sudo service apache2 restart
Configure Lychee
-
At this point, you should be able to go to https://my.url/photos/
and run the web installer. During the installation procedure, on top of adding the database credentials to match your setup, set your APP_URL
to the served subdirectory:
+At this point, you should be able to go to https://my.url/photos/
and run the web installer.
+During the installation procedure, on top of adding the database credentials to match your setup, set your APP_URL
to the served subdirectory:
APP_URL=https://my.url/photos/
Done!