Score:0

Nextcloud Server security & setup warnings using apache2 on ubuntu server

hu flag

enter image description here

In this I did try solving the red errors:

    • PHP configuration option output_buffering must be disabled path: /etc/php/8.1/apache2/php.ini
; output_buffering
;   Default Value: Off
;   Development Value: 4096
;   Production Value: 4096

As you can see all the things are changed yet the error is being showed.

    • Your data directory and files are probably accessible from the internet. The .htaccess file is not working. It is strongly recommended that you configure your web server so that the data directory is no longer accessible, or move the data directory outside the web server document root.

path: /etc/apache2/sites-available and in that nextcloud.conf

Code I changed is

  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>


ignore the http error, smtp and default_phone_region errors and warnings


Now for the remaining /.well-known/ warnings. How to solve them I have tried solving it and the code is

path: /etc/apache2/sites-available

In this I have 2 conf files and don't know which to modify so I did it on both one by one and yet warning did not go

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

for nextcloud.conf and I tried solving one error /.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>

for 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

In ServerAdmin do I have to add my email ?

So this are the main issues I want to solve them as it my first time using nextcloud.

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

Thank you.

Nmath avatar
ng flag
This question does not adhere to our Q&A format. You have several unique problems: a PHP problem; a warning about .htaccess; a warning about no encryption; a memory caching problem; and a URL resolution problem. Each of these issues are entirely different and will have entirely different solutions. **Please don't combine multiple problems in a single question.** Ask multiple questions if necessary. You can link between the questions if they help provide context.
Nmath avatar
ng flag
Setting up Nextcloud can be complicated, but the developers maintain excellent [documentation](https://docs.nextcloud.com/) including documentation specific to [server administration](https://docs.nextcloud.com/server/stable/admin_manual/). Have you been using it? They include start-to-finish set up tutorials, including Ubuntu-specific documentation. Nextcloud has a lot of moving parts to work properly. Because you have so many issues it might be prudent to start over. FYI, there is a nextcloud server snap that *greatly* simplifies the process.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.