OC 9.1.3 install on webhost leads to Internal Server Error

help

#1

Hi,

I updated my OC manually to 9.1.3 and get an common error message loading login page:

"Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request."

The error log says:
"AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary."

I can't increase the limit due to webhost.

I use a workaround based on this issue https://forum.owncloud.org/viewtopic.php?t=37206 from RealRancor.

I commented the following lines of .htaccess to ignore them

<IfModule mod_rewrite.c>
  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]
  RewriteBase /my/folder/owncloud
  <IfModule mod_env.c>
    SetEnv front_controller_active true
    <IfModule mod_dir.c>
      DirectorySlash off
    </IfModule>
  </IfModule>
</IfModule>

This works. However there is logically a warning in the administration of owncloud about the integrity of hash of .htaccess.

Has anyone a better solution for this issue?

Regards, Bodo Biker


#2

Hello bodobiker,
i have found the error!
In root folder of your owncloud installation, in .htaccess there are following lines:

<IfModule mod_rewrite.c>
  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]
  RewriteBase /
  <IfModule mod_env.c>
    SetEnv front_controller_active true
    <IfModule mod_dir.c>
      DirectorySlash off
    </IfModule>
  </IfModule>
</IfModule>

In my case the path of "Rewrite base" was the error. Don´t change it in .htaccess! Go to the OC config.php, line 'htaccess.RewriteBase' => '/YOURPATH', and then change the path to your folder where your OC installation is. After this try sudo -u www-data php /var/www/html/YOURPATH/occ maintenance:update:htaccess

That´s it.

best regards,
giftzwerg


#3

Hi Giftzwerg,

I tested your solution in my test installation of owncloud. It works. But I can't remember, whether I changed the path in .htaccess or it was done by the update/installation routine. Nevertheless I get a warning due to some changed file(s) in the administration account. I can't update htaccess with sudo because it is a web space installation.
I will check the solution again updating my working owncloud.

Thanks for your help and solution!

Regards,
Bodo Biker