Request exceeded the limit of 10 internal redirects

Discussion in 'ISPConfig 3 Priority Support' started by pebkac, Jun 5, 2018.

  1. pebkac

    pebkac Member

    Hello,

    We have one subdomain that stopped working last night. The error log shows this.
    Code:
    [Tue Jun 05 09:06:48.557634 2018] [core:error] [pid 21422] [client 24.117.187.118:50948] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: https://dev1.xxxxxx.xxx/
    The only changes we made in ISPconfig was added a redirect with no flag to our main site because we are not going to have our main site in this server any longer. Not sure if that had anything to do with it or not, but we rolled that back and still are getting this error. My question is this a problem with ISPconfig or a problem with the code for this subdomain site?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Probably your site or a .htaccess file redirects to an old url and ispconfig to the new one that you have set as redirect which results in a loop. That the redirect still persists after you removed it in ISPConfig might be a browser caching issue. But you might want to check in the vhost file of the site if the redirect has been really removed.
     
  3. pebkac

    pebkac Member

    where do I find the vhost file?
     
  4. pebkac

    pebkac Member

    I think I found it, this is the site in question.
    PHP:
        RewriteCond %{HTTP_HOST}   ^dev1\.nextcode\.info$ [NC]
                    
    RewriteCond %{REQUEST_URI} !^/webdav/
            
    RewriteCond %{REQUEST_URI} !^/php5-fcgi/
            
    RewriteCond %{REQUEST_URI} !^/subdomains/dev1/
            
            
    RewriteRule   ^/(.*)$ /subdomains/dev1/$1  [L]
        
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, you removed the redirect from ispconfig, but it is still in the vhost file? If that's the case. is there a copy of the vhost file with .err file ending in the apache sites-available folder?
     
  6. pebkac

    pebkac Member

    So the only thing we did was add a redirect to our root site, which is nextcode.info, we added a no flag to https://getnextcode.com. After we found that the subdomain dev1.nextcode.info was not working. So I removed that redirect but the problem still continues. So the dev1 has a redirect to go to /subdomains/dev1/ . We have many more subdomains in this site and they all work, just this one does not.
     
  7. pebkac

    pebkac Member

    also, when we go to that site in a browser it show a directory listing only.
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Like I posted above, a redirect loop means that you must have two redirects and you have to find them to stop the loop. Redirects can be in the application that is run in the site, in the vhost file and in .htaccess files. That a redirect does not stop can be just a caching issue in your browser or it can mean that the vhost file cannot be written, that's why I asked if there is an .err file and if the redirect you removed is still in the vhost file or not.
     
  9. pebkac

    pebkac Member

    Ok, where would find the .err file?
     
  10. pebkac

    pebkac Member

    Here is the vhost file
    here
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    When there is a .err file, then this file can be found in the apache sites-available folder.
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    switch off the redirect for the affected subdomain in ispconfig by setting redirect to 'no redirect' on the reditrect tab of the subdomain. Then wait until the changes have been written (about 1 minute). Then check if the redirect still happens and if that's the case, then take a look into the vhost file to see if the redirect code for that subdomain is still in there or not.
     
  13. pebkac

    pebkac Member

    There is no .err file there.
    I removed the redirect flag for that subdomain. Waited, and then tried to access that url, it loaded our root website. So the redirect did turn off. I reenabled it and it is still just loading the Index of directory files there. Also in the error log we are seeing the same, Request exceeded...
     
  14. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, yo you know now that you have a redirect loop and that you can turn off that redirect loop by removing this redirect. A loop consists always of two redirects, so now you'll have to find the other redirect and remove that if you want to be able to turn this first redirect on again successfully. And I mentioned it above already, a redirect can be initiated not only by the vhost config but also by the software that you rin in that website or by a .htaccess file.
     
  15. pebkac

    pebkac Member

    Thanks till.

    I think we are past the redirect issue at this point. I have a question regarding the apache vhost config files. What is the difference between the sites-enabled and sites-available?

    I'm trying to compare what he changed from a backup. Problem is I can't seem to read those files, like the /etc/apache2/sites-enabled/100.xxxx.xxx.vhost. I have the volume mounted to a temp AWS instance and can navigate the volume but when I try,

    cat /mnt/backup/etc/apache2/sites-enabled/100-nextcode.info.vhost

    cat: /mnt/backup/etc/apache2/sites-enabled/100-nextcode.info.vhost: No such file or directory

    I guessing because it is not on the original server?
     
  16. till

    till Super Moderator Staff Member ISPConfig Developer

    The vhost file is in sites-available folder. In sites-enabled, there is just a symlink to the file in the sites-available folder when the site is active.

    You have to compare them in sites-available, not in sites-enabled.
     
  17. pebkac

    pebkac Member

    Ah ok. Thanks.
     
  18. pebkac

    pebkac Member

    So I just found what the dev added to the file and it needs to get back in, how can add this through ISPConfig?

    Code:
    </VirtualHost>
    
    <VirtualHost *:80>
        DocumentRoot /var/www/clients/client1/web1/web/subdomains/dev1/www
        ServerName dev1.nextcode.info
        <Directory /var/www/clients/client1/web1/web/subdomains/dev1/www>
            #Options +Indexes +FollowSymLinks + ExecCGI
        AllowOverride All
        Require all granted
        </Directory>
        AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript
    </VirtualHost>
    
    <VirtualHost *:443>
        SSLEngine on
        SSLProtocol All -SSLv2 -SSLv3
        SSLCertificateFile /var/www/clients/client1/web1/ssl/*.nextcode.info.crt
        SSLCertificateKeyFile /var/www/clients/client1/web1/ssl/*.nextcode.info.key
        SSLCertificateChainFile /var/www/clients/client1/web1/ssl/*.nextcode.info.bundle
        <Directory /var/www/clients/client1/web1/web/subdomains/dev1/www>
            Options +Indexes +FollowSymLinks +ExecCGI
        AllowOverride All
            #Order allow,deny
        #Allow from all
        Require all granted
        </Directory>
        DocumentRoot /var/www/clients/client1/web1/web/subdomains/dev1/www
        ServerName dev1.nextcode.info
        AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript
        #SetEnv APP_ENV test
    </VirtualHost>
    That was added after this:
    Code:
        </IfModule>
    
    FcgidMaxRequestLen 104857600
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
    
    
     
  19. till

    till Super Moderator Staff Member ISPConfig Developer

    These are two separate vhosts, something like that should not be added into the vhost of a website, it has to go into their own file. Create a new file for this in sites-available and then enable it with a symlink in sites-enabled folder. But normally you would so something like that with vhost subdomains in ISPConfig and not by adding config manually.
     
  20. pebkac

    pebkac Member

    I would like to accomplish this through ISPConfig, is it possible?
     

Share This Page