Change default landing page NGINX to Nextcloud

Hey guys,
total noob here but got a Nextcloud server up an running thanks to this phenomenal software. Issue I’m having is that when I go to my website the landing page is the default Apache html page . but if I go to mywebsite.com/nextcloud I do end up getting to my server. I was wondering how would I go about changing it so it lands on my nextcloud page.

Heads up I’m a total noob, but I think the reason its showing the Apache page is because I initially had Apache server, then changed it to NGINX.

Hi,

many thanks for your request. In principle it’s correct that you get default web server side displayed as this is document root. Nextcloud is just a sub directory. Anyway before trying to reconfigure web server, let’s check which one is running. Usualy you should get displayed Nginx default website and not Apache. Pls can you post following

dietpi-services status

Dear Joulinar, many thanks for your help ;

Just a heads up I am also running into error in nextcloud when uploading files. 2 of them

  1. Error when assembling chunks, status code 504
  2. will edit report back , forgot what this was but I believe it was 502


    the output you requested:
 Mode: status 

[  OK  ] DietPi-Services | proftpd		active (running) since Sun 2020-07-05 10:45:58 BST; 12h ago
[  OK  ] DietPi-Services | redis-server		active (running) since Sun 2020-07-05 10:45:59 BST; 12h ago
[  OK  ] DietPi-Services | mariadb		active (running) since Sun 2020-07-05 10:46:02 BST; 12h ago
[  OK  ] DietPi-Services | php7.3-fpm		active (running) since Sun 2020-07-05 10:46:03 BST; 12h ago
[  OK  ] DietPi-Services | nginx		active (running) since Sun 2020-07-05 23:38:03 BST; 3min 19s ago
[  OK  ] DietPi-Services | noip2		active (running) since Sun 2020-07-05 10:46:03 BST; 12h ago
[  OK  ] DietPi-Services | netdata		active (running) since Sun 2020-07-05 10:46:03 BST; 12h ago
[  OK  ] DietPi-Services | webmin		active (running) since Sun 2020-07-05 10:46:10 BST; 12h ago
[  OK  ] DietPi-Services | docker		active (running) since Sun 2020-07-05 10:46:10 BST; 12h ago
[  OK  ] DietPi-Services | cron			active (running) since Sun 2020-07-05 10:46:10 BST; 12h ago
[  OK  ] DietPi-Services | ssh			active (running) since Sun 2020-07-05 10:45:56 BST; 12h ago
[  OK  ] DietPi-Services | fail2ban		active (running) since Sun 2020-07-05 10:45:38 BST; 12h ago
[  OK  ] DietPi-Services | vncserver		active (exited) since Sun 2020-07-05 10:45:56 BST; 12h ago
[  OK  ] DietPi-Services | dietpi-ramlog	active (exited) since Sun 2020-07-05 10:45:36 BST; 12h ago
[  OK  ] DietPi-Services | dietpi-preboot	active (exited) since Sun 2020-07-05 10:45:38 BST; 12h ago
[  OK  ] DietPi-Services | dietpi-boot		active (exited) since Sun 2020-07-05 10:45:56 BST; 12h ago
[  OK  ] DietPi-Services | dietpi-postboot	active (exited) since Sun 2020-07-05 10:45:56 BST; 12h ago

ok, I would recommend to redirect all traffic that will arrive on root URL to the nextcloud sub dir. For this, you would need to edit /etc/nginx/sites-available/default and change location section as follow

location = / {
#               try_files $uri $uri/ =404;
                return 301 $scheme://your-site.com/nextcloud;  
}

Once done, restart Nginx

systemctl restart nginx.service

Don’t forget to clear browser cache.

Dear Joulinar,
that fix worked for me , thank you kindly.
I’m reaching out regarding ‘error chunk’ in Nextcloud I get continuously.

based on my research I believe it has to do with redis-server not accurately set up.
Issue 1) my website went down after I did chown www-data something ; I need to fix config permissions and I’m not sure how to troubleshoot this.
i believe the culprit is “usermode -a -G redis www-data” a tip I found on a site

Issue 2) when I run systemctl status redis-server I get a few errors which I believe might be the culprits:

Jul 08 21:01:32 DietPi redis[1568]: Warning: 32 bit instance detected but no memory limit set. Setting
 3 GB maxmemory limit with 'noeviction' policy now.
Jul 08 21:01:33 DietPi redis[1568]: WARNING: The TCP backlog setting of 511 cannot be enforced because
 /proc/sys/net/core/somaxconn is set to the lower value of 128.
Jul 08 21:01:33 DietPi redis[1568]: Server initialized
Jul 08 21:01:33 DietPi redis[1568]: WARNING overcommit_memory is set to 0! Background save may fail un
der low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the comm
and 'sysctl vm.overcommit_memory=1' for this to take effect.

looks like this is quite a common issue https://help.nextcloud.com/t/unsolved-error-when-assembling-chunks-status-code-504/57205

In attempts to fix the chunking error I believe something broke:

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.

can you check if all services are running? Looks like some something wrong with PHP

All services are running; this happened right after I did something with permissions and redis

systemctl redis:

Jul 08 22:45:22 DietPi redis-server[597]: 597:C 08 Jul 2020 22:45:22.555 # Redis version=5.0.3, bits=32, commit=00000000, modi
fied=0, pid=597, just started
Jul 08 22:45:22 DietPi redis-server[597]: Redis version=5.0.3, bits=32, commit=00000000, modified=0, p
id=597, just started
Jul 08 22:45:22 DietPi redis-server[597]: 597:C 08 Jul 2020 22:45:22.556 # Configuration loaded
Jul 08 22:45:22 DietPi redis-server[597]: Configuration loaded
Jul 08 22:45:22 DietPi redis[598]: Warning: 32 bit instance detected but no memory limit set. Setting 
3 GB maxmemory limit with 'noeviction' policy now.
Jul 08 22:45:22 DietPi systemd[1]: redis-server.service: Can't open PID file /run/redis/redis-server.pid (yet?) after start: N
o such file or directory
Jul 08 22:45:22 DietPi redis[598]: WARNING: The TCP backlog setting of 511 cannot be enforced because 
/proc/sys/net/core/somaxconn is set to the lower value of 128.
Jul 08 22:45:22 DietPi redis[598]: Server initialized
Jul 08 22:45:22 DietPi redis[598]: WARNING overcommit_memory is set to 0! Background save may fail und
er low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the comma
nd 'sysctl vm.overcommit_memory=1' for this to take effect.
Jul 08 22:45:22 DietPi systemd[1]: Started Advanced key-value store.

ls -alt /run/redis/

  • seems odd ; especially since its redis redis and not www-data here ?
total 4
drwxr-xr-x 23 root  root  720 Jul  8 22:45 ..
drwxr-sr-x  2 redis redis  80 Jul  8 22:45 .
-rw-rw----  1 redis redis   4 Jul  8 22:45 redis-server.pid
srwxrwx---  1 redis redis   0 Jul  8 22:45 redis-server.sock

btw I tested the same using lighttpd web server and could easily upload a 1GB file without issues

for me it looks some on redis

root@DietPi3:/run/redis# ls -la
total 4
drwxr-sr-x  2 redis redis  80 Jul  9 01:25 .
drwxr-xr-x 23 root  root  660 Jul  9 01:25 ..
-rw-rw----  1 redis redis   4 Jul  9 01:25 redis-server.pid
srwxrwx---  1 redis redis   0 Jul  9 01:25 redis-server.sock
root@DietPi3:/run/redis#

Roger, I’m actually not even caring about any chunk size error anymore, I just wish I stopped tinkering even if it gives me errors. At this point I can’t even get into the site because of something I did with redis and permissions ;

i believe the culprit is “usermode -a -G redis www-data” a tip I found on a site and I don’t know what impact it had on what I"m facing right now

well you just add a user to a group with this command. this should not impact anything

Hi Joulinar , still working at it . do you think the redis-server might be causing loops?
I think this might be it, working on trying to figure this out. any help thanks

Jul 09 09:13:21 DietPi redis[586]: Could not create serv
er TCP listening socket ::1:6379: bind: Cannot assign requested address
Jul 09 09:13:21 DietPi redis[586]: Warning: 32 bit insta
nce detected but no memory limit set. Setting 3 GB maxmemory limit with 'noevict
ion' policy now.
Jul 09 09:13:21 DietPi systemd[1]: redis-server.service: Can't open PID file /ru
n/redis/redis-server.pid (yet?) after start: No such file or directory

honestly I’m not sure that this is related to redis. I did a test with lighttpd as web server, and I was able to upload a file of 1.2GB without issues. I guess it’s more related to nginx as web server an some time out parameter

Roger,

  1. does changing from nginx to lighttpd entail any changes need to be made in other places or is it automated with dietpi ?

  2. i do believe I have my server up and running tho , good news. several days of troubleshooting.

before changing anything. How many applications you have running using nginx web server? Just Nextcloud or something else.

HI joul.
I just run Nextcloud, NGINX, PHP, REDIS, etc… + one of the desktop environ + Real VNC .
I have pretty much returned back to working state almost. I haven’t been able to try if the lock testing is gone (I think Redis works fine now)
The only errors I am encountering now are nextcloud related:

Error PHP Undefined index: debugMode at /var/www/nextcloud/core/templates/exception.php#26
Error PHP Undefined index: debugMode at /var/www/nextcloud/core/templates/exception.php#17
Fatal webdav OCP\Files\NotPermittedException: Could not create path

it might be good to check on a nextcloud specialised board for the nextcloud errors :wink: