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.

ServerName and ServerAlias values reversed in httpd.conf when adding new account

Discussion in 'General Discussion' started by mwmconsulting, Oct 25, 2007.

  1. mwmconsulting

    mwmconsulting Member

    Joined:
    Apr 15, 2006
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    Greetings cPanelers,

    I've come across a most peculiar situation. In the past, when I added a new account to my VPS via WHM, it would create several entries for the new domain in Apache's httpd.conf file. Among these entries were two that looked like this:

    Code:
    ServerAlias domain.com
    ServerName www.domain.com
    However, it seems as of late it's adding them like this:

    Code:
    ServerAlias www.domain.com
    ServerName domain.com
    As you can see the values have been reversed. Now, this might seem innocent enough, however it is causing problems when I try to Web Protect a directory. Basically, when accessing the protected directory it asks the username and password twice. Once for www.domain.com and then again for domain.com.

    The explanation for this is here:

    http://httpd.apache.org/docs/1.3/misc/FAQ.html#prompted-twice

    My host provider seems to think the cPanel developers have changed the cPanel templates recently. I looked at the /usr/local/cpanel/etc/httptemplates/apache1/default file and it seems to be correct. With regards to these two values it reads:

    Code:
    ServerAlias #serveralias#
    ...
    ServerName #servername#
    Any idea what's going on here? Has cPanel changed something?
     
  2. mwmconsulting

    mwmconsulting Member

    Joined:
    Apr 15, 2006
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    Perhaps this is a bug and needs to be reported to the cPanel developers?

    Anyone...anyone? Bueller...Bueller?

    :confused:
     
  3. mtindor

    mtindor Well-Known Member

    Joined:
    Sep 14, 2004
    Messages:
    1,281
    Likes Received:
    37
    Trophy Points:
    48
    Location:
    inside a catfish
    cPanel Access Level:
    Root Administrator
    It's definitely a 'bug' in my book. I've got a customer who I'm dealing with right now who is affected by this.

    Mike
     
  4. mwmconsulting

    mwmconsulting Member

    Joined:
    Apr 15, 2006
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for replying mtindor.

    Is there a process by which we submit this bug? I figured a cPanel admin/developer would of replied to this post by now. It's a pretty major bug.

    :confused:
     
  5. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    cPanel Developers, Support Staff etc. do not routinely monitor the community forums. If you wish to submit a feature request or bug report, please do so via:

    http://bugzilla.cpanel.net

    If you feel the issue is urgent and desire a support team member to look into the issue for you, submit a support ticket.

    These forums are not an official means of submitting bug reports, feature requests or support issues.
     
  6. mwmconsulting

    mwmconsulting Member

    Joined:
    Apr 15, 2006
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
  7. ile

    ile Registered

    Joined:
    Aug 10, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    I have this same problem and I've been having it for quite a while.

    In the bug report it says that it is fixed. So, what the current situation might be?

    In my vhost.default file I have these:

    Code:
    ServerName [% vhost.servername %]
    ServerAlias [% vhost.serveralias %]
    So they seem to be ok. But when I create a site (naming it x.com or www.x.com) it always ends up as ServerName x.com (I would like it to be www.x.com) which ends up causing problems.

    Any ideas? Should I reopen the bug, create a new bug or am I doing something wrong?

    Thanks.
     
    #7 ile, Aug 10, 2010
    Last edited: Aug 10, 2010
  8. ile

    ile Registered

    Joined:
    Aug 10, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    One thing,

    In /var/cpanel/userdata/x/x.com file I have these

    Code:
    serveralias: www.x.com
    servername: x.com
    So, at least these are consistent with the generated httpd.conf.

    But, how could I reverse these? I would like to have

    Code:
    serveralias: x.com
    servername: www.x.com
    Thanks again.
     
  9. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,460
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Account creation uses different templates for generating the VirtualHost entry than the rest of the system does. The templates used are in /usr/local/cpanel/etc and are overwritten during each update. There is work underway to convert account creation to using the same templates as the rest of the system but there is no ETA on completion.
     
Loading...
Similar Threads - ServerName ServerAlias values
  1. itmangeo
    Replies:
    1
    Views:
    209

Share This Page