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.

Change default domain on a server?

Discussion in 'General Discussion' started by Smack, Aug 25, 2004.

  1. Smack

    Smack Member

    Joined:
    Aug 25, 2004
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    MI, USA
    I have a dedicated server and have a small problem - I want to change the "default" site/domain that comes up when someone enters the server's IP address. I'm running RedHat 9 and cPanel/WebHost Manager. I've gone through the menu and I don't see where this is set, if anywhere.

    A Google search using variations of "redhat server default domain" and "default domain for a server" didn't tell me anything I recognized as an answer - and I'm not even sure if I'm searching using the correct terms. Could anyone give me some direction? I'd appreciate it. Thanks.

    Note: I use an outside source as my nameservers (not my own), if that makes any difference.
     
  2. GOT

    GOT Get Proactive!

    Joined:
    Apr 8, 2003
    Messages:
    900
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Norfolk, VA
    cPanel Access Level:
    DataCenter Provider
    Typically the first entry in teh httpd.conf file will popint to where people are directed if they typie in that IP address. This is normally /usr/local/apache/htdocs. You can change this to whatever directory on the server you want.
     
  3. Smack

    Smack Member

    Joined:
    Aug 25, 2004
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    MI, USA
    Thanks - I appreciate the help. Is this on the nameserver or the server itself? And for an even dumber question - how can I get in to edit this file? I'm very new at this and it is a hobby - please excuse my ignorance.

    Also, if anyone knows, how is it determined which site is listed first? The site that is coming up is not the first alphabetical domiain, and it wasn't the first domain that was entered on the server. Just curious....

    Thanks again.
     
    #3 Smack, Aug 25, 2004
    Last edited: Aug 25, 2004
  4. GOT

    GOT Get Proactive!

    Joined:
    Apr 8, 2003
    Messages:
    900
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Norfolk, VA
    cPanel Access Level:
    DataCenter Provider
    It should have been the first site added on that IP.

    ANyway, shell into your box and:

    pico /etc/httpd/conf/httpd.conf

    Have fun
     
  5. Smack

    Smack Member

    Joined:
    Aug 25, 2004
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    MI, USA
    I was editing my post as you responded - is this on the server itself or on the nameserver?
     
  6. SarcNBit

    SarcNBit Well-Known Member

    Joined:
    Oct 14, 2003
    Messages:
    1,010
    Likes Received:
    3
    Trophy Points:
    38
    The server that hosts the web site.
     
  7. linux-image

    linux-image Well-Known Member

    Joined:
    Jun 8, 2004
    Messages:
    1,192
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    Root Administrator
    iam sorry to interrupt; the path to the httpd.conf in a C-panel server is: /usr/local/apache/conf/hhtpd.conf and NOT /etc/httpd/conf/httpd.conf.
     
  8. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    If there is trouble, it will find me
    They're symlinked, so it doesn't matter.
     
  9. linux-image

    linux-image Well-Known Member

    Joined:
    Jun 8, 2004
    Messages:
    1,192
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    Root Administrator
    yes.. you are correct :) i made a mistake there.
     
  10. Smack

    Smack Member

    Joined:
    Aug 25, 2004
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    MI, USA
    Again, forgive my ignorance, but I do not know how to do this. Could someone explain?
     
  11. GOT

    GOT Get Proactive!

    Joined:
    Apr 8, 2003
    Messages:
    900
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Norfolk, VA
    cPanel Access Level:
    DataCenter Provider
    Well, you need to get an SSH program. Many people use Putty (http://www.chiark.greenend.org.uk/~sgtatham/putty/) and you use this to shell into your server.

    If you've never done this before, then you might want to get yourself a book on Linux, as adminitrating a server takes a lot more than just using cPanel. cPanel us nice, but it won't do everything for you, so you are going to need to learn how the Linux shell works. Explaining all that is a little beyond the scope here.

    But, if you want to go straight into it, then get Putty, shell into your server using the root login and your root password and then execute:

    pico /etc/httpd/conf/httpd.conf

    But this file is going to be a bit confusing for you as well if you've never messed with this stuff before...

    Do a search in this file for NameVirtualHost. You'll find a number of them, but you want to find the one that has your main server IP listed right after it.

    The first <VirtualHost xx.xx.xx.xx> below that contains the information for the site that will come up if only the IP address is entered.
     
  12. GOT

    GOT Get Proactive!

    Joined:
    Apr 8, 2003
    Messages:
    900
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Norfolk, VA
    cPanel Access Level:
    DataCenter Provider
    I'm glad you got here before I did. :)
     
  13. Smack

    Smack Member

    Joined:
    Aug 25, 2004
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    MI, USA
    GotHosting - thanks for the help. I got Putty and I'm in, and I found that indeed the domain that is coming up automatically is the first entry in the list.

    The one I want to be coming up instead is listed second.

    I realize this isn't a Putty or Shell support forum, but if there's anyone that can give me a quick tip as to how to switch these I'd be most appreciative (and GotHosting - thanks for the advice - I'll be picking up a Linux book as soon as I can get out of the house).

    Thanks again for the assistance.
     
  14. GOT

    GOT Get Proactive!

    Joined:
    Apr 8, 2003
    Messages:
    900
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Norfolk, VA
    cPanel Access Level:
    DataCenter Provider
    You can use your mouse to drag and highlight an area. As soon as you release it it is automatically copied to your clipboard. Then put the cursor where you want that information moved to and right-click your mouse and it will paste it in there.
     
Loading...

Share This Page