Getting a 404 when calling url/owncloud; fine when calling url/owncloud/index.php #22970

Closed
UDZGuru opened this Issue Mar 8, 2016 · 48 comments

Projects

None yet
@UDZGuru
UDZGuru commented Mar 8, 2016

Steps to reproduce

  1. use ubuntu 15.10
  2. install owncloud from repo
  3. call localhost/owncloud
  4. get 404
  5. call localhost/owncloud/index.php
  6. success :)

Expected behaviour

calling localhost/owncloud/ should automatically load localhost/owncloud/index.php

Actual behaviour

a 404 gets thrown when calling localhost/owncloud/

Server configuration

Operating system:
xUbuntu 15.10

Web server:
Apache/2.4.12 (Ubuntu)
activated mods:
access_compat.load authn_core.load authz_user.load deflate.load filter.load mpm_prefork.conf php5.conf setenvif.load status.conf
alias.conf authn_file.load autoindex.conf dir.conf headers.load mpm_prefork.load php5.load socache_shmcb.load status.load
alias.load authz_core.load autoindex.load dir.load mime.conf negotiation.conf rewrite.load ssl.conf
auth_basic.load authz_host.load deflate.conf env.load mime.load negotiation.load setenvif.conf ssl.load

Database:
mysql Ver 14.14 Distrib 5.6.28, for debian-linux-gnu (x86_64) using EditLine wrapper

PHP version:
PHP 5.6.11-1ubuntu3.1

ownCloud version: (see ownCloud admin page)
ownCloud version 9.0.0

Updated from an older ownCloud or fresh install:
updated from owncloud 8.2.2

Where did you install ownCloud from:
from the repo

Signing status (ownCloud 9.0 and above):

Login as admin user into your ownCloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results here.
No errors have been found.

**List of activated apps:**
Enabled:
  - activity: 2.2.1
  - comments: 0.2
  - dav: 0.1.5
  - federatedfilesharing: 0.1.0
  - federation: 0.0.4
  - files: 1.4.4
  - files_external: 0.5.2
  - files_pdfviewer: 0.8
  - files_sharing: 0.9.1
  - files_texteditor: 2.1
  - files_trashbin: 0.8.0
  - files_versions: 1.2.0
  - files_videoplayer: 0.9.8
  - firstrunwizard: 1.1
  - gallery: 14.5.0
  - music: 0.3.8
  - notes: 2.0.0
  - notifications: 0.2.3
  - provisioning_api: 0.4.1
  - systemtags: 0.2
  - templateeditor: 0.1
  - updatenotification: 0.1.0
Disabled:
  - bookmarks
  - calendar
  - contacts
  - documents
  - encryption
  - external
  - user_external
  - user_ldap

If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your ownCloud installation folder

or

Insert your config.php content here
(Without the database password, passwordsalt and secret)

**The content of config/config.php:**
<?php
$CONFIG = array (
  'instanceid' => 'SECRETREMOVED',
  'passwordsalt' => 'SECRETREMOVED',
  'secret' => 'SECRETREMOVED',
  'trusted_domains' => 
  array (
    0 => 'localipremoved',
    1 => 'domainremoved',
    2 => 'domainremoved',
    3 => 'domainremoved',
  ),
  'datadirectory' => '/var/www/owncloud/data',
  'overwrite.cli.url' => 'http://localipremoved/owncloud',
  'dbtype' => 'mysql',
  'version' => '9.0.0.19',
  'dbname' => 'owncloud',
  'dbhost' => 'localhost',
  'dbtableprefix' => 'oc_',
'dbuser' => 'SECRETREMOVED',
  'dbpassword' => 'SECRETREMOVED',
  'logtimezone' => 'UTC',
  'installed' => true,
  'maintenance' => false,
  'loglevel' => 2,
  'forcessl' => true,
  'updatechecker' => false,
);
Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.

Are you using external storage, if yes which one: local/smb/sftp/...
yes smb

Are you using encryption: yes/no
yes ssl (but is reproducable with and without ssl)

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
no


### Client configuration
**Browser:**
independent. tested with current versions of firefox and chromium

**Operating system:**
server running xubuntu, client running xubuntu or windows 10

### Logs
#### Web server error log
[Tue Mar 08 18:58:11.213006 2016] [mpm_prefork:notice] [pid 18974] AH00163: Apache/2.4.12 (Ubuntu) OpenSSL/1.0.2d configured -- resuming normal operations
[Tue Mar 08 18:58:11.213093 2016] [core:notice] [pid 18974] AH00094: Command line: '/usr/sbin/apache2'
[Tue Mar 08 19:26:29.424954 2016] [mpm_prefork:notice] [pid 18974] AH00169: caught SIGTERM, shutting down
[Tue Mar 08 19:26:30.553361 2016] [mpm_prefork:notice] [pid 22379] AH00163: Apache/2.4.12 (Ubuntu) OpenSSL/1.0.2d configured -- resuming normal operations
[Tue Mar 08 19:26:30.553441 2016] [core:notice] [pid 22379] AH00094: Command line: '/usr/sbin/apache2'
[Tue Mar 08 19:35:00.322281 2016] [mpm_prefork:notice] [pid 22379] 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 mess$
[Tue Mar 08 19:35:00.438941 2016] [mpm_prefork:notice] [pid 22379] AH00163: Apache/2.4.12 (Ubuntu) OpenSSL/1.0.2d configured -- resuming normal operations
[Tue Mar 08 19:35:00.438968 2016] [core:notice] [pid 22379] AH00094: Command line: '/usr/sbin/apache2'
[Tue Mar 08 19:35:11.626306 2016] [mpm_prefork:notice] [pid 22379] 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 mess$
[Tue Mar 08 19:35:11.738279 2016] [mpm_prefork:notice] [pid 22379] AH00163: Apache/2.4.12 (Ubuntu) OpenSSL/1.0.2d configured -- resuming normal operations
[Tue Mar 08 19:35:11.738306 2016] [core:notice] [pid 22379] AH00094: Command line: '/usr/sbin/apache2'
[Tue Mar 08 21:06:17.127549 2016] [mpm_prefork:notice] [pid 22379] AH00169: caught SIGTERM, shutting down
[Tue Mar 08 21:06:18.251724 2016] [mpm_prefork:notice] [pid 588] AH00163: Apache/2.4.12 (Ubuntu) OpenSSL/1.0.2d configured -- resuming normal operations
[Tue Mar 08 21:06:18.251817 2016] [core:notice] [pid 588] AH00094: Command line: '/usr/sbin/apache2'


#### ownCloud log (data/owncloud.log)

{"reqId":"y0B0gnpDQW9fxm0N15bD","remoteAddr":"","app":"core","message":"starting upgrade from 8.2.2.2 to 9.0.0.19","level":0,"time":"2016-03-08T17:55:25+00:00","method":"--","url":"--"}```

Browser log

Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log 
c) ...

Commenting the line RewriteRule .* index.php [PT,E=PATH_INFO:$1] from .htaccess resolves the problem.

@LukasReschke
Member

Please post the result of curl http://localhost/owncloud -v

@UDZGuru
UDZGuru commented Mar 8, 2016

result of curl http://localhost/owncloud -v:

*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 80 (#0)
> GET /owncloud HTTP/1.1
> Host: localhost
> User-Agent: curl/7.43.0
> Accept: */*
> 
< HTTP/1.1 301 Moved Permanently
< Date: Tue, 08 Mar 2016 20:51:00 GMT
< Server: Apache/2.4.12 (Ubuntu)
< Location: http://localhost/owncloud/
< Content-Length: 309
< Content-Type: text/html; charset=iso-8859-1
< 
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://localhost/owncloud/">here</a>.</p>
<hr>
<address>Apache/2.4.12 (Ubuntu) Server at localhost Port 80</address>
</body></html>
* Connection #0 to host localhost left intact
@LukasReschke
Member

Mhm. There seems to be a correct redirect in place. In what browsers does it fail? Can you try again in a private tab or so? (maybe it's something caching related)

@UDZGuru
UDZGuru commented Mar 8, 2016

the line in .htaccess was commented out (my bad). this leads to the result stated above.

if i put the line back in the output looks like this:

*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 80 (#0)
> GET /owncloud HTTP/1.1
> Host: localhost
> User-Agent: curl/7.43.0
> Accept: */*
> 
< HTTP/1.1 301 Moved Permanently
< Date: Tue, 08 Mar 2016 20:55:33 GMT
< Server: Apache/2.4.12 (Ubuntu)
< Location: http://localhost/owncloud/
< Content-Length: 309
< Content-Type: text/html; charset=iso-8859-1
< 
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://localhost/owncloud/">here</a>.</p>
<hr>
<address>Apache/2.4.12 (Ubuntu) Server at localhost Port 80</address>
</body></html>
* Connection #0 to host localhost left intact
@LukasReschke
Member

That also looks correct 😉

@UDZGuru
UDZGuru commented Mar 8, 2016

in a clean browser (freshly installed opera developer) the 404 issue still exists.

same behaviour in a chromium private tab

@LukasReschke
Member

Can you attach a proxy or so and capture the traffic and post it to us? From what I can see from the cURL response this should work just fine 😕

@UDZGuru
UDZGuru commented Mar 8, 2016

perhaps i can do that tomorrow ... today this is too complex a task to do right now.

@nille02
nille02 commented Mar 8, 2016

i have the same problem. Like UDZGuru say, remove RewriteRule .* index.php [PT,E=PATH_INFO:$1] from htaccess fix it.

@bobvandevijver

Same issue here, removing the last RewriteRule is indeed a workaround. However, the URL is not pretty then (so it has the index.php in it).

I do not spot an SetEnv front_controller_active true in the .htaccess by the way: when I put it there the index.php is removed, but the URL is not rewritten, so I get a 403.

@nille02
nille02 commented Mar 9, 2016

@LukasReschke yes i can do this but what are you needing and maybe how?

I get this from fiddler

Initial Connection

GET https://my.tld/owncloud HTTP/1.1
Accept: text/html, application/xhtml+xml, image/jxr, */*
Accept-Language: de-DE
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240
Accept-Encoding: gzip, deflate
Host: my.tld
Connection: Keep-Alive


HTTP/1.1 301 Moved Permanently
Date: Wed, 09 Mar 2016 08:52:14 GMT
Server: Apache/2.4.10 (Raspbian)
Strict-Transport-Security: max-age=15768000; includeSubDomains; preload
Location: https://my.tld/owncloud/
Content-Length: 331
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="https://my.tld/owncloud/">here</a>.</p>
<hr>
<address>Apache/2.4.10 (Raspbian) Server at my.tld Port 443</address>
</body></html>

after this

GET https://my.tld/owncloud/ HTTP/1.1
Accept: text/html, application/xhtml+xml, image/jxr, */*
Accept-Language: de-DE
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240
Accept-Encoding: gzip, deflate
Host: my.tld
Connection: Keep-Alive


HTTP/1.1 404 Not Found
Date: Wed, 09 Mar 2016 08:52:14 GMT
Server: Apache/2.4.10 (Raspbian)
Strict-Transport-Security: max-age=15768000; includeSubDomains; preload
Content-Length: 311
Keep-Alive: timeout=5, max=99
Connection: Keep-Alive
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /var/www/owncloud/index.php was not found on this server.</p>
<hr>
<address>Apache/2.4.10 (Raspbian) Server at my.tld Port 443</address>
</body></html>
@LukasReschke LukasReschke added the triage label Mar 9, 2016
@LukasReschke LukasReschke self-assigned this Mar 9, 2016
@LukasReschke
Member

Ok. Can reproduce with the packages… Let's see…

@LukasReschke LukasReschke added bug and removed needs info labels Mar 9, 2016
@zajc
zajc commented Mar 9, 2016

I have the same issue on ssl:

https://localhost/owncloud/
The requested URL /var/www/owncloud/index.php was not found on this server.

It works:
https://localhost/owncloud/index.php

@LukasReschke
Member

Some mod_rewrite logs:

[Wed Mar 09 11:33:01.425347 2016] [mpm_prefork:notice] [pid 9533] AH00163: Apache/2.4.10 (Debian) configured -- resuming normal operations
[Wed Mar 09 11:33:01.425394 2016] [core:notice] [pid 9533] AH00094: Command line: '/usr/sbin/apache2'
[Wed Mar 09 12:13:47.265695 2016] [core:alert] [pid 9536] [client ::1:45964] /var/www/owncloud/.htaccess: Invalid command 'RewriteLogLevel', perhaps misspelled or defined by a module not included in the server configuration
[Wed Mar 09 12:14:51.313377 2016] [mpm_prefork:notice] [pid 9533] AH00169: caught SIGTERM, shutting down
[Wed Mar 09 12:22:28.711899 2016] [mpm_prefork:notice] [pid 9813] AH00163: Apache/2.4.10 (Debian) configured -- resuming normal operations
[Wed Mar 09 12:22:28.711937 2016] [core:notice] [pid 9813] AH00094: Command line: '/usr/sbin/apache2'
[Wed Mar 09 12:22:31.118237 2016] [rewrite:trace3] [pid 9818] mod_rewrite.c(475): [client ::1:45965] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] strip per-dir prefix: /var/www/owncloud/ls -> ls
[Wed Mar 09 12:22:31.118280 2016] [rewrite:trace3] [pid 9818] mod_rewrite.c(475): [client ::1:45965] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] applying pattern '.*' to uri 'ls'
[Wed Mar 09 12:22:31.118291 2016] [rewrite:trace3] [pid 9818] mod_rewrite.c(475): [client ::1:45965] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] strip per-dir prefix: /var/www/owncloud/ls -> ls
[Wed Mar 09 12:22:31.118296 2016] [rewrite:trace3] [pid 9818] mod_rewrite.c(475): [client ::1:45965] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] applying pattern '^\\.well-known/host-meta' to uri 'ls'
[Wed Mar 09 12:22:31.118301 2016] [rewrite:trace3] [pid 9818] mod_rewrite.c(475): [client ::1:45965] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] strip per-dir prefix: /var/www/owncloud/ls -> ls
[Wed Mar 09 12:22:31.118305 2016] [rewrite:trace3] [pid 9818] mod_rewrite.c(475): [client ::1:45965] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] applying pattern '^\\.well-known/host-meta\\.json' to uri 'ls'
[Wed Mar 09 12:22:31.118309 2016] [rewrite:trace3] [pid 9818] mod_rewrite.c(475): [client ::1:45965] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] strip per-dir prefix: /var/www/owncloud/ls -> ls
[Wed Mar 09 12:22:31.118313 2016] [rewrite:trace3] [pid 9818] mod_rewrite.c(475): [client ::1:45965] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] applying pattern '^\\.well-known/carddav' to uri 'ls'
[Wed Mar 09 12:22:31.118318 2016] [rewrite:trace3] [pid 9818] mod_rewrite.c(475): [client ::1:45965] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] strip per-dir prefix: /var/www/owncloud/ls -> ls
[Wed Mar 09 12:22:31.118322 2016] [rewrite:trace3] [pid 9818] mod_rewrite.c(475): [client ::1:45965] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] applying pattern '^\\.well-known/caldav' to uri 'ls'
[Wed Mar 09 12:22:31.118326 2016] [rewrite:trace3] [pid 9818] mod_rewrite.c(475): [client ::1:45965] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] strip per-dir prefix: /var/www/owncloud/ls -> ls
[Wed Mar 09 12:22:31.118330 2016] [rewrite:trace3] [pid 9818] mod_rewrite.c(475): [client ::1:45965] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] applying pattern '^remote/(.*)' to uri 'ls'
[Wed Mar 09 12:22:31.118335 2016] [rewrite:trace3] [pid 9818] mod_rewrite.c(475): [client ::1:45965] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] strip per-dir prefix: /var/www/owncloud/ls -> ls
[Wed Mar 09 12:22:31.118339 2016] [rewrite:trace3] [pid 9818] mod_rewrite.c(475): [client ::1:45965] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] applying pattern '^(build|tests|config|lib|3rdparty|templates)/.*' to uri 'ls'
[Wed Mar 09 12:22:31.118356 2016] [rewrite:trace3] [pid 9818] mod_rewrite.c(475): [client ::1:45965] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] strip per-dir prefix: /var/www/owncloud/ls -> ls
[Wed Mar 09 12:22:31.118361 2016] [rewrite:trace3] [pid 9818] mod_rewrite.c(475): [client ::1:45965] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] applying pattern '^(\\.|autotest|occ|issue|indie|db_|console).*' to uri 'ls'
[Wed Mar 09 12:22:31.118365 2016] [rewrite:trace3] [pid 9818] mod_rewrite.c(475): [client ::1:45965] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] strip per-dir prefix: /var/www/owncloud/ls -> ls
[Wed Mar 09 12:22:31.118369 2016] [rewrite:trace3] [pid 9818] mod_rewrite.c(475): [client ::1:45965] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] applying pattern '^core/js/oc.js$' to uri 'ls'
[Wed Mar 09 12:22:31.118373 2016] [rewrite:trace3] [pid 9818] mod_rewrite.c(475): [client ::1:45965] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] strip per-dir prefix: /var/www/owncloud/ls -> ls
[Wed Mar 09 12:22:31.118377 2016] [rewrite:trace3] [pid 9818] mod_rewrite.c(475): [client ::1:45965] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] applying pattern '^core/preview.png$' to uri 'ls'
[Wed Mar 09 12:22:31.118381 2016] [rewrite:trace3] [pid 9818] mod_rewrite.c(475): [client ::1:45965] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] strip per-dir prefix: /var/www/owncloud/ls -> ls
[Wed Mar 09 12:22:31.118390 2016] [rewrite:trace3] [pid 9818] mod_rewrite.c(475): [client ::1:45965] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] applying pattern '.*' to uri 'ls'
[Wed Mar 09 12:22:31.118403 2016] [rewrite:trace2] [pid 9818] mod_rewrite.c(475): [client ::1:45965] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] rewrite 'ls' -> 'index.php'
[Wed Mar 09 12:22:31.118408 2016] [rewrite:trace3] [pid 9818] mod_rewrite.c(475): [client ::1:45965] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] add per-dir prefix: index.php -> /var/www/owncloud/index.php
[Wed Mar 09 12:22:31.118414 2016] [rewrite:trace2] [pid 9818] mod_rewrite.c(475): [client ::1:45965] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] forcing '/var/www/owncloud/index.php' to get passed through to next API URI-to-filename handler
[Wed Mar 09 12:22:31.118419 2016] [rewrite:trace1] [pid 9818] mod_rewrite.c(475): [client ::1:45965] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] internal redirect with /var/www/owncloud/index.php [INTERNAL REDIRECT]
[Wed Mar 09 12:22:39.877417 2016] [rewrite:trace3] [pid 9819] mod_rewrite.c(475): [client ::1:45966] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] strip per-dir prefix: /var/www/owncloud/ls -> ls
[Wed Mar 09 12:22:39.877464 2016] [rewrite:trace3] [pid 9819] mod_rewrite.c(475): [client ::1:45966] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] applying pattern '.*' to uri 'ls'
[Wed Mar 09 12:22:39.877476 2016] [rewrite:trace3] [pid 9819] mod_rewrite.c(475): [client ::1:45966] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] strip per-dir prefix: /var/www/owncloud/ls -> ls
[Wed Mar 09 12:22:39.877483 2016] [rewrite:trace3] [pid 9819] mod_rewrite.c(475): [client ::1:45966] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] applying pattern '^\\.well-known/host-meta' to uri 'ls'
[Wed Mar 09 12:22:39.877489 2016] [rewrite:trace3] [pid 9819] mod_rewrite.c(475): [client ::1:45966] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] strip per-dir prefix: /var/www/owncloud/ls -> ls
[Wed Mar 09 12:22:39.877503 2016] [rewrite:trace3] [pid 9819] mod_rewrite.c(475): [client ::1:45966] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] applying pattern '^\\.well-known/host-meta\\.json' to uri 'ls'
[Wed Mar 09 12:22:39.877510 2016] [rewrite:trace3] [pid 9819] mod_rewrite.c(475): [client ::1:45966] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] strip per-dir prefix: /var/www/owncloud/ls -> ls
[Wed Mar 09 12:22:39.877515 2016] [rewrite:trace3] [pid 9819] mod_rewrite.c(475): [client ::1:45966] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] applying pattern '^\\.well-known/carddav' to uri 'ls'
[Wed Mar 09 12:22:39.877520 2016] [rewrite:trace3] [pid 9819] mod_rewrite.c(475): [client ::1:45966] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] strip per-dir prefix: /var/www/owncloud/ls -> ls
[Wed Mar 09 12:22:39.877525 2016] [rewrite:trace3] [pid 9819] mod_rewrite.c(475): [client ::1:45966] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] applying pattern '^\\.well-known/caldav' to uri 'ls'
[Wed Mar 09 12:22:39.877530 2016] [rewrite:trace3] [pid 9819] mod_rewrite.c(475): [client ::1:45966] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] strip per-dir prefix: /var/www/owncloud/ls -> ls
[Wed Mar 09 12:22:39.877535 2016] [rewrite:trace3] [pid 9819] mod_rewrite.c(475): [client ::1:45966] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] applying pattern '^remote/(.*)' to uri 'ls'
[Wed Mar 09 12:22:39.877540 2016] [rewrite:trace3] [pid 9819] mod_rewrite.c(475): [client ::1:45966] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] strip per-dir prefix: /var/www/owncloud/ls -> ls
[Wed Mar 09 12:22:39.877545 2016] [rewrite:trace3] [pid 9819] mod_rewrite.c(475): [client ::1:45966] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] applying pattern '^(build|tests|config|lib|3rdparty|templates)/.*' to uri 'ls'
[Wed Mar 09 12:22:39.877551 2016] [rewrite:trace3] [pid 9819] mod_rewrite.c(475): [client ::1:45966] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] strip per-dir prefix: /var/www/owncloud/ls -> ls
[Wed Mar 09 12:22:39.877556 2016] [rewrite:trace3] [pid 9819] mod_rewrite.c(475): [client ::1:45966] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] applying pattern '^(\\.|autotest|occ|issue|indie|db_|console).*' to uri 'ls'
[Wed Mar 09 12:22:39.877562 2016] [rewrite:trace3] [pid 9819] mod_rewrite.c(475): [client ::1:45966] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] strip per-dir prefix: /var/www/owncloud/ls -> ls
[Wed Mar 09 12:22:39.877567 2016] [rewrite:trace3] [pid 9819] mod_rewrite.c(475): [client ::1:45966] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] applying pattern '^core/js/oc.js$' to uri 'ls'
[Wed Mar 09 12:22:39.877572 2016] [rewrite:trace3] [pid 9819] mod_rewrite.c(475): [client ::1:45966] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] strip per-dir prefix: /var/www/owncloud/ls -> ls
[Wed Mar 09 12:22:39.877577 2016] [rewrite:trace3] [pid 9819] mod_rewrite.c(475): [client ::1:45966] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] applying pattern '^core/preview.png$' to uri 'ls'
[Wed Mar 09 12:22:39.877582 2016] [rewrite:trace3] [pid 9819] mod_rewrite.c(475): [client ::1:45966] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] strip per-dir prefix: /var/www/owncloud/ls -> ls
[Wed Mar 09 12:22:39.877597 2016] [rewrite:trace3] [pid 9819] mod_rewrite.c(475): [client ::1:45966] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] applying pattern '.*' to uri 'ls'
[Wed Mar 09 12:22:39.877612 2016] [rewrite:trace2] [pid 9819] mod_rewrite.c(475): [client ::1:45966] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] rewrite 'ls' -> 'index.php'
[Wed Mar 09 12:22:39.877618 2016] [rewrite:trace3] [pid 9819] mod_rewrite.c(475): [client ::1:45966] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] add per-dir prefix: index.php -> /var/www/owncloud/index.php
[Wed Mar 09 12:22:39.877625 2016] [rewrite:trace2] [pid 9819] mod_rewrite.c(475): [client ::1:45966] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] forcing '/var/www/owncloud/index.php' to get passed through to next API URI-to-filename handler
[Wed Mar 09 12:22:39.877632 2016] [rewrite:trace1] [pid 9819] mod_rewrite.c(475): [client ::1:45966] ::1 - - [localhost/sid#7fd83d5d4ca8][rid#7fd83d5180a0/initial] [perdir /var/www/owncloud/] internal redirect with /var/www/owncloud/index.php [INTERNAL REDIRECT]
@LukasReschke
Member

This is caused by /etc/apache2/conf-enabled/owncloud.conf, it sets an alias which makes the rewrite rules explode.

Alias /owncloud "/var/www/owncloud/"

<Directory "/var/www/owncloud">
  Options +FollowSymLinks
  AllowOverride All

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

  SetEnv HOME /usr/share/owncloud
  SetEnv HTTP_HOME /usr/share/owncloud
</Directory>

<Directory "/var/www/owncloud/data/">
  # just in case if .htaccess gets disabled
    Require all denied
</Directory>

When setting a RewriteBase in .htaccess this should work, so as a workaround one can add RewriteBase /owncloud after RewriteEngine on in .htaccess. ownCloud 9.0.1 will contain another fix that works also with a configured alias.

Alternatively, more tested, just disable mod_rewrite, use a2dismod rewrite on Debian and /etc/init.d/apache2 restart later

Please try the patch described at #22970 (comment)

@jnweiger Any way we can for now do without this Alias? If you install our packages on Debian 8 this goes 💣

@LukasReschke LukasReschke added sev1-critical and removed triage labels Mar 9, 2016
@bobvandevijver

@LukasReschke Confirmed that adding the RewriteBase works. However, the index.php is not automatically removed from the URL.Therefor I still need to add SetEnv front_controller_active true in the .htaccess.

However, when the env is set, I get an 404 on https://localhost/owncloud/settings/admin.

@LukasReschke
Member

@bobvandevijver Can you try to add 3bce1b2 as well?

    <IfModule mod_dir.c>
      DirectorySlash off
    </IfModule>

Please let me know if that works. 🚀

@bobvandevijver

@LukasReschke I've added it to the bottom of the .htaccess, no luck. I found the following errors in the Apache logs:

[Wed Mar 09 14:37:24.435357 2016] [negotiation:error] [pid 5007] [client x:16880] AH00687: Negotiation: discovered file(s) matching request: /var/www/owncloud/settings/admin (None could be negotiated).
[Wed Mar 09 14:37:36.695991 2016] [negotiation:error] [pid 5008] [client x:16911] AH00687: Negotiation: discovered file(s) matching request: /var/www/owncloud/settings/users (None could be negotiated).
[Wed Mar 09 14:37:40.267526 2016] [negotiation:error] [pid 5011] [client x:16925] AH00687: Negotiation: discovered file(s) matching request: /var/www/owncloud/settings/personal (None could be negotiated).
[Wed Mar 09 14:37:46.058332 2016] [negotiation:error] [pid 5006] [client x:16927] AH00687: Negotiation: discovered file(s) matching request: /var/www/owncloud/settings/help (None could be negotiated).
@LukasReschke
Member

Mhm. Options -MultiViews should actually prevent that. Can you paste your whole .htaccess file?

@bobvandevijver

Sure, here it is. I've also tried some different orders, I believe it is now in the order as specified in 3bce1b2, however, still no luck.

<IfModule mod_headers.c>
  <IfModule mod_setenvif.c>
    <IfModule mod_fcgid.c>
       SetEnvIfNoCase ^Authorization$ "(.+)" XAUTHORIZATION=$1
       RequestHeader set XAuthorization %{XAUTHORIZATION}e env=XAUTHORIZATION
    </IfModule>
    <IfModule mod_proxy_fcgi.c>
       SetEnvIfNoCase Authorization "(.+)" HTTP_AUTHORIZATION=$1
    </IfModule>
  </IfModule>

  <IfModule mod_env.c>
    # Add security and privacy related headers
    Header set X-Content-Type-Options "nosniff"
    Header set X-XSS-Protection "1; mode=block"
    Header set X-Robots-Tag "none"
    Header set X-Frame-Options "SAMEORIGIN"
    Header set X-Download-Options "noopen"
    Header set X-Permitted-Cross-Domain-Policies "none"
    SetEnv modHeadersAvailable true
  </IfModule>

  # Add cache control for CSS and JS files
  <FilesMatch "\.(css|js)$">
    Header set Cache-Control "max-age=7200, public"
  </FilesMatch>
</IfModule>
<IfModule mod_php5.c>
  php_value upload_max_filesize 513M
  php_value post_max_size 513M
  php_value memory_limit 512M
  php_value mbstring.func_overload 0
  php_value always_populate_raw_post_data -1
  php_value default_charset 'UTF-8'
  php_value output_buffering 0
  <IfModule mod_env.c>
    SetEnv htaccessWorking true
  </IfModule>
</IfModule>
<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteBase /owncloud
  <IfModule mod_env.c>
    SetEnv front_controller_active true
    <IfModule mod_dir.c>
      DirectorySlash off
    </IfModule>
  </IfModule>
  RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  RewriteRule ^\.well-known/host-meta /public.php?service=host-meta [QSA,L]
  RewriteRule ^\.well-known/host-meta\.json /public.php?service=host-meta-json [QSA,L]
  RewriteRule ^\.well-known/carddav /remote.php/dav/ [R=301,L]
  RewriteRule ^\.well-known/caldav /remote.php/dav/ [R=301,L]
  RewriteRule ^remote/(.*) remote.php [QSA,L]
  RewriteRule ^(build|tests|config|lib|3rdparty|templates)/.* - [R=404,L]
  RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/.*
  RewriteRule ^(\.|autotest|occ|issue|indie|db_|console).* - [R=404,L]

  # Rewrite rules for `front_controller_active`
  Options -MultiViews
  RewriteRule ^core/js/oc.js$ index.php/core/js/oc.js [PT,E=PATH_INFO:$1]
  RewriteRule ^core/preview.png$ index.php/core/preview.png [PT,E=PATH_INFO:$1]
  RewriteCond %{REQUEST_FILENAME} !\.(css|js|svg|gif|png|html|ttf|woff|ico)$
  RewriteCond %{REQUEST_FILENAME} !core/img/favicon.ico$
  RewriteCond %{REQUEST_FILENAME} !/remote.php
  RewriteCond %{REQUEST_FILENAME} !/public.php
  RewriteCond %{REQUEST_FILENAME} !/cron.php
  RewriteCond %{REQUEST_FILENAME} !/core/ajax/update.php
  RewriteCond %{REQUEST_FILENAME} !/status.php
  RewriteCond %{REQUEST_FILENAME} !/ocs/v1.php
  RewriteCond %{REQUEST_FILENAME} !/ocs/v2.php
  RewriteCond %{REQUEST_FILENAME} !/updater/
  RewriteCond %{REQUEST_FILENAME} !/ocs-provider/
  RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/.*
  RewriteRule .* index.php [PT,E=PATH_INFO:$1]
</IfModule>
<IfModule mod_mime.c>
  AddType image/svg+xml svg svgz
  AddEncoding gzip svgz
</IfModule>
<IfModule mod_dir.c>
  DirectoryIndex index.php index.html
</IfModule>
AddDefaultCharset utf-8
Options -Indexes
<IfModule pagespeed_module>
  ModPagespeed Off
</IfModule>
@LukasReschke
Member

A potential fix is at #23029. Could somebody of you try the update with these changes applied?

@bobvandevijver I can't quite reproduce the problems that you encounter. Can you retry with my PR and if that not work let me know what system you do run? I'd need to be able to reproduce this locally to debug this.

@tflidd
Contributor
tflidd commented Mar 9, 2016

I didn't have this problem because I didn't set an alias (just the <Directory>..</Directory>) stuff. The alias makes only sense in multi-domain environments (with owncloud accessible through all domains). Many users want to use owncloud without a subfolder owncloud, they also delete the alias.

Just disabling the rewrite engine would break the .well-known redirects and perhaps other applications on the server?

@bobvandevijver

@LukasReschke I had the following in my virtual domain configuration:

<Location />
  Options Includes FollowSymLinks Multiviews
</Location>

This was not rewritten by the .htaccess or by the:

Alias /owncloud "/var/www/owncloud/"
<Directory /var/www/owncloud/>
    Options +FollowSymlinks -Multiviews
    AllowOverride All

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

   SetEnv HOME /var/www/owncloud
   SetEnv HTTP_HOME /var/www/owncloud
</Directory>

Removing the Multiviews from the first one solved it.

@LukasReschke
Member

I didn't have this problem because I didn't set an alias (just the ..) stuff. The alias makes only sense in multi-domain environments (with owncloud accessible through all domains). Many users want to use owncloud without a subfolder owncloud, they also delete the alias.

I'd also advocate to remove this from our packages at least until 9.0.1

cc @jnweiger

@VicDeo VicDeo referenced this issue in owncloud/updater Mar 9, 2016
Closed

Issue migration from 8.2.2 to 9.0.0 #270

@UDZGuru
UDZGuru commented Mar 9, 2016

In my case the "Alias" directive is necessary. At least in xUbunutu 15.10 the Apache Document Root has moved from /var/www to /var/www/html and therefore putting owncloud outside the document root (as in default /var/www/owncloud) requires the Alias directive for owncloud to be accessible. At least to my humble understanding.

I just tried commenting out the Alias directive and reloading apache. This doesn't work and throws a 404. Inserting it and reloading again -> everything works like a charm (especially with the RewriteBase added to .htaccess)

@flenny
flenny commented Mar 9, 2016

removing RewriteRule .* index.php [PT,E=PATH_INFO:$1] in my .htaccess did the job. i'm on ubuntu 15.10. thank you very much!

@jnweiger
Contributor
jnweiger commented Mar 9, 2016

I've seen the weird behaviour (localhost/owncloud/index.html works, but not localhost/owncloud) in Debian8 before. no Idea what caused it there. All other platforms behave fine.

@carlaschroder
Contributor
removing RewriteRule .* index.php [PT,E=PATH_INFO:$1] in my .htaccess did the job. i'm on ubuntu 15.10.

Same here.

@LukasReschke
Member

Or apply the patch from #22970 (comment) 😉

@dathbe
dathbe commented Mar 9, 2016

I can confirm that the fix at #23029 works with two caveats:

  1. changing only .htaccess (leaving setup.php alone) seems to do the trick. I can't determine what the change to setup.php does.

  2. the url now seems to include index.html everywhere; e.g., https://host.com/owncloud/index.php/apps/files/ . So the site works, but the url is still a little wonky.

@ckujau
ckujau commented Mar 10, 2016

Btw, why does /etc/apache2/conf-enabled/owncloud.conf (from Debian/Jessie owncloud-files-9.0.0-1.1) set HOME and HTTP_HOME to a non-existing directory?

  SetEnv HOME /usr/share/owncloud
  SetEnv HTTP_HOME /usr/share/owncloud

With OC8, both variables pointed to /var/www/owncloud, where OC is installed.

@jnweiger
Contributor

to be fixed with 9.0.1 thanks.
It has probably no effect anyway.

cheers, JW-

Am 11.03.2016 um 00:18 schrieb Christian Kujau:

Btw, why does |/etc/apache2/conf-enabled/owncloud.conf| (from
Debian/Jessie |owncloud-files-9.0.0-1.1|) set |HOME| and |HTTP_HOME|
to a non-existing directory?

SetEnv HOME /usr/share/owncloud
SetEnv HTTP_HOME /usr/share/owncloud

With OC8, both variables pointed to |/var/www/owncloud|, where OC is
installed.


Reply to this email directly or view it on GitHub
#22970 (comment).

Your Data, Your Cloud, Your Way!

ownCloud GmbH, GF: Markus Rex, Holger Dyroff, Frank Karlitschek
Schloßäckerstrasse 26a, 90443 Nürnberg, HRB 28050 (AG Nürnberg)

@LostinSpacetime

I have the same problem with 9.0.1

@nille02
nille02 commented Mar 29, 2016

Same for me. i upgraded with the official Packages.

@mattmcginty89

Commenting out RewriteRule .* index.php [PT,E=PATH_INFO:$1] in .htaccess worked until I updated to 9.0.0-3.1 Now I get never ending This ownCloud instance is currently in maintenance mode, . Is there any workaround? 9.0.1 doesn't seem to be available for me yet

@nille02
nille02 commented Mar 31, 2016

matt, if you upgrade the packages the installation is in maintenance mode. you can disable it with

sudo -u www-data php /var/www/owncloud/occ maintenance:mode --off

@Rouzax
Rouzax commented Apr 8, 2016

I had no issue on OC 9.0.0 now after the upgrade to 9.0.1 I have the same issue and my url is appending the index.php http://xxx.yyy.zzz/index.php/apps/files/
Made no changes to the original .htaccess from the install package.

When accessing the page without index.php I get

Forbidden

You don't have permission to access /apps/files/ on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
@bobvandevijver

@Rouzax Looks like you're missing the final rewrite rule. Try this .htaccess, it works for me:

<IfModule mod_headers.c>
  <IfModule mod_setenvif.c>
    <IfModule mod_fcgid.c>
       SetEnvIfNoCase ^Authorization$ "(.+)" XAUTHORIZATION=$1
       RequestHeader set XAuthorization %{XAUTHORIZATION}e env=XAUTHORIZATION
    </IfModule>
    <IfModule mod_proxy_fcgi.c>
       SetEnvIfNoCase Authorization "(.+)" HTTP_AUTHORIZATION=$1
    </IfModule>
  </IfModule>

  <IfModule mod_env.c>
    # Add security and privacy related headers
    Header set X-Content-Type-Options "nosniff"
    Header set X-XSS-Protection "1; mode=block"
    Header set X-Robots-Tag "none"
    Header set X-Frame-Options "SAMEORIGIN"
    Header set X-Download-Options "noopen"
    Header set X-Permitted-Cross-Domain-Policies "none"
    SetEnv modHeadersAvailable true
  </IfModule>

  # Add cache control for CSS and JS files
  <FilesMatch "\.(css|js)$">
    Header set Cache-Control "max-age=7200, public"
  </FilesMatch>
</IfModule>
<IfModule mod_php5.c>
  php_value upload_max_filesize 513M
  php_value post_max_size 513M
  php_value memory_limit 512M
  php_value mbstring.func_overload 0
  php_value always_populate_raw_post_data -1
  php_value default_charset 'UTF-8'
  php_value output_buffering 0
  <IfModule mod_env.c>
    SetEnv htaccessWorking true
  </IfModule>
</IfModule>
<IfModule mod_php7.c>
  php_value upload_max_filesize 513M
  php_value post_max_size 513M
  php_value memory_limit 512M
  php_value mbstring.func_overload 0
  php_value default_charset 'UTF-8'
  php_value output_buffering 0
  <IfModule mod_env.c>
    SetEnv htaccessWorking true
  </IfModule>
</IfModule>
<IfModule mod_rewrite.c>

  RewriteEngine on
  RewriteBase /owncloud
  <IfModule mod_env.c>
    SetEnv front_controller_active true
  </IfModule>
  RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  RewriteRule ^\.well-known/host-meta /public.php?service=host-meta [QSA,L]
  RewriteRule ^\.well-known/host-meta\.json /public.php?service=host-meta-json [QSA,L]
  RewriteRule ^\.well-known/carddav /remote.php/dav/ [R=301,L]
  RewriteRule ^\.well-known/caldav /remote.php/dav/ [R=301,L]
  RewriteRule ^remote/(.*) remote.php [QSA,L]
  RewriteRule ^(build|tests|config|lib|3rdparty|templates)/.* - [R=404,L]
  RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/.*
  RewriteRule ^(\.|autotest|occ|issue|indie|db_|console).* - [R=404,L]

  # Rewrite rules for `front_controller_active`
  Options -MultiViews
  RewriteRule ^core/js/oc.js$ index.php [PT,E=PATH_INFO:$1]
  RewriteRule ^core/preview.png$ index.php [PT,E=PATH_INFO:$1]
  RewriteCond %{REQUEST_FILENAME} !\.(css|js|svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$
  RewriteCond %{REQUEST_FILENAME} !core/img/favicon.ico$
  RewriteCond %{REQUEST_FILENAME} !/remote.php
  RewriteCond %{REQUEST_FILENAME} !/public.php
  RewriteCond %{REQUEST_FILENAME} !/cron.php
  RewriteCond %{REQUEST_FILENAME} !/core/ajax/update.php
  RewriteCond %{REQUEST_FILENAME} !/status.php
  RewriteCond %{REQUEST_FILENAME} !/ocs/v1.php
  RewriteCond %{REQUEST_FILENAME} !/ocs/v2.php
  RewriteCond %{REQUEST_FILENAME} !/updater/
  RewriteCond %{REQUEST_FILENAME} !/ocs-provider/
  RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/.*
  RewriteRule .* index.php [PT,E=PATH_INFO:$1]
</IfModule>
<IfModule mod_mime.c>
  AddType image/svg+xml svg svgz
  AddEncoding gzip svgz
</IfModule>
<IfModule mod_dir.c>
  DirectoryIndex index.php index.html
</IfModule>
AddDefaultCharset utf-8
Options -Indexes
<IfModule pagespeed_module>
  ModPagespeed Off
</IfModule>
@Rouzax
Rouzax commented Apr 8, 2016

Hi,
that rule RewriteRule .* index.php [PT,E=PATH_INFO:$1] is not present anymore in the 9.0.1 htaccess file while it was there in the 9.0.0

@bobvandevijver

Without that line, I also get the 403, as the directory apps/files is no longer routed through the index.php file.

@Rouzax
Rouzax commented May 7, 2016 edited

Still have this issue when upgrading from 9.0.1 to 9.0.2, please fix this.
image
Adding the RewriteRule .* index.php [PT,E=PATH_INFO:$1] also does not seem to fix this issue anymore. 😠

@nille02
nille02 commented May 7, 2016

Rouzax if you use debian, ubuntu or rasbian and use the packages. make a chown over the owncloud installation.
sudo chown -R www-data:www-data /var/www/owncloud

after this send OC in the maintenance mode.
sudo -u www-data php /var/www/owncloud/occ maintenance:mode --on
then run the upgrade
sudo -u www-data php /var/www/owncloud/occ upgrade
after this you can deactivate the maintenance mode again
sudo -u www-data php /var/www/owncloud/occ maintenance:mode --off

i hope this can help you.

@Rouzax
Rouzax commented May 7, 2016

Did the zip upload through the file upload of Cpanel and extracted it instead of using WinSCP for the FTP upload. That solved the issue for me for now.

@Rouzax
Rouzax commented May 7, 2016

@nille02: I'm running on a shared hosting server so unfortunately I don't have access to the terminal.

@nille02
nille02 commented May 7, 2016

then check the file permissions on the files. Your Error say that the webserver cant read the htacssess file

@dathbe
dathbe commented May 8, 2016 edited

Confirmed that this is fixed by upgrading to 9.0.2. I upgraded using apt-get on my Pi and then running OCC per the normal OC upgrade instructions. https://doc.owncloud.org/server/9.0/admin_manual/maintenance/package_upgrade.html

Remember to chown all files by the www user (www-data on Pi) before running OCC.

@cslux
cslux commented Jul 3, 2016 edited

Same problem on Debian 8 (jessie):

The following two changes fixes the problem for me until the next ownCloud update (apt-get upgrade).

  1. Adding 'htaccess.RewriteBase' => '/owncloud', to the config/config.php file.
  2. Removing
    <IfModule mod_dir.c>
      DirectorySlash off
    </IfModule>

from the .htaccess file or setting DirectorySlash to on which is default in Apache.

However, next time when I upgrade ownCloud and the .htaccess file gets updated I need to repeat step 2, which is kinda annoying especially if you forgot about the fix.

# sudo -u www-data occ status
  - installed: true
  - version: 9.0.3.2
  - versionstring: 9.0.3
  - edition: 

regards,
Christian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment