Everything seems to be fine, but …
If I put info about php in the root directory
sudo echo "<?php phpinfo(); ?>" | sudo tee /var/www/html/www.example.com/index.php
I see information about php.
If I extract to the nextcloud root directory from the old server, I get an error
sudo tar xvzf ~/backup_nextcloud-2023-10-24-17.05.05.tar.gz -C /
Internal Server Error
The server encountered an internal error and was unable to complete your request.
Please contact the 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.
Regardless of whether I have a database or not, I should see at least some files on the web
http://www.example.com/remote.php
http://www.example.com/public.php
http://www.example.com/status.php
etc.
I always see though Internal Server Error.
File Privilege and Owner
ls -la /var/www/html/www.example.com/config
total 68
drwxr-xr-x 2 www-data www-data 7 Aug 27 05:28 .
drwxr-xr-x 15 www-data www-data 29 Oct 25 21:06 ..
-rw-r----- 1 www-data www-data 1155 Aug 24 15:43 config.php
-rw-r--r-- 1 www-data www-data 74851 May 10 10:19 config.sample.php
-rw-r--r-- 1 www-data www-data 495 May 10 10:19 .htaccess
-rw-r--r-- 1 www-data www-data 78 May 10 10:27 mimetypealiases.json
-rw-r--r-- 1 www-data www-data 110 May 10 10:27 mimetypemapping.json
ls -la /var/www/html/www.example.com
total 203
drwxr-xr-x 15 www-data www-data 29 May 10 10:19 .
drwxr-xr-x 4 www-data www-data 5 Apr 5 2023 ..
drwxr-xr-x 45 www-data www-data 52 May 10 10:19 3rdparty
drwxr-xr-x 52 www-data www-data 52 May 10 10:27 apps
-rw-r--r-- 1 www-data www-data 19327 May 10 10:19 AUTHORS
drwxr-xr-x 2 www-data www-data 7 Aug 27 05:28 config
-rw-r--r-- 1 www-data www-data 4095 May 10 10:19 console.php
-rw-r--r-- 1 www-data www-data 34520 May 10 10:19 COPYING
drwxr-xr-x 24 www-data www-data 30 May 10 10:19 core
-rw-r--r-- 1 www-data www-data 6317 May 10 10:19 cron.php
drwxr-xr-x 2 www-data www-data 5 Aug 27 2021 data
drwxr-xr-x 2 www-data www-data 168 May 10 10:19 dist
-rw-r--r-- 1 www-data www-data 3386 May 10 10:19 .htaccess
-rw-r--r-- 1 www-data www-data 156 May 10 10:19 index.html
-rw-r--r-- 1 www-data www-data 3456 May 10 10:19 index.php
drwxr-xr-x 6 www-data www-data 9 May 10 10:19 lib
-rw-r--r-- 1 www-data www-data 283 May 10 10:19 occ
drwxr-xr-x 2 www-data www-data 3 May 10 10:19 ocm-provider
drwxr-xr-x 2 www-data www-data 5 May 10 10:19 ocs
drwxr-xr-x 2 www-data www-data 3 May 10 10:19 ocs-provider
-rw-r--r-- 1 www-data www-data 3187 May 10 10:19 public.php
-rw-r--r-- 1 www-data www-data 5597 May 10 10:19 remote.php
drwxr-xr-x 4 www-data www-data 8 May 10 10:19 resources
-rw-r--r-- 1 www-data www-data 26 May 10 10:19 robots.txt
-rw-r--r-- 1 www-data www-data 2452 May 10 10:19 status.php
drwxr-xr-x 3 www-data www-data 4 May 10 10:19 themes
drwxr-xr-x 2 www-data www-data 4 Jan 16 2022 updater
-rw-r--r-- 1 www-data www-data 101 May 10 10:19 .user.ini
-rw-r--r-- 1 www-data www-data 383 May 10 10:19 version.php
The database on the old server was backed up as follows
sudo mysqldump nextcloud > ~/nextcloud-$(date +%Y-%m-%d-%H.%M.%S).sql
On the new server
sudo mysql -e 'DROP DATABASE IF EXISTS `nextcloud`'
sudo mysql -e 'CREATE DATABASE `nextcloud`'
sudo mysql nextcloud < nextcloud-2023-10-24-17.03.39.sql
logs
cat /var/log/apache2/example.error
[Tue Oct 24 16:32:45.845645 2023] [autoindex:error] [pid 658:tid 140477282109120] [client 192.168.20.10:35514] AH01276: Cannot serve directory /var/www/html/www.example.com/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive
[Tue Oct 24 16:32:49.575467 2023] [autoindex:error] [pid 657:tid 140477385107136] [client 192.168.20.10:54228] AH01276: Cannot serve directory /var/www/html/www.example.com/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive
[Tue Oct 24 16:32:53.457906 2023] [proxy_fcgi:error] [pid 657:tid 140477401892544] [client 192.168.20.10:54246] AH01071: Got error 'Primary script unknown'
[Tue Oct 24 16:32:55.559757 2023] [proxy_fcgi:error] [pid 657:tid 140477298894528] [client 192.168.20.10:54268] AH01071: Got error 'Primary script unknown'
[Wed Oct 25 20:05:53.412777 2023] [proxy_fcgi:error] [pid 545:tid 139749796845248] [client 192.168.20.10:57578] AH01071: Got error 'Primary script unknown'
[Wed Oct 25 20:05:57.876256 2023] [autoindex:error] [pid 545:tid 139749780059840] [client 192.168.20.10:51732] AH01276: Cannot serve directory /var/www/html/www.example.com/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive
[Wed Oct 25 20:08:56.454724 2023] [autoindex:error] [pid 202:tid 140490761533120] [client 192.168.20.10:34290] AH01276: Cannot serve directory /var/www/html/www.example.com/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive
[Wed Oct 25 20:08:57.507025 2023] [autoindex:error] [pid 203:tid 140490645165760] [client 192.168.20.10:48232] AH01276: Cannot serve directory /var/www/html/www.example.com/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive
[Wed Oct 25 20:08:58.128875 2023] [autoindex:error] [pid 203:tid 140490628380352] [client 192.168.20.10:48248] AH01276: Cannot serve directory /var/www/html/www.example.com/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive
[Wed Oct 25 20:22:31.600223 2023] [proxy_fcgi:error] [pid 203:tid 140490494097088] [client 192.168.20.10:38094] AH01071: Got error 'Primary script unknown'
[Wed Oct 25 20:22:35.986416 2023] [autoindex:error] [pid 203:tid 140490661951168] [client 192.168.20.10:38100] AH01276: Cannot serve directory /var/www/html/www.example.com/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive
cat /var/www/html/www.example.com/data/nextcloud.log
{"reqId":"53f10A6KyYSfvOZiDVEN","level":2,"time":"2021-08-27T19:17:21+00:00","remoteAddr":"192.168.1.1","user":"--","app":"no app in context","method":"GET","url":"/","message":"Could not detect any host in http:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36","version":""}
{"reqId":"53f10A6KyYSfvOZiDVEN","level":2,"time":"2021-08-27T19:17:21+00:00","remoteAddr":"192.168.1.1","user":"--","app":"no app in context","method":"GET","url":"/","message":"Could not detect any host in https:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36","version":""}
{"reqId":"dleK0SwlQ96ZNlNwkUVA","level":2,"time":"2021-08-27T19:17:23+00:00","remoteAddr":"192.168.1.1","user":"--","app":"no app in context","method":"GET","url":"/index.php/apps/photos/service-worker.js","message":"Could not detect any host in http:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36","version":""}
{"reqId":"dleK0SwlQ96ZNlNwkUVA","level":2,"time":"2021-08-27T19:17:23+00:00","remoteAddr":"192.168.1.1","user":"--","app":"no app in context","method":"GET","url":"/index.php/apps/photos/service-worker.js","message":"Could not detect any host in https:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36","version":""}
{"reqId":"84jh8jrZ9YLg0erm6tkz","level":2,"time":"2021-08-27T19:18:10+00:00","remoteAddr":"192.168.1.1","user":"--","app":"no app in context","method":"POST","url":"/index.php","message":"Could not detect any host in http:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36","version":""}
{"reqId":"84jh8jrZ9YLg0erm6tkz","level":2,"time":"2021-08-27T19:18:10+00:00","remoteAddr":"192.168.1.1","user":"--","app":"no app in context","method":"POST","url":"/index.php","message":"Could not detect any host in https:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36","version":""}