From de65618c9634a06b8bdf2298a48c339e0de1e864 Mon Sep 17 00:00:00 2001 From: Giorgio Caculli <40541342+GiorgioCaculli@users.noreply.github.com> Date: Tue, 20 May 2025 11:22:56 +0200 Subject: [PATCH] Update example_openbsd.rst Configuration updated based on OpenBSD 7.7 setup. - PHP 8.2 for current 7.7 installation - Rewriting of httpd.conf to follow configuration tips from: https://github.com/nixbitcoin/OpenBSD-Nextcloud/blob/master/README.md The current httpd configuration will not load the interface properly for Nextcloud 30.0.10 installed via pkg_add, adapting it with nixbitcoin's configuration leads it to load the interface properly and show various components to the user. Signed-off-by: Giorgio Caculli <40541342+GiorgioCaculli@users.noreply.github.com> --- admin_manual/installation/example_openbsd.rst | 57 ++++++++----------- 1 file changed, 23 insertions(+), 34 deletions(-) diff --git a/admin_manual/installation/example_openbsd.rst b/admin_manual/installation/example_openbsd.rst index 71776fbd4..0773ec42e 100644 --- a/admin_manual/installation/example_openbsd.rst +++ b/admin_manual/installation/example_openbsd.rst @@ -15,7 +15,7 @@ From a base installed OpenBSD system you can just do:: The extra packages:: - # pkg_add postgresql-server redis pecl74-redis php-pdo_pgsql + # pkg_add postgresql-server redis pecl82-redis php-pdo_pgsql This will take care of your dependencies and give you the options to choose which PHP version do you want. @@ -27,7 +27,11 @@ Create a virtualhost in ``/etc/httpd.conf`` and add the following content to it: server "domain.tld" { listen on egress tls port 443 - hsts max-age 15768000 + hsts { + max-age 15768000 + preload + subdomains + } tls { certificate "/etc/ssl/domain.tld_fullchain.pem" @@ -40,59 +44,44 @@ Create a virtualhost in ``/etc/httpd.conf`` and add the following content to it: connection request timeout 3600 connection timeout 3600 - block drop + root "/nextcloud" + directory index "index.php" # Ensure that no '*.php*' files can be fetched from these directories - location "/nextcloud/config/*" { + location "/config/*" { block drop } - location "/nextcloud/data/*" { + location "/data/*" { block drop } # Note that this matches "*.php*" anywhere in the request path. location "/nextcloud/*.php*" { - root "/nextcloud" - request strip 1 fastcgi socket "/run/php-fpm.sock" + } + + location "/apps/*" { pass } - location "/nextcloud/apps/*" { - root "/nextcloud" - request strip 1 + location "/core/*" { pass } - location "/nextcloud/core/*" { - root "/nextcloud" - request strip 1 - pass - } - - location "/nextcloud" { - block return 301 "$DOCUMENT_URI/index.php" - } - - location "/nextcloud/" { - block return 301 "$DOCUMENT_URI/index.php" - } - location "/.well-known/carddav" { - block return 301 "https://$SERVER_NAME/nextcloud/remote.php/dav" + block return 301 "https://$SERVER_NAME/remote.php/dav" } location "/.well-known/caldav" { - block return 301 "https://$SERVER_NAME/nextcloud/remote.php/dav" + block return 301 "https://$SERVER_NAME/remote.php/dav" } location "/.well-known/webfinger" { - block return 301 "https://$SERVER_NAME/nextcloud/public.php?service=webfinger" + block return 301 "https://$SERVER_NAME/public.php?service=webfinger" } - location match "/nextcloud/ocs-provider/*" { - directory index index.php + location match "/ocs-provider/*" { pass } } @@ -106,7 +95,7 @@ Make sure that httpd(8) is enabled and started:: PHP --- -Assuming that you are on OpenBSD -current (or >= 6.8-stable) you could use PHP 7.4 so I will keep this version, but the concept is the same for other version. +Assuming that you are on OpenBSD -current (or >= 6.8-stable) you could use PHP 8.2 so I will keep this version, but the concept is the same for other version. The PHP packages will be available since you installed Nextcloud with pkg_add, so you just need to adjust a bit your php.ini. @@ -129,13 +118,13 @@ And increase some limits:: We can enable the PHP modules with:: - # cd /etc/php-7.4.sample - # for i in *; do ln -sf ../php-7.4.sample/$i ../php-7.4/; done + # cd /etc/php-8.2.sample + # for i in *; do ln -sf ../php-8.2.sample/$i ../php-8.2/; done And then we just enable and start PHP:: - # rcctl enable php74_fpm - # rcctl start php74_fpm + # rcctl enable php82_fpm + # rcctl start php82_fpm Database