Nextcloud for internal use only

Hello,
I am pretty new here and have a question. I am trying to install Nextcloud, and curios if it is possible to run it only in the LAN.
The problem that I have is: After installation and configuration I still can’t reach the webversion.
It is installed on VM Ubuntu 20.04 lts, apache 2.4, MariaDB, PHP 7.4.
I used this manual:

and this one too:

Still no access to the webplatform.
Thank You in advance for the help

You can also read this tutorial. Ok it is for Debian but it also works for Ubuntu.

Perhaps you missed some packages.
Please post your errors and logs.
Ok without internet access you can not use Lets Encrypt from the tuturial.

Thank you, I am checking.
I will post the logs later today, or tomorrow.
Is the SSL cert necessary? I think that this is the last part that I am missing.

The problem is if you want to use Nextcloud with e.g. mobile devices on your private network. I do not know if it fully works without certs or with self signed certificates.

If you want to use Lets Encrypt you must use a global name (e.g. DynDNS) and port-forwarding (80/443) through your router to your nextcloud. After update the cert (certbot) you can deactivate forwarding. Why do you not want to allow Nextcloud from outside? Do you not think that your data are at home more secure than e.g. at your mail provider? Why do you allow mail provider but not your own nextcloud?

This is just a test server that I am trying to config, before migrating the old one to a new one.
I want to be sure that I can do the operation correctly.
That is why I don’t need any access from outside.
But still I can’t see the login screen to the cloud.

Is apache2 running?
Is MariaDB running?

What do you get with accessing the website?
Any logs in apache2 and nextcloud?

Those 2 I already have:
error.log
[Mon Oct 26 00:00:05.956748 2020] [mpm_prefork:notice] [pid 16398] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured – resuming normal operations
[Mon Oct 26 00:00:05.956769 2020] [core:notice] [pid 16398] AH00094: Command line: ‘/usr/sbin/apache2’
[Mon Oct 26 08:48:08.489755 2020] [proxy_fcgi:error] [pid 117088] [client 10.111.0.21:64685] AH01071: Got error ‘Primary script unknown’
[Mon Oct 26 09:52:17.700627 2020] [mpm_prefork:notice] [pid 16398] AH00171: Graceful restart requested, doing restart
AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1. Set the ‘ServerName’ directive globally to suppress this message
[Mon Oct 26 09:52:17.712557 2020] [mpm_prefork:notice] [pid 16398] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured – resuming normal operations
[Mon Oct 26 09:52:17.712567 2020] [core:notice] [pid 16398] AH00094: Command line: ‘/usr/sbin/apache2’
[Mon Oct 26 10:06:08.711496 2020] [mpm_prefork:notice] [pid 16398] AH00171: Graceful restart requested, doing restart
AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1. Set the ‘ServerName’ directive globally to suppress this message
[Mon Oct 26 10:06:08.723164 2020] [mpm_prefork:notice] [pid 16398] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured – resuming normal operations
[Mon Oct 26 10:06:08.723175 2020] [core:notice] [pid 16398] AH00094: Command line: ‘/usr/sbin/apache2’
[Mon Oct 26 10:06:13.242033 2020] [mpm_prefork:notice] [pid 16398] AH00171: Graceful restart requested, doing restart
AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1. Set the ‘ServerName’ directive globally to suppress this message
[Mon Oct 26 10:06:13.253674 2020] [mpm_prefork:notice] [pid 16398] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured – resuming normal operations
[Mon Oct 26 10:06:13.253690 2020] [core:notice] [pid 16398] AH00094: Command line: ‘/usr/sbin/apache2’
[Mon Oct 26 11:44:32.879264 2020] [mpm_prefork:notice] [pid 16398] AH00169: caught SIGTERM, shutting down
[Mon Oct 26 11:44:32.942079 2020] [mpm_prefork:notice] [pid 137336] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured – resuming normal operations
[Mon Oct 26 11:44:32.942225 2020] [core:notice] [pid 137336] AH00094: Command line: ‘/usr/sbin/apache2’
[Mon Oct 26 15:57:57.319393 2020] [mpm_prefork:notice] [pid 137336] AH00169: caught SIGTERM, shutting down
[Mon Oct 26 15:58:16.388869 2020] [mpm_prefork:notice] [pid 926] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured – resuming normal operations
[Mon Oct 26 15:58:16.389979 2020] [core:notice] [pid 926] AH00094: Command line: ‘/usr/sbin/apache2’

access.log
10.111.0.21 - - [26/Oct/2020:08:48:05 +0100] “GET /favicon.ico HTTP/1.1” 404 492 “http://10.111.200.55/info.php” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36”
10.111.0.21 - - [26/Oct/2020:08:48:08 +0100] “GET /info.php HTTP/1.1” 404 245 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36”
10.111.0.21 - - [26/Oct/2020:08:48:57 +0100] “-” 408 0 “-” “-”
10.111.0.21 - - [26/Oct/2020:09:51:18 +0100] “GET / HTTP/1.1” 200 3477 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36”
10.111.0.21 - - [26/Oct/2020:09:52:09 +0100] “-” 408 0 “-” “-”
10.111.0.21 - - [26/Oct/2020:09:52:20 +0100] “GET / HTTP/1.1” 200 3477 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36”
10.111.0.21 - - [26/Oct/2020:09:52:20 +0100] “GET / HTTP/1.1” 200 3476 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36”
10.111.0.21 - - [26/Oct/2020:09:53:11 +0100] “-” 408 0 “-” “-”
10.111.0.21 - - [26/Oct/2020:09:54:03 +0100] “-” 408 0 “-” “-”
10.111.0.21 - - [26/Oct/2020:09:54:03 +0100] “-” 408 0 “-” “-”
10.111.0.21 - - [26/Oct/2020:10:28:14 +0100] “GET /testcloud HTTP/1.1” 404 492 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36”
10.111.0.21 - - [26/Oct/2020:10:28:50 +0100] “-” 408 0 “-” “-”
10.111.0.21 - - [26/Oct/2020:10:29:14 +0100] “-” 408 0 “-” “-”
10.111.0.21 - - [26/Oct/2020:11:36:07 +0100] “-” 408 0 “-” “-”
10.111.0.21 - - [26/Oct/2020:11:36:07 +0100] “-” 408 0 “-” “-”
10.111.0.21 - - [26/Oct/2020:11:40:34 +0100] “-” 408 0 “-” “-”
10.111.0.21 - - [26/Oct/2020:11:40:34 +0100] “-” 408 0 “-” “-”
10.111.0.21 - - [26/Oct/2020:11:46:38 +0100] “-” 408 0 “-” “-”
10.111.0.21 - - [26/Oct/2020:11:46:38 +0100] “-” 408 0 “-” “-”
10.111.0.21 - - [26/Oct/2020:12:28:50 +0100] “HEAD / HTTP/1.1” 200 339 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36”
10.111.0.21 - - [26/Oct/2020:12:28:53 +0100] “GET / HTTP/1.1” 200 3477 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36”
10.111.0.21 - - [26/Oct/2020:12:28:53 +0100] “GET /icons/ubuntu-logo.png HTTP/1.1” 200 3623 “http://testcloud/” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36”
10.111.0.21 - - [26/Oct/2020:12:28:53 +0100] “GET /favicon.ico HTTP/1.1” 404 487 “http://testcloud/” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36”
10.111.0.21 - - [26/Oct/2020:12:28:55 +0100] “GET / HTTP/1.1” 200 3476 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36”
10.111.0.21 - - [26/Oct/2020:12:28:56 +0100] “GET / HTTP/1.1” 200 3476 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36”
10.111.0.21 - - [26/Oct/2020:12:28:57 +0100] “GET / HTTP/1.1” 200 3476 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36”
10.111.0.21 - - [26/Oct/2020:12:29:15 +0100] “GET / HTTP/1.1” 200 3477 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36”
10.111.0.21 - - [26/Oct/2020:12:30:07 +0100] “-” 408 0 “-” “-”
10.111.0.21 - - [26/Oct/2020:13:23:52 +0100] “GET /icons/ubuntu-logo.png HTTP/1.1” 200 3624 “http://testcloud/” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36”
10.111.0.21 - - [26/Oct/2020:13:24:44 +0100] “-” 408 0 “-” “-”
10.111.0.21 - - [26/Oct/2020:15:37:53 +0100] “GET / HTTP/1.1” 200 3477 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36”
10.111.0.21 - - [26/Oct/2020:15:37:53 +0100] “GET / HTTP/1.1” 200 3476 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36”
10.111.0.21 - - [26/Oct/2020:15:37:54 +0100] “GET / HTTP/1.1” 200 3476 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36”
10.111.0.21 - - [26/Oct/2020:15:37:54 +0100] “GET / HTTP/1.1” 200 3476 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36”
10.111.0.21 - - [26/Oct/2020:15:37:58 +0100] “-” 408 0 “-” “-”
10.111.0.21 - - [26/Oct/2020:15:45:58 +0100] “-” 408 0 “-” “-”
10.111.0.21 - - [26/Oct/2020:15:45:58 +0100] “-” 408 0 “-” “-”

I am planning to delete this one and start new tomorrow. It is possible that I missed something or did it wrong.
Thank You for the help

Every time I just see the apache default site.

So after reinstalling everything, I still can’t get the login screen.
Do i need first to install the SSL cert and only after to try?

Have you enabled only the default apache2 website or additional websites?
Please post all files in /etc/apache2/sites-enabled You can use Pastebin-services.
Please post also interesting parts of your nextcloud configuration config/config.php

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/html

# 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

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

default-ssl.conf


ServerAdmin webmaster@localhost

	DocumentRoot /var/www/html

	# 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

	#   SSL Engine Switch:
	#   Enable/Disable SSL for this virtual host.
	SSLEngine on

	#   A self-signed (snakeoil) certificate can be created by installing
	#   the ssl-cert package. See
	#   /usr/share/doc/apache2/README.Debian.gz for more info.
	#   If both key and certificate are stored in the same file, only the
	#   SSLCertificateFile directive is needed.
	SSLCertificateFile	/etc/ssl/certs/ssl-cert-snakeoil.pem
	SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

	#   Server Certificate Chain:
	#   Point SSLCertificateChainFile at a file containing the
	#   concatenation of PEM encoded CA certificates which form the
	#   certificate chain for the server certificate. Alternatively
	#   the referenced file can be the same as SSLCertificateFile
	#   when the CA certificates are directly appended to the server
	#   certificate for convinience.
	#SSLCertificateChainFile /etc/apache2/ssl.crt/server-ca.crt

	#   Certificate Authority (CA):
	#   Set the CA certificate verification path where to find CA
	#   certificates for client authentication or alternatively one
	#   huge file containing all of them (file must be PEM encoded)
	#   Note: Inside SSLCACertificatePath you need hash symlinks
	#		 to point to the certificate files. Use the provided
	#		 Makefile to update the hash symlinks after changes.
	#SSLCACertificatePath /etc/ssl/certs/
	#SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt

	#   Certificate Revocation Lists (CRL):
	#   Set the CA revocation path where to find CA CRLs for client
	#   authentication or alternatively one huge file containing all
	#   of them (file must be PEM encoded)
	#   Note: Inside SSLCARevocationPath you need hash symlinks
	#		 to point to the certificate files. Use the provided
	#		 Makefile to update the hash symlinks after changes.
	#SSLCARevocationPath /etc/apache2/ssl.crl/
	#SSLCARevocationFile /etc/apache2/ssl.crl/ca-bundle.crl

	#   Client Authentication (Type):
	#   Client certificate verification type and depth.  Types are
	#   none, optional, require and optional_no_ca.  Depth is a
	#   number which specifies how deeply to verify the certificate
	#   issuer chain before deciding the certificate is not valid.
	#SSLVerifyClient require
	#SSLVerifyDepth  10

	#   SSL Engine Options:
	#   Set various options for the SSL engine.
	#   o FakeBasicAuth:
	#	 Translate the client X.509 into a Basic Authorisation.  This means that
	#	 the standard Auth/DBMAuth methods can be used for access control.  The
	#	 user name is the `one line' version of the client's X.509 certificate.
	#	 Note that no password is obtained from the user. Every entry in the user
	#	 file needs this password: `xxj31ZMTZzkVA'.
	#   o ExportCertData:
	#	 This exports two additional environment variables: SSL_CLIENT_CERT and
	#	 SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
	#	 server (always existing) and the client (only existing when client
	#	 authentication is used). This can be used to import the certificates
	#	 into CGI scripts.
	#   o StdEnvVars:
	#	 This exports the standard SSL/TLS related `SSL_*' environment variables.
	#	 Per default this exportation is switched off for performance reasons,
	#	 because the extraction step is an expensive operation and is usually
	#	 useless for serving static content. So one usually enables the
	#	 exportation for CGI and SSI requests only.
	#   o OptRenegotiate:
	#	 This enables optimized SSL connection renegotiation handling when SSL
	#	 directives are used in per-directory context.
	#SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
	<FilesMatch "\.(cgi|shtml|phtml|php)$">
			SSLOptions +StdEnvVars
	</FilesMatch>
	<Directory /usr/lib/cgi-bin>
			SSLOptions +StdEnvVars
	</Directory>

	#   SSL Protocol Adjustments:
	#   The safe and default but still SSL/TLS standard compliant shutdown
	#   approach is that mod_ssl sends the close notify alert but doesn't wait for
	#   the close notify alert from client. When you need a different shutdown
	#   approach you can use one of the following variables:
	#   o ssl-unclean-shutdown:
	#	 This forces an unclean shutdown when the connection is closed, i.e. no
	#	 SSL close notify alert is send or allowed to received.  This violates
	#	 the SSL/TLS standard but is needed for some brain-dead browsers. Use
	#	 this when you receive I/O errors because of the standard approach where
	#	 mod_ssl sends the close notify alert.
	#   o ssl-accurate-shutdown:
	#	 This forces an accurate shutdown when the connection is closed, i.e. a
	#	 SSL close notify alert is send and mod_ssl waits for the close notify
	#	 alert of the client. This is 100% SSL/TLS standard compliant, but in
	#	 practice often causes hanging connections with brain-dead browsers. Use
	#	 this only for browsers where you know that their SSL implementation
	#	 works correctly.
	#   Notice: Most problems of broken clients are also related to the HTTP
	#   keep-alive facility, so you usually additionally want to disable
	#   keep-alive for those clients, too. Use variable "nokeepalive" for this.
	#   Similarly, one has to force some clients to use HTTP/1.0 to workaround
	#   their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
	#   "force-response-1.0" for this.
	# BrowserMatch "MSIE [2-6]" \
	#		nokeepalive ssl-unclean-shutdown \
	#		downgrade-1.0 force-response-1.0

</VirtualHost>

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

nextcloud.conf
<VirtualHost *:80>
DocumentRoot “/var/www/nextcloud”
ServerName testcloud.*****.

    Alias /testcloud "/var/www/html/nextcloud/"

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

    <Directory /var/www/nextcloud/>
        Require all granted
        Options FollowSymlinks MultiViews
        AllowOverride All

       <IfModule mod_dav.c>
           Dav off
       </IfModule>

    SetEnv HOME /var/www/nextcloud
    SetEnv HTTP_HOME /var/www/nextcloud
    Satisfy Any

   </Directory>

for some reason I can’t find the nextcloud config.php anywhere and I think that this is the problem.

Ok. I think with http://the-ip-address e.g. 10.111.0.42 (change for your nextcloud) (http not https) you can access nextcloud. Is it correct?

no, I am getting the apache2 default.

Ok. I read your config again.

Change it to your nextcloud root e.g. /var/www/html/nextcloud
DocumentRoot /var/www/html/nextcloud
.
.
.
.
Perhaps not interesting …

Alias /testcloud "/var/www/html/nextcloud/"

Do you need it? Please delete it also.

The same again - apache default.
I tried to use the nextcloud.tar.bz2 install file - is it the correct or I need the zip one?

I think you can use both files. Have you decompress it in /var/www/html/nextcloud?

Which installation guide do you use?

Read https://www.howtoforge.com/tutorial/how-to-install-nextcloud-on-debian-10

I used the same one that you sent me.
And yes I decompressed the file in /var/www/html
the nextcloud folder is looks correct - I have one running cloud and it is running OK.
but I don’t have the /config/config.php file there.
Is it possible that the name is not correct? I am using “testcloud”

You find the config in /var/www/html/nextcloud/config/config.php
The name “testcloud” is no problem. But you must not configure it in apache2.
In apache2 you must use DocumentRoot /var/www/html/nextcloud (or installation dir).

get the latest nextcloud:

In tmp-dir:

wget https://download.nextcloud.com/server/releases/nextcloud-20.0.1.zip
unzip nextcloud-20.0.1.zip

And then move correctly to /var/www/html/nextcloud.
Change rights to www-data:www-data

chown -R www-data:www-data /var/www/html/nextcloud

And then there must be a /var/www/html/nextcloud/config/config.php to edit.

that is what I did…
And still in the same place.
I will start over again