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.

server hostname and website domain name?

Discussion in 'General Discussion' started by chmod, May 12, 2004.

  1. chmod

    chmod Well-Known Member

    Joined:
    Apr 20, 2004
    Messages:
    45
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    London - UK
    Can someone tell me if its ok to have as my servers hostname svr.mydomainname.com and have as a virtual account mydomainname.com

    Also how do i configure it if someone types in http//xxx.xx.xxxx.xxx which is my main shared IP to go to mydomainname.com

    thanks

    chmod
     
  2. wipl_piyush

    wipl_piyush Well-Known Member

    Joined:
    Oct 31, 2003
    Messages:
    66
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    NY
    Hello -

    Yes you can creat the hostname and the domain in that manner....

    Although in order to get the site to be browsed using the IP, you need to assign Dedicated IP for the site.
     
  3. eth00

    eth00 Well-Known Member
    PartnerNOC

    Joined:
    Mar 30, 2003
    Messages:
    723
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    NC
    cPanel Access Level:
    Root Administrator
    I usually just edit the http.conf because usually cpanel will not let you put a dedicated ip site on the main box. Just copy another ip based site and change the ip to your main one, then restart apache and your done.

    Of course make sure and backup the httpd.conf incase you screw something up, I am not responsible if you screw it up.
     
  4. chmod

    chmod Well-Known Member

    Joined:
    Apr 20, 2004
    Messages:
    45
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    London - UK
    Thanks..
    So, just to get this straight in my head, I create a new IP account for mydomainname.com in WHM and assign one of my spare IP`s to it, then go into http.conf and change the IP to that of my main shared virtual IP and that account will come up via http://mymainsharedvirtualIP/

    I have not set up a dedicated IP account yet in WHM (only virtuals), will I have all the same account options in WHM for it.

    Will this work even if I also have some virtual accounts on the box.

    Yes I will be sure to backup http.conf before I start :)

    Couple more things

    I`m thinking that maybe a simpler way would be to put a redirect index.html page into /usr/local/apache/htdocs what do you think?

    While I was searching I came across a comment that says"the first virtualhost is what is displayed when someone types the http://ip" I figure they are talking about the http.conf file do you know anything about doing it this way.

    Thanks so much for your help guys, its well appreciated.

    chmod
     
  5. bamasbest

    bamasbest Well-Known Member

    Joined:
    Jan 10, 2004
    Messages:
    531
    Likes Received:
    0
    Trophy Points:
    16
    In essence, with http1.1/shared IP hosting, the first account that is established with the shared IP can have a ptr record and would be the one that resolves whenever someone attempts to access via http://the.ip.add.ress
     
  6. chmod

    chmod Well-Known Member

    Joined:
    Apr 20, 2004
    Messages:
    45
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    London - UK
    AHA.. its becoming much clearer now.

    I need to get my datacenter (who control the IP block) to setup a ptr record for me anyway. (for email purposes with aol, etc)

    So if I remove all accounts on the server (all the accounts on the server are mine and experimental at this stage) and add in a new virtual account for mydomainname.com and then get my datacenter to set up a ptr record for my shared IP and have the ptr record pointing to mydomainname.com when someone goes to http://ip they will get the mydomainname.com account.

    If thats how it works you have also explained the ptr record thing for me, thanks, thanks..

    chmod
     
  7. bamasbest

    bamasbest Well-Known Member

    Joined:
    Jan 10, 2004
    Messages:
    531
    Likes Received:
    0
    Trophy Points:
    16
    Actually, I believe that you are sort of confusing PTR's with reverse DNS.

    Do a google for Ask Mr DNS and you will be able to read more than you ever wanted to know about DNS issues.

    However/Nutshell....

    Generally speaking, the first account listed in your httpd.conf file for a shared IP address would be the account that resolves if accessed via http and the ip address.
     
  8. chmod

    chmod Well-Known Member

    Joined:
    Apr 20, 2004
    Messages:
    45
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    London - UK
    OH.. yes confused again

    please excuse my newb.. thanks for your patience..

    Below is the first entry in the ### Section 3: Virtual Hosts
    part of my http.conf

    # VirtualHost example:
    # Almost any Apache directive may go into a VirtualHost container.
    # The first VirtualHost section is used for requests without a known
    # server name.
    #
    #<VirtualHost *:80>
    # ServerAdmin webmaster@dummy-host.example.com
    # DocumentRoot /www/docs/dummy-host.example.com
    # ServerName dummy-host.example.com
    # ErrorLog logs/dummy-host.example.com-error_log
    # CustomLog logs/dummy-host.example.com-access_log common
    #</VirtualHost>

    #<VirtualHost _default_:*>
    #</VirtualHost>


    -- other stuff --

    NameVirtualHost 111.11.111.111:80
    Alias /bandwidth/ /usr/local/bandmin/htdocs/

    <VirtualHost 111.11.111.111>
    BytesLog domlogs/srv.mydomainname.com-bytes_log
    ServerName srv.mydomainname.com
    DocumentRoot /usr/local/apache/htdocs
    </VirtualHost>


    I`m guessing that the above shouldn`t be the first listed. That is how the http.conf came with the box.
    I have replaced the IP with 111.11.111.111
    srv.mydomainname.com is the hostname of my server.

    I am reading through Ask Mr. DNS now, thanks.
     
  9. chmod

    chmod Well-Known Member

    Joined:
    Apr 20, 2004
    Messages:
    45
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    London - UK
    Well I think I got it. :)

    I backed up my httpd.conf and then removed my test accounts in WHM and then commented out the:

    and added a new named account for mydomainname.com which then appeared first in the list of named accounts in httpd.conf and bingo when I hit http://ip up comes the account mydomainname.com

    Now I`m trying to find out why the quoted above was in there, I`m thinking maybe its a default for new installs.

    My thanks go out to you guys, all your help and tips made this possible for me so far.

    chmod
     
Loading...

Share This Page