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.

Using www. in ServerName - httpd.conf ?

Discussion in 'General Discussion' started by trevHCS, Aug 20, 2008.

  1. trevHCS

    trevHCS Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    69
    Likes Received:
    1
    Trophy Points:
    8
    Is there any way to get WHM to edit the httpd.conf file and swap the ServerName and ServerAlias lines around as it seems to have changed this at some point...?

    For example, in the httpd.conf it currently uses:

    ServerName example.com
    ServerAlias www.example.com

    ...which means if you call on $_SERVER['HTTP_HOST'] or $_SERVER['SERVER_NAME'] in PHP you get the non-www one.


    On older accounts these tend to appear as below, and on some they even appear with both in the alias line.

    ServerName www.example.com
    ServerAlias example.com


    If it's fixed in then I'm sure I'll work around it - no great problems. But thought I'd ask.

    Trev
     
  2. rkm11

    rkm11 Active Member

    Joined:
    May 30, 2007
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    In WHM when you list accounts, what do those domains show up as (www.domain.com or domain.com)

    Check your /var/cpanel/templates/apache2/main.default and see what ServerName and ServerAlias is set to.

    Maybe try to rebuild your httpd.conf?

    Run:
    /usr/local/cpanel/bin/build_apache_conf
     
    #2 rkm11, Aug 20, 2008
    Last edited: Aug 20, 2008
Loading...

Share This Page