Rewritebase / not in effect

Ok, my issue is solved with NC 11. It was a permissions issue. Seems like the whole NC folder needs www-data permissions for the occ command to work.

The files that need to be modified are:

  • nc/.htaccess <-root
  • nc/config/config.php <- www(/-data/run)/http/apache

The issue is that they have different permissions, one is root owned, the other web server owned.
Also occ will run only with web server permissions.

So change permissions to .htaccess first, then run occ, and back again to secure .htaccess.
My two cents.

Pretty URLs

echo "Setting RewriteBase to “/” in config.php…“
chown -R www-data:www-data $NCPATH
sudo -u www-data php $NCPATH/occ config:system:set htaccess.RewriteBase --value=”/"
sudo -u www-data php $NCPATH/occ maintenance:update:htaccess
bash $SCRIPTS/setup_secure_permissions_nextcloud.sh

From https://github.com/nextcloud/vm/blob/master/nextcloud-startup-script.sh#L467-L472

Nice! :+1:

1 Like

When I have to work inside the Nextcloud folder I set permissions to update, when in use I set it to strong.
See scripts in the link: https://cloud.fred-dresken.nl/s/rhQj6SeGuyXzr0T

Yes, that’s exactly what we did in the Nextcloud VM as well. --^ :slight_smile: