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.

ServerAlias is wrong with every new account

Discussion in 'General Discussion' started by bryanabhay, Feb 25, 2007.

  1. bryanabhay

    bryanabhay Active Member

    Joined:
    Aug 14, 2006
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    6
    Hello,

    Every domain get crated in Httpd.conf file has following setting for it
    at virtual host.

    ServerAlias www.domain.com

    but now when i crete account i can see the entry like

    ServerAlias domain.com

    and due to this every newly created domain did not work for my reseller account.

    What could be the probelm.
     
  2. duranduran

    duranduran Well-Known Member

    Joined:
    Apr 30, 2004
    Messages:
    198
    Likes Received:
    0
    Trophy Points:
    16
    I have the same problem (CPANEL11).
     
  3. Frimon86

    Frimon86 BANNED

    Joined:
    Jun 4, 2007
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    0
    Check your server settings, make sure that when you have a account created it doesnt show that I think their is an option for that .. somewhere. Have you tried editing the domain?
     
  4. duranduran

    duranduran Well-Known Member

    Joined:
    Apr 30, 2004
    Messages:
    198
    Likes Received:
    0
    Trophy Points:
    16
    This is the error

    See, When I add a domain i see in httpd.conf :

    <VirtualHost IPIPIPIP>
    ServerAlias www.example.com
    ServerAdmin webmaster@example.com
    DocumentRoot /home2/example/public_html
    ServerName example.com

    <IfModule mod_suphp.c>
    suPHP_UserGroup example example
    </IfModule>
    <IfModule mod_php4.c>
    php_admin_value open_basedir "/home2/example:/usr/lib/php:/usr/local/lib/php:/tmp"
    </IfModule>
    <IfModule mod_php5.c>
    php_admin_value open_basedir "/home2/example:/usr/lib/php:/usr/local/lib/php:/tmp"
    </IfModule>

    User example
    Group example
    BytesLog /usr/local/apache/domlogs/example.com-bytes_log
    CustomLog /usr/local/apache/domlogs/example.com combined
    ScriptAlias /cgi-bin/ /home2/example/public_html/cgi-bin/
    </VirtualHost>

    The correct would be

    <VirtualHost IPIPIPIP>
    ServerAlias example.com
    ServerAdmin webmaster@example.com
    DocumentRoot /home2/example/public_html
    ServerName www.example.com

    <IfModule mod_suphp.c>
    suPHP_UserGroup example example
    </IfModule>
    <IfModule mod_php4.c>
    php_admin_value open_basedir "/home2/example:/usr/lib/php:/usr/local/lib/php:/tmp"
    </IfModule>
    <IfModule mod_php5.c>
    php_admin_value open_basedir "/home2/example:/usr/lib/php:/usr/local/lib/php:/tmp"
    </IfModule>

    User example
    Group example
    BytesLog /usr/local/apache/domlogs/example.com-bytes_log
    CustomLog /usr/local/apache/domlogs/example.com combined
    ScriptAlias /cgi-bin/ /home2/example/public_html/cgi-bin/
    </VirtualHost>

    This configuration worked before in the old version of CPANEL.
     
  5. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,447
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    In Tweak Settings:

    When adding a new domain, if the domain is already registered, ignore the configured nameservers, and set the NS line to the authoritative (registered) ones.


    edit: bad answer.
     
  6. AlanH

    AlanH Active Member

    Joined:
    Mar 25, 2006
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
    Anyone found a way to get the old behaviour back yet? It's causing a headache with mod_dir redirects on one of our sites as it always redirects to domain.com rather than www.domain.com - which doesn't work.

    There used to be a vhost.default template file but I see this has changed in cPanel 11.
     
  7. Elikster

    Elikster Well-Known Member

    Joined:
    Feb 8, 2003
    Messages:
    119
    Likes Received:
    1
    Trophy Points:
    18
    Was this with Edge Cpanel installations?
     
  8. AlanH

    AlanH Active Member

    Joined:
    Mar 25, 2006
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
    No, this is with cPanel RELEASE build - 11.6.0-R15076
     
  9. mdelacruz

    mdelacruz Member

    Joined:
    Apr 24, 2004
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    Any solution?

    Any solution with this issue? I'm having the same problem with my server.
     
  10. AlanH

    AlanH Active Member

    Joined:
    Mar 25, 2006
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
    There doesn't seem to be a solution. I haven't raised it as a support issue as it's only affecting one site. We use .htaccess rewrites to cope with cases where mod_dir adds the slash and redirects to the server name which is missing the www. The site we are having problems with has the DNS handled elsewhere so only the www has the correct IP address. When mod_dir redirects something like www.somedomain.com/admin to somedomain.com/admin/ it ends up requesting from the wrong IP address.

    Workaround seems to be to manually change httpd.conf but it's a pain in the backside.
     
  11. AlanH

    AlanH Active Member

    Joined:
    Mar 25, 2006
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
    Workaround

    Setting UseCanonicalName Off in the virtual host sorts out my issue which was incorrect redirections when trailing slashes are omitted. By setting this to off, apache takes the HTTP_HOST from the client request rather than building the redirect with the server name.

    I've only done this on the sites I've had problems with by manually updating their virtualhost entries in httpd.conf. It could probably be changed server wide - but only after testing to make sure nothing else breaks!
     
  12. fenixer

    fenixer Well-Known Member

    Joined:
    Feb 23, 2007
    Messages:
    92
    Likes Received:
    0
    Trophy Points:
    6
    Somebody tested server wide????? do you think it may break or would be ok??

    Code:
    # UseCanonicalName:  (new for 1.3)  With this setting turned on, whenever
    # Apache needs to construct a self-referencing URL (a URL that refers back
    # to the server the response is coming from) it will use ServerName and
    # Port to form a "canonical" name.  With this setting off, Apache will
    # use the hostname:port that the client supplied, when possible.  This
    # also affects SERVER_NAME and SERVER_PORT in CGI scripts.
    # 
    UseCanonicalName On
    
    I think there is no important virtualhosts in the server but the aliases for cpanel and WHM, etc... Think all could be allright with usecanonicalname off globally, but I am bit frightened....
     
  13. AlanH

    AlanH Active Member

    Joined:
    Mar 25, 2006
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
    Just changed it globally on one of our servers and nothing seems to have broken so give it a go.
     
Loading...

Share This Page