Nextcloud Internal Server Error new install

This is a new install on Tubleweed in VirtualBox VM.
These are the steps I followed:
Install openSUSE 15.1 or 15.2 or Tumbleweed
with Generic Desktop
Include pattern lamp_server
Disable firewall
Enable SSH

systemctl enable mysql.service
systemctl start mysql.service

mysqladmin -u root password aPasswd
mysql -u root -p
create database nextcloud;
create user nextclouduser identified by ‘aPasswd’;
grant all privileges on nextcloud.* to nextclouduser identified by ‘aPasswd’;
exit;

zypper in nextcloud

cd /srv/www/htdocs/nextcloud/config
cp config.sample.php config.php
chown wwwrun:www config.php
nano config.php
73 0 => ‘localhost’,
983 ‘path’=> ‘/srv/www/htdocs/nextcloud/apps’

a2enmod php7
a2enmod rewrite
a2enmod headers
a2enmod env
a2enmod dir
a2enmod ssl
a2enmod mime

systemctl enable apache2.service
systemctl start apache2.service

mkdir /mnt/nextcloud
chmod -R 0770 /mnt/nextcloud
chown wwwrun /mnt/nextcloud

firefox http://localhost/nextcloud

Internal Server Error

The server was unable to complete your request.
If this happens again, please send the technical details below to the server administrator.
More details can be found in the server log.
Technical details

Remote Address: 172.172.172.172
Request ID: tvvhB5hxNLkb2MES3dqh

Rebooting didn’t help

Checking around this seems to be a fairly common problem however the “fixes” didn’t help this one.
There is no /var/log/nextcloud.log
/var/log/apache2/access_log just shows the connection from Firefox.
/var/log/apache2/error_log has no errors.

I’m obviously missing something.
Thank you for your help.
Bob

nextcloud keeps its logs in the data dir, ie /srv/www/htdocs/nextcloud/data/nextcloud.log

Error 500 can be anything: bad php version, missing deps, bad fs perms, whatever. I don’t see any obvious problem with your setup. Though I would suggest going docker. Two images/containers with a few volmounts and you are good to go. There is really no point in going bare metal when there are official docker images for both services. Keeping all the deps in sync is a pain and specifically tumbleweed sometimes breaks php. Last time was when some php mod pulled php8

The same thing happened when I used 15.1 and 15.2.
I changed log path to /srv/www/htdocs/nextcloud/data/ but no joy though there is a log now.
I didn’t get error 500, unless that is what Internal Server Error means.
The worst part of this is Nextcloud worked the first time I installed it. I forgot to write down the password and couldn’t get in to finish configuring it.

I haven’t worked with Docker. Do you have a link?
Thanks

It is impossible to pinpoint the problem without even a few hints from logs. There are just too many parts that can fail. Most likely it is something simple like a misconfiguration.

If you have never used docker, then that would not be a quick solution as it takes some time to get the hang of it. But if you play a lot with servers like web or db, then it is well worth the initial effort. There are tons of tutorials on YT. Just avoid the ones showing a Unitiy desktop. The official nextcloud docker images is here

https://hub.docker.com/_/nextcloud

and since I am somewhat bored. let me try to slap a startup script together…


#! /bin/bash -x

# nextcloud-mariadb docker poc
# you need to have docker installed and its systemd service running, podman-docker would also work but for now stay with docker
# point your browser at http://localhost:8080 with admin:admin

# extend with volmounts for persistence
# add an ssl proxy in front or mod the nextcloud image to do ssl

docker run -d --name db \
  -e MARIADB_ALLOW_EMPTY_ROOT_PASSWORD=true \
  -e MYSQL_DATABASE=nextcloud \
  -e MYSQL_USER=nextcloud \
  -e MYSQL_PASSWORD=nextcloud \
  mariadb:10.5

sleep 10

docker run -ti --name nextcloud \
  --link db \
  -p 8080:80 \
  -e MYSQL_HOST=db \
  -e MYSQL_DATABASE=nextcloud \
  -e MYSQL_USER=nextcloud \
  -e MYSQL_PASSWORD=nextcloud \
  -e NEXTCLOUD_ADMIN_USER=admin \
  -e NEXTCLOUD_ADMIN_PASSWORD=admin \
  nextcloud:22

# once you ctrl-c this will remove the containers
docker rm -f nextcloud
docker rm -f db



If you’re in the US and a foodie, you’d not miss hardee’s breakfast hours. Get to know What time is Hardees starting its breakfast service? What time does the chain stop serving breakfast here?

I’m sure glad you were bored. Your script helped a lot.
Can we keep this thread going or should I start a new thread with these questions?
-e NEXTCLOUD_TRUSTED_DOMAINS=172.16.172.*
What gets added to include outside of the LAN?

What permissions does it need to write here?
-e NEXTCLOUD_DATA_DIR=/mnt/nextcloud/data \

Right now I’m getting:
Error Cannot create or write into the data directory /mnt/nextcloud/data

Thank you.

In my original post the steps to install included:
cd /srv/www/htdocs/nextcloud/config
cp config.sample.php config.php
chown wwwrun:www config.php
nano config.php
73 0 => ‘localhost’,
983 ‘path’=> ‘/srv/www/htdocs/nextcloud/apps’

This is what caused the “Internal Server Error”
Don’t do that and all is well.
I tried to get Docker to work but I can’t seem to wrap my head around it

Thanks and now I’m off exploring the world of Nextcloud.