Nextcloud webgui won't appear

-installed nextcloud
-installed apache
-created sites-enabled/nextcloud.conf
-put “Include nextcloud.conf” in httpd.conf
-installed/started/configured postgresql
-configured php extensions
-run php occ maintenance:install, which completed successfully
-started apache
But I get no webgui when I connect to the server, just an apache “It works!” message. What could be the problem?

If you see Apache2 it works page, that means that your nextcloud site isn’t active, or not in the good URL.
in your nextcloud.conf do you have a servername ?

Exemple : servername
If you’re going to your nextcloud webgui with local ip like you must disable the 000-default.conf because it will be the default website

in your nextcloud.conf do you have a servername ?

I’m just using the IP address.

If you’re going to your nextcloud webgui with local ip like you must disable the 000-default.conf because it will be the default website

I don’t see that file anywhere in my apache2 directory. I see 00_default_ssl_vhost.conf 00_default_vhost.conf default_vhost.include 00_default_settings.conf

so it’s 00_default_vhost.conf

Hmm, I renamed the file and now I’m getting ERR_CONNECTION_REFUSED.

you have to disable it, not rename it

What’s the correct way to do that?

it’s httpd or apache ?

the server’s apache. there’s a conf file called httpd.conf.

so sudo a2dissite 00-default_vhost.conf
and sudo a2ensite nextcloud.conf

finally sudo service apache2 reload

and see what you get

That’s what I was afraid of. Gentoo doesn’t have that command. I’m not sure how to do it on gentoo.

If you’re new to all of this.
The safer way to start is with Nextcloud VM

a little outdated :


read vhost config

Stop taking shortcut to pre-built vm, use your brain

In my setup I have to type-in the nextcloud’s directory at the end of my URL, thus :: - your problem could be as simple as that!

this depends on the install: when nextcloud is installed in www root directorie, the nextcloud stuff is not needed when nextcloud is NOT installed in www root directorie

the following conf exemple is a lived redacted apache2 conf for a debian/apache2 server, with ssl with letsencrypt, HTTP2 and some others options … some lines are redacted.
On that exemple, Nextcloud web pages are availables usinh https://domaine/ no need of www or subdomain ext.

– (debian) FIRST, the /etc/apache2/apache2.conf

# Global configuration section

setting up your domain

    ServerName DOMAINE

server wide global conf for HTTP2 over http/https could be set also in vhost

    Protocols h2c http/1.1  
    Protocols h2 http/1.1

check apache2 docs for the following options

    ServerTokens Prod
    ServerSignature Off 

setting regular places

    DefaultRuntimeDir ${APACHE_RUN_DIR}
    PidFile ${APACHE_PID_FILE}

alive tweakings depending harfware/users/bandwith

    Timeout 800
    KeepAlive On
    MaxKeepAliveRequests 100
    KeepAliveTimeout 20

no comment needed if think


logging ip needed for fail2ban parsing

    HostnameLookups Off

logs and errors

    ErrorLog ${APACHE_LOG_DIR}/error.log
    LogLevel warn

extra packs and conf ea2mods

    IncludeOptional mods-enabled/*.load
    IncludeOptional mods-enabled/*.conf
    Include ports.conf

better security enable in vhost files

    <Directory />
    	Options FollowSymLinks
    	AllowOverride None
    	Require all denied
    <Directory /usr/share>
    	AllowOverride None
    	Require all granted

www roots conf

    <Directory /var/www/>
    	Options Indexes FollowSymLinks
    	AllowOverride None
    	Require all granted


    AccessFileName .htaccess

well-know stuff

    <FilesMatch "^\.ht">
    	Require all denied

tweakings formats

    LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
    LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %O" common
    LogFormat "%{Referer}i -> %U" referer
    LogFormat "%{User-agent}i" agent

more conf

    IncludeOptional conf-enabled/*.conf
    IncludeOptional sites-enabled/*.conf

THEN the general vhost config located under /etc/apache2/sites-enables


<VirtualHost *:80>
    	ServerAdmin webmaster@localhost

as i say, simplicity

    	DocumentRoot /var/www/html

some protocols tweaking for http2

            Protocols h2 http/1.1

some packs option

    	RewriteEngine on

some logs location

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

the permanent http --> https apache rewritte modding

    	RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]

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

FINALLY the redirect ssl configuration:

calling ssl module

<IfModule mod_ssl.c>

vhost conf and ports

    <VirtualHost *:443>
    	ServerAdmin webmaster@localhost
    	DocumentRoot /var/www/html
    	Protocols h2 http/1.1
    	ErrorLog ${APACHE_LOG_DIR}/error.log
    	CustomLog ${APACHE_LOG_DIR}/access.log combined

letsencrypt ssl certs/pem/keys folder location

    	SSLCertificateFile /etc/letsencrypt/live/redacted/fullchain.pem
    	SSLCertificateKeyFile /etc/letsencrypt/live/redacted/privkey.pem
    	Include /etc/letsencrypt/options-ssl-apache.conf
    	ServerName DOMAINE

HSGTS conf Guarantee HTTPS for 6 Month including Sub Domains

        Header always set Strict-Transport-Security "max-age=15768000; includeSubDomains"	

modern ssl configuration, tweak to your need

    SSLProtocol All -SSLv2 -SSLv3 -TLSv1 -TLSv1.1

following cypher suite from modern paranoiac google proposal,

    SSLHonorCipherOrder     on
    SSLCompression          on
    SSLSessionTickets       off
    SSLOptions +StrictRequire

OCSP Stapling, only in httpd 2.3.3 and later

    SSLUseStapling          on
    SSLStaplingResponderTimeout 5
    SSLStaplingReturnResponderErrors off
    SSLStaplingCache        shmcb:/var/run/ocsp(128000)
    # vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Hope this will help