Security & setup warnings using apache2 on ubuntu server

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 smssmit@gmail.com
    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.

Thank you.

1 Like

Please read and re read the manual.

Those are very basic little problems that have been dealt here very often, so please use the forum search.

What install methodl/process (and guide) did you use?

What type of system are your install NC on?

Any particular reason you need to use a manual installation approach?

1 Like