PDA

View Full Version : [ubuntu] IP based vs Name Based - Apache2



acc61287
August 23rd, 2012, 02:53 AM
Hey guys! What do you prefer to use, ip based or name based on apache virtual hosting? Can you tell me some advantages and disadvantages?

Thanks!;)

sandyd
August 23rd, 2012, 04:12 AM
Fundamental Differences


Name Based virtual hosting allows you to host several sites at one IP Address
IP based virtual hosting allows you to host one site at each IP address
No matter what you name the domain, if you are using IP Based Virtual Hosting, the content in the site will always be the content hosted on the IP.

Really, IP based hosting is more expensive, as the prices of IP addresses are rising like nuts today.

For hosting multiple sites, name based virtual hosting makes more sense.

ungunyu
February 23rd, 2013, 11:27 AM
I have a dedicated ip and i choose that for hosting many of my websites. When I enter the ip in my browser my primary site opens always :popcorn:

chrisguk
February 23rd, 2013, 11:02 PM
I have a dedicated ip and i choose that for hosting many of my websites. When I enter the ip in my browser my primary site opens always :popcorn:

You need to create CNAME records for each of your websites, assuming they are on a local web server. You can then create an alias in the VHost block something like this. I recently made a tutorial on DNS Server and Virtual hosts which incorporated an automatic Vhost creation script. Feel free to check it out.

For websites though you should always choose name based as opposed to IP based because thats just the way its done. Imagine if we could only navigate to websites using an IP :popcorn: that would be a hell of a task.