Skip to content

Commit da918c9

Browse files
authored
Add instructions for hosting Lychee in a subpath with Apache (#103)
* Add instructions for serving Lychee in a subpath with Apache * Fixing syntax towards uniform style.
1 parent f247c50 commit da918c9

File tree

2 files changed

+60
-2
lines changed

2 files changed

+60
-2
lines changed

docs/advanced-setups.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,4 +290,63 @@ To avoid latency when clicking Diagnostics, my suggestion is to disable BasicPer
290290
### Limitations to be considered
291291
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.
292292

293+
## Hosting Lychee in a subpath with Apache
294+
295+
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.
296+
297+
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).
298+
299+
Before getting started, make sure your system qualifies the [Server Requirements](installation.html#server-requirements).
300+
301+
### Setup Lychee
302+
303+
Clone the repository to outside the web root, e.g. `/var/www/`:
304+
305+
```bash
306+
sudo git clone https://www.github.com/LycheeOrg/Lychee /var/www/
307+
```
308+
309+
Set the file ownership and permissions:
310+
311+
```bash
312+
sudo chown -R www-data:www-data /var/www/Lychee
313+
sudo chmod -R 2775 /var/www/Lychee
314+
```
315+
316+
Install composer in `/var/www/Lychee` as instructed in [here](https://getcomposer.org/download/). Then, from `/var/www/Lychee`, install the project dependencies:
317+
318+
```bash
319+
sudo -u www-data php composer.phar install --no-dev
320+
```
321+
322+
### Setup Apache
323+
324+
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`.
325+
326+
```apacheconf
327+
Alias /photos /var/www/Lychee/public
328+
329+
<Directory /var/www/Lychee/public>
330+
Options FollowSymLinks
331+
AllowOverride All
332+
Require all granted
333+
</Directory>
334+
```
335+
336+
Finally, restart Apache:
337+
338+
```bash
339+
sudo service apache2 restart
340+
```
341+
342+
### Configure Lychee
343+
344+
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:
345+
346+
```bash
347+
APP_URL=https://my.url/photos/
348+
```
349+
350+
Done!
351+
293352
</div>

docs/faq_installation.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ location @lychee {
6161

6262
### Can I host Lychee with a subpath with Apache? Like `https://example.dev/lychee/`
6363

64-
Yes, just create a Symbolic Link and allow your apache configuration to follow them.
65-
At website.com root `ln -s Lychee/public pics` and you will get exactly what you want: `website.com/pics`
64+
Yes, the process is described [here](advanced-setups.html#hosting-lychee-in-a-subpath-with-apache).
6665

6766
### Do we really need writable `app/`?
6867

0 commit comments

Comments
 (0)