I’ve installed the current Nextcloud on Debian 11.6 and Apache 2 and it was all working correctly.
I need to switch the user that apache runs under from www-data to another user. I’ve set the user and group in the apache env file and chmoded all the filed and directories used by www-data.
Apache loads correctly and I can load the login page of Nextcloud, however when I attempt to log in with a known valid username and password, it appears to load in but I get redirected back to the login screen without any error. I also can’t see any errors in the apache 2 logs or system logs.
Reverting the apache user and file owner to www-data allows the user to log in again. If the user is logged in before the switch, reloading after the switch seems to invalidate the current session, something which does not seem to happen just from shutting down and restarting the apache server.
Does anyone have any idea what’s going on?