我刚刚在我的 Ubuntu 服务器上安装了 Nextcloud。按照文档中的步骤操作,但在我应该看到 Nextcloud 首页在本地主机端口 80 上运行的时候,我收到了“禁止访问。您无权访问此资源”。
尽管我跑了sudo chown -R www-data:www-data /var/www/html/nextcloud
,而且
sudo chmod -R 755 /var/www/html/nextcloud
端口 80 被允许进入ufw
,并且 Apache 在检查其状态时报告“活动”。
我还需要检查什么?
访问日志:
86.178.239.208 - neo [16/Aug/2020:14:31:21 +0100] "PROPFIND /remote.php/webdav/Photos/com.ubuntu.camera HTTP/1.1" 207 1254 "-" "gvfs/1.44.1"
86.178.239.208 - neo [16/Aug/2020:14:31:21 +0100] "PROPFIND /remote.php/webdav/Photos/com.ubuntu.camera HTTP/1.1" 207 1254 "-" "gvfs/1.44.1"
86.178.239.208 - neo [16/Aug/2020:14:31:23 +0100] "PROPFIND /remote.php/webdav/Photos HTTP/1.1" 207 1236 "-" "gvfs/1.44.1"
86.178.239.208 - neo [16/Aug/2020:14:31:23 +0100] "PROPFIND /remote.php/webdav/Photos/com.ubuntu.camera HTTP/1.1" 207 1254 "-" "gvfs/1.44.1"
86.178.239.208 - neo [16/Aug/2020:14:31:23 +0100] "PROPFIND /remote.php/webdav/Photos/ HTTP/1.1" 207 3874 "-" "gvfs/1.44.1"
86.178.239.208 - neo [16/Aug/2020:14:31:30 +0100] "PROPFIND /remote.php/webdav HTTP/1.1" 207 1795 "-" "gvfs/1.44.1"
86.178.239.208 - neo [16/Aug/2020:14:31:30 +0100] "PROPFIND /remote.php/webdav/Photos HTTP/1.1" 207 1236 "-" "gvfs/1.44.1"
86.178.239.208 - neo [16/Aug/2020:14:31:30 +0100] "PROPFIND /remote.php/webdav HTTP/1.1" 207 3655 "-" "gvfs/1.44.1"
86.178.239.208 - neo [16/Aug/2020:14:31:35 +0100] "PROPFIND /remote.php/webdav/Photos HTTP/1.1" 207 1236 "-" "gvfs/1.44.1"
86.178.239.208 - neo [16/Aug/2020:14:31:35 +0100] "PROPFIND /remote.php/webdav/Photos/com.ubuntu.camera HTTP/1.1" 207 1254 "-" "gvfs/1.44.1"
86.178.239.208 - neo [16/Aug/2020:14:31:35 +0100] "PROPFIND /remote.php/webdav/Photos/ HTTP/1.1" 207 3874 "-" "gvfs/1.44.1"
86.178.239.208 - neo [16/Aug/2020:14:33:09 +0100] "PROPFIND /remote.php/caldav/calendars/neo/personal/ HTTP/1.1" 207 5345 "-" "Evolution/3.36.4"
196.216.92.201 - - [16/Aug/2020:15:50:51 +0100] "GET / HTTP/1.1" 403 440 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36"
212.3.160.181 - - [16/Aug/2020:16:09:22 +0100] "GET / HTTP/1.1" 403 440 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36"
89.248.167.131 - - [16/Aug/2020:16:37:07 +0100] "GET / HTTP/1.1" 403 440 "-" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"
89.248.167.131 - - [16/Aug/2020:16:37:07 +0100] "GET /robots.txt HTTP/1.1" 403 440 "-" "-"
89.248.167.131 - - [16/Aug/2020:16:37:07 +0100] "GET /sitemap.xml HTTP/1.1" 403 440 "-" "-"
89.248.167.131 - - [16/Aug/2020:16:37:08 +0100] "GET /.well-known/security.txt HTTP/1.1" 403 440 "-" "-"
89.248.167.131 - - [16/Aug/2020:16:37:08 +0100] "GET /favicon.ico HTTP/1.1" 403 496 "-" "python-requests/2.10.0"
127.0.0.1 - - [16/Aug/2020:16:41:24 +0100] "GET /nextcloud HTTP/1.1" 403 491 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0"
127.0.0.1 - - [16/Aug/2020:16:41:58 +0100] "GET / HTTP/1.1" 403 491 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0"
127.0.0.1 - - [16/Aug/2020:16:46:52 +0100] "GET /nextcloud HTTP/1.1" 403 491 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0"
错误日志:
[Sun Aug 16 16:58:41.249455 2020] [mpm_prefork:notice] [pid 3254] AH00169: caught SIGTERM, shutting down
[Sun Aug 16 16:59:51.034763 2020] [mpm_prefork:notice] [pid 1043] AH00163: Apache/2.4.29 (Ubuntu) OpenSSL/1.1.1g configured -- resuming normal operations
[Sun Aug 16 16:59:51.182429 2020] [core:notice] [pid 1043] AH00094: Command line: '/usr/sbin/apache2'
[Sun Aug 16 17:16:46.340199 2020] [authz_core:error] [pid 1099] [client 127.0.0.1:43050] AH01630: client denied by server configuration: /var/www/html/nextcloud/nextcloud
[Sun Aug 16 17:18:48.842398 2020] [authz_core:error] [pid 1095] [client 185.39.11.105:36758] AH01630: client denied by server configuration: /var/www
nextcloud.conf:
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html/nextcloud
ServerName utcloud.ddns.net
Alias /nextcloud "/var/www/html/nextcloud/"
<Directory /var/www/html/nextcloud/>
Require all granted
AllowOverride All
Options FollowSymLinks MultiViews
<IfModule mod_dav.c>
Dav off
</IfModule>
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
上述配置由 拉取apache2.conf
。
答案1
事实证明,我必须禁用默认配置,/etc/apache2/sites-available/000-default.conf
该配置也会路由到端口 80。它基本上占据了 nextclouds 配置文件的位置。一旦禁用,nextcloud.conf
就会启动。