server hostname and website domain name?

chmod

Well-Known Member
Apr 20, 2004
45
0
156
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
 

wipl_piyush

Well-Known Member
Oct 31, 2003
66
0
156
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.
 

eth00

Well-Known Member
PartnerNOC
Mar 30, 2003
721
1
168
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.
 

chmod

Well-Known Member
Apr 20, 2004
45
0
156
London - UK
Yes you can creat the hostname and the domain in that manner....
Thanks..
Originally posted by eth00
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.
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
 

bamasbest

Well-Known Member
Jan 10, 2004
531
0
166
Originally posted by chmod
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 [/B]
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
 

chmod

Well-Known Member
Apr 20, 2004
45
0
156
London - UK
Originally posted by bamasbest
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
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
 

bamasbest

Well-Known Member
Jan 10, 2004
531
0
166
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.
 

chmod

Well-Known Member
Apr 20, 2004
45
0
156
London - UK
Originally posted by bamasbest
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.
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 [email protected]
# 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.
 

chmod

Well-Known Member
Apr 20, 2004
45
0
156
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:

<VirtualHost 111.11.111.111>
BytesLog domlogs/srv.mydomainname.com-bytes_log
ServerName srv.mydomainname.com
DocumentRoot /usr/local/apache/htdocs
</VirtualHost>
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