May the hostname have a website?

Stefaans

Well-Known Member
Mar 5, 2002
461
4
318
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
== WORKAROUND ENABLED ==
Serious Problem -- This should never happen!!
The hostname server1.mydomain.com is owned by the usermyuser
== WORKAROUND ENABLED ==
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:
 

Marty

Well-Known Member
Oct 10, 2001
629
1
318
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:
 

Stefaans

Well-Known Member
Mar 5, 2002
461
4
318
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:
 

perlchild

Well-Known Member
Sep 1, 2002
279
0
166
Originally posted by Stefaans
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:
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:
 
Last edited:

Stefaans

Well-Known Member
Mar 5, 2002
461
4
318
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:
 

perlchild

Well-Known Member
Sep 1, 2002
279
0
166
Originally posted by Stefaans

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

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:
 

Stefaans

Well-Known Member
Mar 5, 2002
461
4
318
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: