The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Apache 2.2 and subdomain issue

Discussion in 'EasyApache' started by hicom, Feb 14, 2008.

  1. hicom

    hicom Well-Known Member

    Joined:
    May 23, 2003
    Messages:
    272
    Likes Received:
    0
    Trophy Points:
    16
    I've been working on this issue for sometime now, but still puzzled on how to fix it. The problem started after upgrading to Apache 2.2 from Apache 1.3 and PHP4 to PHP5.2.5

    WHM 11.15.0 cPanel 11.18.0-S20595
    FREEBSD 6.1-STABLE i386 on standard - WHM X v3.1.0

    There is only one site when adding a new subdomain, the site fails and being to redirect the main section of the site to that subdomain.

    Apache debug log shows:
    Code:
    [Thu Feb 14 11:40:44 2008] [error] [client 202.55.180.41] 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.
    [Thu Feb 14 11:40:44 2008] [debug] core.c(3046): [client 202.55.180.41] r->uri = /index.php
    [Thu Feb 14 11:40:44 2008] [debug] core.c(3052): [client 202.55.180.41] redirected from r->uri = /index.php
    [Thu Feb 14 11:40:44 2008] [debug] core.c(3052): [client 202.55.180.41] redirected from r->uri = /index.php
    
    The site displays the following error on the main page:

    Code:
    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.
    
    Please contact the server administrator, webmaster@test9.the-site.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
    
    More information about this error may be available in the server error log.
    
    Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
    
    Notice how it says contact: webmaser@test9.the-site.com which indicate it is calling the subdomain rather than the main site. this is when accessing http://the-site.com/

    If I place a file inside http://the-site.com/test9/ , that file will be displayed on the main page.

    The only way I was able to work around this problem is by editing httpd.conf and move the <VirtualHost> for test9 to be below the main site <virtualhost>

    If the <virtualhost> of the subdomain is loaded before the main site, it will cause the error above.

    I've checked all paths are correct in httpd.conf, there are no pre-virtualhost settings, and this only happens on one account only. Previous subdomains created prior to the upgrade are not causing any issues.

    I've also made sure there are no htaccess files present in the /public_html/ folder.

    Any ideas on what is causing this issue and how to go about it without constantly modifying httpd.conf?
     
  2. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    If you execute /scripts/rebuildhttpdconf after adding a subdomain, does it restructure httpd.conf properly (subdomain below main )?
     
  3. hicom

    hicom Well-Known Member

    Joined:
    May 23, 2003
    Messages:
    272
    Likes Received:
    0
    Trophy Points:
    16
    I've not tried that one yet, you think I should try it after adding the subdomain or before? Maybe should try it before and after.

    However, looking at httpd.conf this caught my attention for <virtualhost>, I noticed there is no www specified in the server name. In other words, ServerName and ServerAlias are exactly identical.

    Under Apache 1.3, I recall ServerName was www.sitename.com and ServerAlias was sitename.com

    here is a snapshot of the virtual host:

    Code:
    <VirtualHost 202.55.180.41:80>
        ServerName mysitename.com
        ServerAlias mysitename.com
        DocumentRoot /home/mysite/public_html
        ServerAdmin webmaster@mysitename.com
        UseCanonicalName Off
        CustomLog /usr/local/apache/domlogs/mysitename.com combined
        CustomLog /usr/local/apache/domlogs/mysitename.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
        ## User mysite # Needed for Cpanel::ApacheConf
        <IfModule concurrent_php.c>
            php4_admin_value open_basedir "/home/mysite:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
            php5_admin_value open_basedir "/home/mysite:/usr/lib/php:/usr/local/lib/php:/tmp"
        </IfModule>
        <IfModule !concurrent_php.c>
            <IfModule mod_php4.c>
                php_admin_value open_basedir "/home/mysite:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
            </IfModule>
            <IfModule mod_php5.c>
                php_admin_value open_basedir "/home/mysite:/usr/lib/php:/usr/local/lib/php:/tmp"
            </IfModule>
            <IfModule sapi_apache2.c>
                php_admin_value open_basedir "/home/mysite:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
            </IfModule>
        </IfModule>
        <IfModule !mod_disable_suexec.c>
            SuexecUserGroup mysite mysite
        </IfModule>
        ScriptAlias /cgi-bin/ /home/mysite/public_html/cgi-bin/
    
     
  4. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Upgrade to build 20683. The missing 'www' in ServerAlias was a bug in the build you are using.
     
  5. hicom

    hicom Well-Known Member

    Joined:
    May 23, 2003
    Messages:
    272
    Likes Received:
    0
    Trophy Points:
    16
    Thanks, updating to latest stable then running /scripts/rebuildhttpdconf fixed the problem. It was definitely the ServerAlias causing this issue.

    On another note, we have a domain that uses multiple subdomains as blog. So we setup in <virtualhost>
    servername mysitename.com
    serveralias www.mysitename.com *.mysitename.com
    ..
    ....
    </virtualhost>

    However, when adding a subdomain, it must be present before the main site <virtualhost> for it to work. Since ServerAlias for main site is *. I'm not sure if by default cPanel adds subdomains to the end of the file, the beginning of the httpd.conf file or somewhere random?

    Thx,

    Tamouh
     
  6. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    When a sub domain is initially added, it's placed at the end of the file. However, once httpd.conf is rebuilt (either manually or after rebuild Apache) then it should be placed after the main VirtualHost for the account (I think. It may also be order alphabetically. Too many items running through my head at this time).
     
    #6 cPanelKenneth, Feb 17, 2008
    Last edited: Feb 17, 2008
  7. Zion Ahead

    Zion Ahead Well-Known Member

    Joined:
    Nov 10, 2006
    Messages:
    347
    Likes Received:
    0
    Trophy Points:
    16
    I got the same problem on an add-on domain. I deleted it, forced cp upgrade to later version. Then re-added add-on domain. Still getting 500 error. I ran /scripts/rebuildhttpdconf and same problem.

    [Tue Feb 19 19:14:13 2008] [error] [client xxx.184.xxx.214] 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.


    Code:
    <VirtualHost xxx.xxx.66.19:80>
        ServerName addondomain.christianforumsite.com
        ServerAlias www.addondomain.maindomain.com addondomain.com www.addondomain.com
        DocumentRoot /home/user/public_html/addondomain
        ServerAdmin webmaster@addondomain.christianforumsite.com
        UseCanonicalName Off
        CustomLog /usr/local/apache/domlogs/addondomain.christianforumsite.com combined
        CustomLog /usr/local/apache/domlogs/addondomain.christianforumsite.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
        ## User user # Needed for Cpanel::ApacheConf
        <IfModule concurrent_php.c>
            php4_admin_value open_basedir "/home/user:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
            php5_admin_value open_basedir "/home/user:/usr/lib/php:/usr/local/lib/php:/tmp"
        </IfModule>
        <IfModule !concurrent_php.c>
            <IfModule mod_php4.c>
                php_admin_value open_basedir "/home/user:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
            </IfModule>
            <IfModule mod_php5.c>
                php_admin_value open_basedir "/home/user:/usr/lib/php:/usr/local/lib/php:/tmp"
            </IfModule>
            <IfModule sapi_apache2.c>
                php_admin_value open_basedir "/home/user:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
            </IfModule>
        </IfModule>
        <IfModule !mod_disable_suexec.c>
            SuexecUserGroup user user
        </IfModule>
        ScriptAlias /cgi-bin/ /home/user/public_html/addondomain/cgi-bin/
    
    
    </VirtualHost>
     
  8. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Where are the redirects coming from? Do have some set in an Include or .htaccess file? Have you done what was suggested, which is change LogLevel to debug, restart Apache, access the domain and check the error_log?
     
  9. Zion Ahead

    Zion Ahead Well-Known Member

    Joined:
    Nov 10, 2006
    Messages:
    347
    Likes Received:
    0
    Trophy Points:
    16
    I do not know where they are coming from but there is no htaccess file there.

    I changed loglevel warn to loglevel debug, restarted and tailed the logs


    Code:
    [Wed Feb 20 09:15:47 2008] [error] [client 24.184.149.214] 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.
    [Wed Feb 20 09:15:47 2008] [debug] core.c(3046): [client 24.184.149.214] r->uri = /home/user/public_html/vbseo.php
    [Wed Feb 20 09:15:47 2008] [debug] core.c(3052): [client 24.184.149.214] redirected from r->uri = /home/user/public_html/vbseo.php
    [Wed Feb 20 09:15:47 2008] [debug] core.c(3052): [client 24.184.149.214] redirected from r->uri = /home/user/public_html/vbseo.php
    [Wed Feb 20 09:15:47 2008] [debug] core.c(3052): [client 24.184.149.214] redirected from r->uri = /home/user/public_html/vbseo.php
    [Wed Feb 20 09:15:47 2008] [debug] core.c(3052): [client 24.184.149.214] redirected from r->uri = /home/user/public_html/vbseo.php
    [Wed Feb 20 09:15:47 2008] [debug] core.c(3052): [client 24.184.149.214] redirected from r->uri = /home/user/public_html/vbseo.php
    [Wed Feb 20 09:15:47 2008] [debug] core.c(3052): [client 24.184.149.214] redirected from r->uri = /home/user/public_html/vbseo.php
    [Wed Feb 20 09:15:47 2008] [debug] core.c(3052): [client 24.184.149.214] redirected from r->uri = /home/user/public_html/vbseo.php
    [Wed Feb 20 09:15:47 2008] [debug] core.c(3052): [client 24.184.149.214] redirected from r->uri = /home/user/public_html/vbseo.php
    [Wed Feb 20 09:15:47 2008] [debug] core.c(3052): [client 24.184.149.214] redirected from r->uri = /home/user/public_html/vbseo.php
    [Wed Feb 20 09:15:47 2008] [debug] core.c(3052): [client 24.184.149.214] redirected from r->uri = /index.php
    [Wed Feb 20 09:15:47 2008] [error] [client 24.184.149.214] 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.
     
Loading...

Share This Page