apache: Make all directory listings more mobile friendly

Closes #2256.

Based on a suggestion by Andrew Betts on the mailing list.
https://alioth-lists.debian.net/pipermail/freedombox-discuss/2022-August/009553.html

Sunil:

- Consolidate changes from various apps into a centralized place in
freedombox.conf applicable for all directory listings.

Tests:

- In Sharing, TiddlyWiki and FeatherWiki apps, directory listing when viewed
with Firefox Developer Tools Mobile view set to a Galaxy S20+ looks reasonable.
Without the patch the page is very zoomed out.

Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Joseph Nuthalapati 2025-07-11 21:30:05 +05:30 committed by Sunil Mohan Adapa
parent 6605460df5
commit 38810e566b
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2

View File

@ -154,3 +154,12 @@ ErrorLog "|/usr/bin/systemd-cat --identifier=apache-error"
# records its own timestamp.
ErrorLogFormat "[%-m:%l] [pid %P:tid %{g}T] %7F: %E: [client\ %a] %M% ,\ referer\ %{Referer}i"
CustomLog "|/usr/bin/systemd-cat --identifier=apache-access" vhost_combined
## When showing an index page for a directory listing, ensure that viewport's
## width is the same as the device's width. Directory index pages generated by
## mod_autoindex are reasonably suitable for mobile devices. However, without
## the directive, mobile devices will assume the page to be not-mobile friendly
## and use a larger view port than the device size.
<IfModule mod_autoindex.c>
IndexHeadInsert "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">"
</IfModule>