在 Ubuntu 服务器上使用 apache2 的 Nextcloud 服务器安全和设置警告

在 Ubuntu 服务器上使用 apache2 的 Nextcloud 服务器安全和设置警告

在此处输入图片描述

在此我确实尝试解决红色错误:

    • PHP 配置选项 output_buffering 必须被禁用路径:/etc/php/8.1/apache2/php.ini
; output_buffering
;   Default Value: Off
;   Development Value: 4096
;   Production Value: 4096

正如您所见,所有内容都已改变,但仍显示错误。

    • 您的数据目录和文件可能可以通过互联网访问。.htaccess 文件不起作用。强烈建议您配置 Web 服务器,使数据目录不再可访问,或将数据目录移出 Web 服务器文档根目录。

路径:/etc/apache2/sites-available 以及 nextcloud.conf

我改变的代码是

  GNU nano 6.2                                                                            nextcloud.conf
<VirtualHost *:80>
    ServerAdmin **mymail**
    DocumentRoot /var/www/nextcloud/
    ServerName **my ip-address**

    Alias /nextcloud "/var/www/nextcloud/"
    Redirect 301 /.well-known/webfinger /nextcloud/index.php/.well-known/webfinger
    <Directory /var/www/nextcloud/>
      #  Options +FollowSymlinks
       # AllowOverride All
        
         Require all denied

         # Require all granted
       # <IfModule mod_dav.c>
        #    Dav off
       # </IfModule>
       # SetEnv HOME /var/www/nextcloud
       # SetEnv HTTP_HOME /var/www/nextcloud
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>


忽略 http 错误、smtp 和 default_phone_region 错误和警告


现在来看看剩下的 /.well-known/ 警告。如何解决它们我试过解决它,代码是

路径:/etc/apache2/sites-available

在这里,我有 2 个 conf 文件,但不知道要修改哪个,因此我一个接一个地进行了修改,但警告并未出现

000-default.conf  default-ssl.conf  nextcloud.conf

对于 nextcloud.conf 我尝试解决一个错误 /.well-known/webfinger

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot /var/www/nextcloud/
    ServerName 192.168.1.105

    Alias /nextcloud "/var/www/nextcloud/"

    Redirect 301 /.well-known/webfinger /nextcloud/index.php/.well-known/webfinger

    <Directory /var/www/nextcloud/>
      #  Options +FollowSymlinks
       # AllowOverride All
        Require all denied
         # Require all granted
       # <IfModule mod_dav.c>
        #    Dav off
       # </IfModule>
       # SetEnv HOME /var/www/nextcloud
       # SetEnv HTTP_HOME /var/www/nextcloud
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

对于 000-default.conf

<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        #ServerName www.example.com

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/nextcloud
        
        Redirect 301 /.well-known/webfinger /nextcloud/index.php/.well-known/webfinger

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

在 ServerAdmin 中我必须添加我的电子邮件吗?

所以这些是我想要解决的主要问题,因为这是我第一次使用 nextcloud。

还列在:https://help.nextcloud.com/t/security-setup-warnings-using-apache2-on-ubuntu-server/162643?u=smit_desai

谢谢。

相关内容