1

I have tried both the package manager upgrade and a manual upgrade to move to the latest ownCloud version (9). Both methods end up with the same result; the page http://localhost/owncloud no longer shows the login page. Instead, I get a 404 Not Found error page. It complains:

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

but this file still exists, as shown here:

$ ll /var/www/owncloud/index.php
-rw-r--r-- 1 www-data www-data 2026 March  8 08:54 /var/www/owncloud/index.php

That, I do not understand but I will admit I know very little about php.

If I restore my whole system from a backup, ownCloud 8 works fine again. I tried a manual upgrade (again) from this state, and the result is the same.

For completeness, here are the steps I used in my manual upgrade:

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

tar xjf owncloud-9.0.0.tar.bz2

sudo service apache2 stop

sudo mv /var/www/owncloud /var/www/owncloud-old

sudo cp -avr owncloud /var/www

sudo cp backups/config.php /var/www/owncloud/config/config.php

sudo service apache2 start

sudo chown -R www-data:www-data /var/www/owncloud

sudo -u www-data /var/www/owncloud/occ upgrade

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

apache2's error.log does not show a problem. It could be a configuration issue but I do not possess the expertise to understand why OC 8 and OC 9 would behave differently. owncloud.conf is:

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

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

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

    SetEnv HOME /var/www/owncloud
    SetEnv HTTP_HOME /var/www/owncloud


</Directory>

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

Based on fkraiem's comments, how can I make sure/know that my server is not looking for /var/www/var/www/owncloud/index.php ? EDIT: After doing the following in a virtual machine, the problem persists which probably rules this out:

cd /var/www
sudo mkdir var
sudo mkdir var/www
sudo cp -avr owncloud var/www

/edit

Is this a php issue, after all? How do I start troubleshooting based on the symptoms of apache saying that a file cannot be found, but exists?

  • Does the error message really include the full path (with /var/www)? It does not do that on my server... – fkraiem Mar 19 '16 at 14:20
  • Yes, it does. Maybe it should not? Will update the post with my owncloud.conf. – Tfb9 Mar 19 '16 at 14:35
  • I'm not sure, but since on mine it does not show it, it makes me think maybe your server is looking for /var/www/var/www/owncloud/index.php for some reason... – fkraiem Mar 19 '16 at 14:49
  • By the way, is owncloud.conf enabled (i.e., is it in /etc/apache2/conf-enabled)? If it isn't, the Alias directive is not applied, which may cause your problem. – fkraiem Mar 19 '16 at 15:37
  • Yes it appears in /etc/apache2/conf-enabled by way of a link, interesting comment about Alias though. I reproduce the whole problem perfect on Windows-hosted VMWare execution of Ubuntu 15.10, and a fresh install of ownCloud 9. – Tfb9 Mar 19 '16 at 16:18
4

There is a tracker for this issue at https://github.com/owncloud/core/issues/22970 .

The workaround for the moment is editing the file /var/www/owncloud/.htaccess and commenting out the line

RewriteRule .* index.php [PT,E=PATH_INFO:$1]

like so

# RewriteRule .* index.php [PT,E=PATH_INFO:$1]

Save and from the command line do sudo service apache2 restart.

I would appreciate anyone's time explaining to me what that line is meant to do.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.