Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    Member mwmconsulting's Avatar
    Join Date
    Apr 2006
    Posts
    21

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

    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/mis...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?
    ========================
    MWM Consulting, Inc.
    InSiteful Business Solutions
    http://www.mwmconsulting.biz
    ========================

  2. #2
    Member mwmconsulting's Avatar
    Join Date
    Apr 2006
    Posts
    21

    Default

    Perhaps this is a bug and needs to be reported to the cPanel developers?

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

    ========================
    MWM Consulting, Inc.
    InSiteful Business Solutions
    http://www.mwmconsulting.biz
    ========================

  3. #3
    Member
    Join Date
    Sep 2004
    Posts
    887

    Default

    Quote Originally Posted by mwmconsulting View Post
    Perhaps this is a bug and needs to be reported to the cPanel developers?

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

    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. #4
    Member mwmconsulting's Avatar
    Join Date
    Apr 2006
    Posts
    21

    Default

    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.

    ========================
    MWM Consulting, Inc.
    InSiteful Business Solutions
    http://www.mwmconsulting.biz
    ========================

  5. #5
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    10,718
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by mwmconsulting View Post
    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.

    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. #6
    Member mwmconsulting's Avatar
    Join Date
    Apr 2006
    Posts
    21

    Default

    Ok, thx DavidG. I've submitted the bug here:

    http://bugzilla.cpanel.net/show_bug.cgi?id=6089

    Cheers!

    - MWM
    ========================
    MWM Consulting, Inc.
    InSiteful Business Solutions
    http://www.mwmconsulting.biz
    ========================

  7. #7
    ile
    ile is offline
    Registered User
    Join Date
    Aug 2010
    Posts
    2

    Default

    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.
    Last edited by ile; 08-10-2010 at 06:19 PM.

  8. #8
    ile
    ile is offline
    Registered User
    Join Date
    Aug 2010
    Posts
    2

    Default

    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. #9
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,768
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    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.
    Kenneth
    Product Development
    cPanel, Inc.

Similar Threads & Tags
Similar threads

  1. Adding an Alias to an account in httpd.conf that will survive a rebuild?
    By Kadence in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 10-04-2009, 06:03 AM
  2. ServerAlias and ServerName are Backwards in httpd.conf
    By zelf in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 06-15-2009, 01:21 AM
  3. Using www. in ServerName - httpd.conf ?
    By trevHCS in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 08-20-2008, 01:22 PM
  4. ServerName and ServerAlias swapped over in httpd.conf :(
    By girishn in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 09-07-2007, 08:11 AM
  5. Addon Domain Problem - Serveralias not added to httpd.conf
    By mydomain in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 11-23-2004, 06:57 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube