1.先上配置
2.安装位置情况
Apache默认配置未动,网页根目录在/var/www/html,Apache2 Debian Default Page默认放在根目录即/var/www/html下。
Nextcloud按官方文档说明Installation on Linux — Nextcloud latest Administration Manual latest documentation,放在/var/www/nextcloud目录下,apache配置文件如官方说明nextcloud.conf。
Alias /nextcloud "/var/www/nextcloud/"
<Directory /var/www/nextcloud/>
Require all granted
AllowOverride All
Options FollowSymLinks MultiViews
<IfModule mod_dav.c>
Dav off
</IfModule>
</Directory>
3.出现提示问题
您的网页服务器未正确设置以解析“/.well-known/caldav”。更多信息请参见文档。
您的网页服务器未正确设置以解析“/.well-known/carddav”。更多信息请参见文档。
您的网页服务器未正确设置以解析”/.well-known/webfinger”。更多信息请参见文档。
您的网页服务器未正确设置以解析”/.well-known/nodeinfo”。更多信息请参见文档。
4.解决方法
首先在/etc/apache2/sites-available/000-default.conf中<VirtualHost *:80>与</VirtualHost>之间添加如下内容:
<Directory /var/www/html>
AllowOverride All
</Directory>
然后在在/var/www/html下添加.htaccess文件,写入内容:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^\.well-known/carddav /nextcloud/remote.php/dav [R=301,L]
RewriteRule ^\.well-known/caldav /nextcloud/remote.php/dav [R=301,L]
RewriteRule ^\.well-known/webfinger /nextcloud/index.php/.well-known/webfinger [R=301,L]
RewriteRule ^\.well-known/nodeinfo /nextcloud/index.php/.well-known/nodeinfo [R=301,L]
</IfModule>
systemctl reload apache2.service重启apache,问题解决。