Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Member
    Join Date
    Nov 2003
    Posts
    67

    Default Using www. in ServerName - httpd.conf ?

    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. #2
    Member rkm11's Avatar
    Join Date
    May 2007
    Posts
    31

    Default

    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
    Last edited by rkm11; 08-20-2008 at 01:24 PM.

Similar Threads & Tags
Similar threads

  1. ServerName and ServerAlias values reversed in httpd.conf when adding new account
    By mwmconsulting in forum cPanel and WHM Discussions
    Replies: 8
    Last Post: 08-12-2010, 10:35 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. httpd.conf sites/www.domain.com.conf Wildcard DNS
    By ttremain in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 12-16-2008, 12:19 PM
  4. EasyApache breaks httpd.conf (removal of www.domainname in Alias)
    By meganet in forum cPanel and WHM Discussions
    Replies: 20
    Last Post: 02-27-2008, 02:18 AM
  5. 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
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube