Apache Default Page for ownCloud going through Nginx Reverse Proxy

Steps to reproduce

  1. When I initially go to https://oc.myreserveddns.com/owncloud or https://oc.myreserveddns.com/owncloud/index.php/login, I get the login screen, as expected!
  2. If I’m logged in and go to https://oc.epochgames.co.uk/owncloud/, I get to the logged in page, as expected!
  3. When I go tohttps://oc.myreserveddns.com/, whether I’m logged in or not, I receive the Apache2 Ubuntu Default Page page.

Expected behaviour

For https://oc.reserveddns.com to redirect to https://oc.reserveddns.com/owncloud (reserveddns.com is a placeholder for privacy purposes)

Actual behaviour

oc.reserveddns.com shows the Apache2 Ubuntu Default Page

Server configuration

Operating system: Ubuntu 18.04 LTS

Web server: ownCloud is installed on an Ubuntu VM on my Proxmox VE 5.3 OS, and with Apache2 Web Server. There is also an Nginx VM that ownCloud is reverse proxying through (I have other VMs needing to share 1 public IP). The Nginx Server does not have Apache2 installed on it).

Database: mysql

PHP version: PHP Version 7.2.17-0ubuntu0.18.04.1

ownCloud version: 10.0.8

Updated from an older ownCloud or fresh install: Fresh install

Where did you install ownCloud from: https://owncloud.org/download/

Signing status (ownCloud 9.0 and above): I receive 404 Not Found.

The content of config/config.php:

{
    "system": {
        "instanceid": "ocpamtg22ea6",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "192.168.0.102",
            "1.2.3.4",
            "oc.myreserveddns.com"
        ],
        "datadirectory": "\/var\/www\/html\/owncloud\/data",
        "overwrite.cli.url": "http:\/\/192.168.0.102\/owncloud",
        "dbtype": "mysql",
        "version": "10.0.8.5",
        "dbname": "owncloud",
        "dbhost": "localhost",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "UTC",
        "installed": true
    }
}

(1.2.3.4 is my Public IP for privacy purposes)

List of activated apps: The defaults I suppose.

Are you using external storage, if yes which one: No

Are you using encryption: Yes

Are you using an external user-backend, if yes which one: No

Client configuration

Browser: Firefox

Operating system: Windows 10

Logs

Web server error log

I assume you mean /var/log/apache2/error.log ?

[Sat Apr 27 03:12:45.924034 2019] [mpm_event:notice] [pid 11351:tid 140327355734976] AH00489: Apache/2.4.29 (Ubuntu) c
onfigured -- resuming normal operations
[Sat Apr 27 03:12:45.924190 2019] [core:notice] [pid 11351:tid 140327355734976] AH00094: Command line: '/usr/sbin/apac
he2'
[Sat Apr 27 03:12:51.779755 2019] [mpm_event:notice] [pid 11351:tid 140327355734976] AH00491: caught SIGTERM, shutting
 down
[Sat Apr 27 03:12:51.932711 2019] [mpm_prefork:notice] [pid 14079] AH00163: Apache/2.4.29 (Ubuntu) configured -- resum
ing normal operations
[Sat Apr 27 03:12:51.932853 2019] [core:notice] [pid 14079] AH00094: Command line: '/usr/sbin/apache2'
[Sat Apr 27 03:12:52.676136 2019] [mpm_prefork:notice] [pid 14079] AH00169: caught SIGTERM, shutting down
[Sat Apr 27 03:12:53.096973 2019] [mpm_prefork:notice] [pid 14168] AH00163: Apache/2.4.29 (Ubuntu) configured -- resum
ing normal operations
[Sat Apr 27 03:12:53.097068 2019] [core:notice] [pid 14168] AH00094: Command line: '/usr/sbin/apache2'
[Sat Apr 27 03:18:41.501194 2019] [mpm_prefork:notice] [pid 14168] AH00169: caught SIGTERM, shutting down
[Sat Apr 27 03:18:41.863996 2019] [mpm_prefork:notice] [pid 15362] AH00163: Apache/2.4.29 (Ubuntu) configured -- resum
ing normal operations
[Sat Apr 27 03:18:41.864110 2019] [core:notice] [pid 15362] AH00094: Command line: '/usr/sbin/apache2'
[Sat Apr 27 03:35:01.120988 2019] [mpm_prefork:notice] [pid 15362] AH00169: caught SIGTERM, shutting down
[Sat Apr 27 03:35:01.411113 2019] [mpm_prefork:notice] [pid 17216] AH00163: Apache/2.4.29 (Ubuntu) configured -- resum
ing normal operations
[Sat Apr 27 03:35:01.411223 2019] [core:notice] [pid 17216] AH00094: Command line: '/usr/sbin/apache2'
[Sat Apr 27 03:36:31.932751 2019] [mpm_prefork:notice] [pid 17216] AH00169: caught SIGTERM, shutting down
[Sat Apr 27 03:36:32.223204 2019] [mpm_prefork:notice] [pid 17304] AH00163: Apache/2.4.29 (Ubuntu) configured -- resum
ing normal operations
[Sat Apr 27 03:36:32.223367 2019] [core:notice] [pid 17304] AH00094: Command line: '/usr/sbin/apache2'
[Sat Apr 27 03:44:24.488383 2019] [mpm_prefork:notice] [pid 17304] AH00169: caught SIGTERM, shutting down
[Sat Apr 27 03:44:24.783028 2019] [mpm_prefork:notice] [pid 17494] AH00163: Apache/2.4.29 (Ubuntu) configured -- resum
ing normal operations
[Sat Apr 27 03:44:24.783130 2019] [core:notice] [pid 17494] AH00094: Command line: '/usr/sbin/apache2'
[Sat Apr 27 03:58:09.468758 2019] [mpm_prefork:notice] [pid 17494] AH00169: caught SIGTERM, shutting down
[Sat Apr 27 03:58:09.630414 2019] [ssl:warn] [pid 17869] AH01906: 192.168.0.102:443:0 server certificate is a CA certi
ficate (BasicConstraints: CA == TRUE !?)
[Sat Apr 27 03:58:09.753653 2019] [ssl:warn] [pid 17874] AH01906: 192.168.0.102:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Sat Apr 27 03:58:09.764732 2019] [mpm_prefork:notice] [pid 17874] AH00163: Apache/2.4.29 (Ubuntu) OpenSSL/1.1.0g configured -- resuming normal operations
[Sat Apr 27 03:58:09.764775 2019] [core:notice] [pid 17874] AH00094: Command line: '/usr/sbin/apache2'
[Sat Apr 27 03:59:08.912956 2019] [mpm_prefork:notice] [pid 17874] AH00169: caught SIGTERM, shutting down
[Sat Apr 27 03:59:09.064479 2019] [ssl:warn] [pid 17912] AH01906: 192.168.0.102:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Sat Apr 27 03:59:09.192992 2019] [ssl:warn] [pid 17928] AH01906: 192.168.0.102:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Sat Apr 27 03:59:09.204374 2019] [mpm_prefork:notice] [pid 17928] AH00163: Apache/2.4.29 (Ubuntu) OpenSSL/1.1.0g configured -- resuming normal operations
[Sat Apr 27 03:59:09.204419 2019] [core:notice] [pid 17928] AH00094: Command line: '/usr/sbin/apache2'
[Sat May 18 14:44:12.285153 2019] [mpm_prefork:notice] [pid 17928] AH00169: caught SIGTERM, shutting down
[Sat May 18 14:44:12.474823 2019] [ssl:warn] [pid 26737] AH01906: 192.168.0.102:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Sat May 18 14:44:12.474899 2019] [ssl:warn] [pid 26737] AH01909: 192.168.0.102:443:0 server certificate does NOT include an ID which matches the server name
[Sat May 18 14:44:12.613160 2019] [ssl:warn] [pid 26743] AH01906: 192.168.0.102:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Sat May 18 14:44:12.613202 2019] [ssl:warn] [pid 26743] AH01909: 192.168.0.102:443:0 server certificate does NOT include an ID which matches the server name
[Sat May 18 14:44:12.623209 2019] [mpm_prefork:notice] [pid 26743] AH00163: Apache/2.4.29 (Ubuntu) OpenSSL/1.1.0g configured -- resuming normal operations
[Sat May 18 14:44:12.623252 2019] [core:notice] [pid 26743] AH00094: Command line: '/usr/sbin/apache2'
[Sat May 18 18:53:46.626965 2019] [mpm_prefork:notice] [pid 26743] AH00169: caught SIGTERM, shutting down
[Mon May 20 02:00:04.721357 2019] [ssl:warn] [pid 927] AH01906: 192.168.0.102:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Mon May 20 02:00:04.722044 2019] [ssl:warn] [pid 927] AH01909: 192.168.0.102:443:0 server certificate does NOT include an ID which matches the server name
[Mon May 20 02:00:07.098595 2019] [ssl:warn] [pid 972] AH01906: 192.168.0.102:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Mon May 20 02:00:07.098654 2019] [ssl:warn] [pid 972] AH01909: 192.168.0.102:443:0 server certificate does NOT include an ID which matches the server name
[Mon May 20 02:00:07.112465 2019] [mpm_prefork:notice] [pid 972] AH00163: Apache/2.4.29 (Ubuntu) OpenSSL/1.1.0g configured -- resuming normal operations
[Mon May 20 02:00:07.112514 2019] [core:notice] [pid 972] AH00094: Command line: '/usr/sbin/apache2'
[Mon May 20 02:19:03.839476 2019] [mpm_prefork:notice] [pid 972] AH00169: caught SIGTERM, shutting down
[Mon May 20 02:19:47.079891 2019] [ssl:warn] [pid 890] AH01906: 192.168.0.102:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Mon May 20 02:19:47.080430 2019] [ssl:warn] [pid 890] AH01909: 192.168.0.102:443:0 server certificate does NOT include an ID which matches the server name
[Mon May 20 02:19:49.629858 2019] [ssl:warn] [pid 944] AH01906: 192.168.0.102:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Mon May 20 02:19:49.629918 2019] [ssl:warn] [pid 944] AH01909: 192.168.0.102:443:0 server certificate does NOT include an ID which matches the server name
[Mon May 20 02:19:49.644720 2019] [mpm_prefork:notice] [pid 944] AH00163: Apache/2.4.29 (Ubuntu) OpenSSL/1.1.0g configured -- resuming normal operations
[Mon May 20 02:19:49.644766 2019] [core:notice] [pid 944] AH00094: Command line: '/usr/sbin/apache2'
[Mon May 20 02:50:48.925824 2019] [php7:error] [pid 1103] [client 192.168.0.101:37896] script '/var/www/html/index.php' not found or unable to stat
[Mon May 20 02:50:56.326571 2019] [php7:error] [pid 1150] [client 192.168.0.101:37900] script '/var/www/html/index.php' not found or unable to stat
[Mon May 20 02:51:28.103703 2019] [php7:error] [pid 1103] [client 192.168.0.101:37964] script '/var/www/html/index.php' not found or unable to stat
[Mon May 20 02:52:18.967185 2019] [php7:error] [pid 1105] [client 192.168.0.101:37966] script '/var/www/html/index.php' not found or unable to stat
[Mon May 20 02:52:22.309823 2019] [php7:error] [pid 1150] [client 192.168.0.101:37970] script '/var/www/html/index.php' not found or unable to stat
[Mon May 20 02:52:25.263678 2019] [php7:error] [pid 1104] [client 192.168.0.101:37972] script '/var/www/html/index.php' not found or unable to stat

ownCloud log (data/owncloud.log)

{"reqId":"QJTWTNIzpl8nDRILHRkZ","level":3,"time":"2019-04-27T03:39:22+00:00","remoteAddr":"192.168.0.108","user":"--",
"app":"mysql.setup","method":"POST","url":"\/owncloud\/index.php\/index.php","message":"Specific user creation failed:
 An exception occurred while executing 'SELECT user FROM mysql.user WHERE user=?' with params [\"oc_naupe\"]:\n\nSQLS
TATE[42000]: Syntax error or access violation: 1142 SELECT command denied to user 'ownclouduser'@'localhost' for table
 'user'"}
{"reqId":"QJTWTNIzpl8nDRILHRkZ","level":3,"time":"2019-04-27T03:39:26+00:00","remoteAddr":"192.168.0.108","user":"--",
"app":"no app in context","method":"POST","url":"\/owncloud\/index.php\/index.php","message":"User backend OC\\User\\D
atabase is returning home: \/var\/www\/html\/owncloud\/data\/naupe for user: naupe which differs from existing value
: "}
{"reqId":"euB7WvuCz74UZBdttDki","level":2,"time":"2019-04-27T03:45:20+00:00","remoteAddr":"192.168.0.108","user":"--",
"app":"core","method":"POST","url":"\/owncloud\/index.php\/login?redirect_url=%252Fowncloud%252Findex.php%252Fapps%252
Ffiles%252F","message":"Login failed: 'naupe' (Remote IP: '192.168.0.108')"}
{"reqId":"LTjbCBasqeAAa3LU37s2","level":2,"time":"2019-04-27T03:45:35+00:00","remoteAddr":"192.168.0.108","user":"--",
"app":"core","method":"POST","url":"\/owncloud\/index.php\/login?user=naupe&redirect_url=%252Fowncloud%252Findex.php%
252Fapps%252Ffiles%252F","message":"Login failed: 'naupe' (Remote IP: '192.168.0.108')"}
{"reqId":"hk78UlNzxLlWCkjnRTXS","level":2,"time":"2019-04-27T03:46:30+00:00","remoteAddr":"192.168.0.108","user":"drio
mi","app":"dav","method":"DELETE","url":"\/owncloud\/remote.php\/webdav\/ownCloud%20Manual.pdf","message":"Could not g
et node for path: \"ownCloud Manual.pdf\" : File with name ownCloud Manual.pdf could not be located"}
{"reqId":"yt41mKWP6abngi2DRbJc","level":2,"time":"2019-04-27T03:46:30+00:00","remoteAddr":"192.168.0.108","user":"drio
mi","app":"dav","method":"DELETE","url":"\/owncloud\/remote.php\/webdav\/Documents","message":"Could not get node for
path: \"Documents\" : File with name Documents could not be located"}
{"reqId":"F2TJuqffzQFsCAaPWMRk","level":2,"time":"2019-04-27T03:46:30+00:00","remoteAddr":"192.168.0.108","user":"drio
mi","app":"dav","method":"DELETE","url":"\/owncloud\/remote.php\/webdav\/Photos","message":"Could not get node for pat
h: \"Photos\" : File with name Photos could not be located"}
{"reqId":"TKguQLfrf7MFxe5Lhuiq","level":3,"time":"2019-04-27T03:59:36+00:00","remoteAddr":"192.168.0.108","user":"--",
"app":"PHP","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/?dir=\/&fileid=9","message":"ini_set(): A sessio
n is active. You cannot change the session module's ini settings at this time at \/var\/www\/html\/owncloud\/lib\/base
.php#596"}
{"reqId":"OisqL5jMb2duHnzOxPIT","level":3,"time":"2019-04-27T03:59:36+00:00","remoteAddr":"192.168.0.108","user":"--",
"app":"PHP","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/?dir=\/","message":"ini_set(): A session is acti
ve. You cannot change the session module's ini settings at this time at \/var\/www\/html\/owncloud\/lib\/base.php#596"
}
{"reqId":"DbAErXMCwk3l3sXa0zCy","level":3,"time":"2019-04-27T03:59:36+00:00","remoteAddr":"192.168.0.108","user":"--",
"app":"PHP","method":"GET","url":"\/owncloud\/index.php\/core\/js\/oc.js?v=c29615750e4e7283d8655e0038a0ac0c","message"
:"ini_set(): A session is active. You cannot change the session module's ini settings at this time at \/var\/www\/html
\/owncloud\/lib\/base.php#596"}
{"reqId":"0feVa5yyca1LyfWCfxzz","level":3,"time":"2019-04-27T03:59:37+00:00","remoteAddr":"192.168.0.108","user":"--",
"app":"PHP","method":"GET","url":"\/owncloud\/ocs\/v2.php\/apps\/notifications\/api\/v1\/notifications?format=json","m
essage":"ini_set(): A session is active. You cannot change the session module's ini settings at this time at \/var\/ww
w\/html\/owncloud\/lib\/base.php#596"}
...
(there is a lot more, it goes on for awhile; this last set of code is found at the bottom quite a few times)
...
{"reqId":"FCiJtQchgzIHztr2uqp6","level":3,"time":"2019-05-20T03:14:48+00:00","remoteAddr":"192.168.0.101","user":"--","app":"PHP","method":"GET","url":"\/owncloud\/ocs\/v2.php\/apps\/notifications\/api\/v1\/notifications?format=json","message":"ini_set(): A session is active. You cannot change the session module's ini settings at this time at \/var\/www\/html\/owncloud\/lib\/base.php#596"}

Browser log

You sure you want to read through it? Got 214 Errors in Firefox’s Console Browser for my ownCloud’s Login Page. Its so long, I felt more comfortable posting it in a pastebin (and omitting the URL as in other parts of this post): https://pastebin.com/dtKwQ2M2


Hope I got all the details squared away. Let me know if I need anymore details. I do fear I’m getting a LOT of errors … so perhaps there may be a lot wrong with my configuration I’m unuaware of?

Hi,
First I would like to mention the following documentation page as a starting point:
https://doc.owncloud.org/server/admin_manual/configuration/server/reverse_proxy_configuration.html

Looking at your errors I’m not really sure, but I suspect some problems with your Apache configuration.

AH01906: 192.168.0.102:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
AH01909: 192.168.0.102:443:0 server certificate does NOT include an ID which matches the server name

It seems like there is some problem with the SSL configuration (even though I thought you don’t need one, as Nginx is terminating the SSL connection.) But you might have corrected that, as it didn’t appear any more later on.

Then I think there might be some problem with your Virtual host configuration inside the Apache for your ownCloud installation as it seems to try to access the file

'/var/www/html/index.php'

Perhaps the following documentation page can help you a little:
Configure the web server

Hope that can get you started.
Cheers,
Erik

1 Like

Thank you for the post @eneubauer, but someone on Reddit was able to assist me :slight_smile:

So /var/www/html/index.php is where the Apache Default Page is located. The Redditor suggested I change the index.php file from the Apache Default Page to a redirect like so:

<html>
  <head>
    <META HTTP-EQUIV="Refresh" Content="3; URL=https://oc.myreserveddns.com/owncloud/">
  </head>
  <body>
    This page will forward you to https://oc.myreserveddns.com/owncloud/ in three seconds, please wait.
  </body>
</html>

(I saved the original indiex.php file elsewhere in case I were to ever need it again)

Anyways, that seems to have done the trick: as soon as someone goes to oc.myreserveddns.com or https://oc.myreserveddns.com, they are forwarded to https://oc.myreserveddns.com/owncloud/ after 3 seconds! (The ownCloud Login Screen)

Yeah the SSL looks to be working fine. Those older logs I imagine are from when I was initially updating ownCloud to use SSL. Watched this easy-to-follow video.

Funny … I had tried messing with this file the night before, and just tonight is the redirecting working (it wasn’t before and I thought maybe I updated the wrong file). Well, considering everything is working just fine, I’m going to call this issue of mine solved :slight_smile: