Nextcloud sub path domain

I installed nextcloud in the /var/www/html/nextcloud folder using the following tutorial: https://websiteforstudents.com/install-nextcloud-on-ubuntu-16-04-lts-with-apache2-mariadb-php-7-1-and-lets-encrypt-ssl-tls/

Now every time I access my my-domain.com it redirects me to my-domain.com/nextcloud How do I leave my-domain.com empty to be added to another website? My server is ubuntu 17 running apache

You can install it in
/var/www/html instead of /var/www/html/nextcloud

It’s this line in your configuration you have to change from:

DocumentRoot /var/www/html/nextcloud/

to:

DocumentRoot /var/www/html/

I made this change, now at mydomain.com it gives the following error:

Internal Server Error
The server encountered an internal error and was unable to complete your request.

Please contact your server administrator if this error reappears multiple times, please include the technical details below in your report.

More details can be found in the server log.

So, what does the server log say?

If you follow that tutorial by blindly copy those config files, it is time you read a bit about what you had pasted. Focus on lines that involve /var/www/html <-> /var/www/html/nextcloud should be enough.

One more step ahead, for letsencrypt to auto renew, you need to update the conf file in /etc/letsencrypt/renewal/ for the same “path issue” as well.