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.

May the hostname have a website?

Discussion in 'General Discussion' started by Stefaans, Sep 24, 2003.

  1. Stefaans

    Stefaans Well-Known Member

    Joined:
    Mar 5, 2002
    Messages:
    451
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Vancouver, Canada
    I want to have a web site that uses my server hostname. But it seems like it is not allowed?

    Imagine my server hostname is server1.mydomain.com. I also want to create an account that dispays a web site for http://server1.mydomain.com. WHM does not like me doing this, but I can work arround it by creating a dummy account, e.g. for mydomain.com, and then parking server1.mydomain.com on it.

    It would appear as if there may be some good reasons why one should not do this. Recent threads on the Forum suggest that it may be the cause of "unroutable domain" errors and default mail accounts not receiving e-mail.

    Also the lastest /scripts/updateuserdomains tells me in no uncertain terms that
    Could you please explain why this "should never happen". Or, if I may have a website for the hostname, what is the correct way to set it up?

    Thanks ;)

    cPanel.net Support Ticket Number:
     
  2. Marty

    Marty Well-Known Member

    Joined:
    Oct 10, 2001
    Messages:
    630
    Likes Received:
    1
    Trophy Points:
    18
    Here is what I do.

    Create an account on the main server shared ip using the domain server2.domain.com.

    Edit the httpd.conf file. Find the virtual host entery for server2.domain.com and copy the entire contents of that virtual host an replace the contents of the server1.domain.com virtual host with it. Then edit the contents of this newly pasted content of server1.domain.com virtual host by replacing every occurance of server2.domain.com with server1.domain.com.

    Save httpd.conf and restart apache. Now server1.2hostdns.com will point to the same document directory that server2.domain.com points to. You can use the control panel for server2.domain.com to manage server1.domain.com except for email.

    cPanel.net Support Ticket Number:
     
  3. Stefaans

    Stefaans Well-Known Member

    Joined:
    Mar 5, 2002
    Messages:
    451
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Vancouver, Canada
    Thanks Marty, that makes sense. It is actually similar to how I got it to work, except for the ownership of the account. I will try your way as well.

    The e-mail I indeed also manage by manually editing the file in /etc/valiases/server1.mydomain.com (where server1.mydomain.com is the hostname). I have found that cPanel updates deletes this file, so I have to keep it immutable with chattr +i. Yet another sign that doing all of this is possibly bending the "rules" :(

    But what are the "rules" exactly? Why the comment "Serious Problem -- This should never happen!!" :confused:

    cPanel.net Support Ticket Number:
     
  4. perlchild

    perlchild Well-Known Member

    Joined:
    Sep 1, 2002
    Messages:
    279
    Likes Received:
    0
    Trophy Points:
    16
    The machine name being configured for mail caused my mail to bounce at several occasions in the past, check threads under backend/scripts
    The machine name is used for "domain owner accounts"(the accounts that have control panel access) so configuring it for mail will most likely cause lots of grief.
    The short trouble-free version is:
    use another name for the server, and use the name you wanted for a parked/addon domain and/or account.
    cPanel.net Support Ticket Number:
     
    #4 perlchild, Sep 24, 2003
    Last edited: Sep 24, 2003
  5. Stefaans

    Stefaans Well-Known Member

    Joined:
    Mar 5, 2002
    Messages:
    451
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Vancouver, Canada
    Thanks Perchild, that is likely what I will do in the end. For now Marty's method works for me, but I am scared of problems in the future.

    I am still curious to know what the technical/security explanation would be for this "restriction".

    cPanel.net Support Ticket Number:
     
  6. perlchild

    perlchild Well-Known Member

    Joined:
    Sep 1, 2002
    Messages:
    279
    Likes Received:
    0
    Trophy Points:
    16
    I have told you what the technical explanation was...
    the machine name is used internally by exim for delivery of non-qualified accounts.
    You should not reuse it for a domain, as that confuses exim. Please read my post more carefully.
    You CAN use it without problems for web(I do that) but
    http://forums.cpanel.net/showthread.php?s=&threadid=14894
    Points out the problems some people had with machine names being used for mail delivery.
    I added the machine name to httpd.conf manually btw, just so /scripts/userdomains and other cpanel scripts, don't readd the domain to the exim config files.

    cPanel.net Support Ticket Number:
     
  7. Stefaans

    Stefaans Well-Known Member

    Joined:
    Mar 5, 2002
    Messages:
    451
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Vancouver, Canada
    Thanks, I understand it better now ;)

    cPanel.net Support Ticket Number:
     
  8. Stefaans

    Stefaans Well-Known Member

    Joined:
    Mar 5, 2002
    Messages:
    451
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Vancouver, Canada
    Thanks Marty and Perlchild. I have now created ServerAlias for the hostname in httpd.conf. Nowhere else (in cPanel) is there any other reference to my use of hostname. Seem like all is working fine ;)

    cPanel.net Support Ticket Number:
     
Loading...

Share This Page