Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a centOS machine with multiple public IPs. We are already running one web application.

I now need to host one more web application on that machine by using one of the public IP addresses that is available for that machine.

In clear words, the IP addresses of that machine are x.x.x.226, x.x.x.227, x.x.x.228, x.x.x.229 and x.x.x.230. I want to use one of those addresses for the second web application.

Can any one help me out how to do this?

share|improve this question

migrated from Apr 27 '11 at 9:01

This question came from our site for professional and enthusiast programmers.

Part of the HTTP/1.1 protocol is to send the host name as part of the request -- the web server can then choose to handle requests differently, based on that information to host many websites on a single IP address.

share|improve this answer
Thanks for reply, Can u please give me any reference which contains step by step process so that i can do it in simple way... – Raviraja Apr 26 '11 at 10:52
@Raviraja Not without more information -- if this using a webserver written by "somebody else", then you may want to say what server you're using, and head over to the sister site for webmasters at If this is something you're writing, then you may want to specify the language you're writing in, and share some of your code. – Rowland Shaw Apr 26 '11 at 11:29

As mentions, you can indeed serve many different websites based upon the domain name in each request header. Here's a nice explanation and contrast between name-based and IP-based virtual hosting from apache:

Note that if you plan to use SSL for each of your websites then you may indeed need to setup different IP-based virtual hosts. In this scenario, you'll need to setup an alias on your network adapter to handle one of the new additional public IP addresses. See 13.2.4. Alias and Clone Files, in the centos documentation:

Then you'll need to setup Apache (or whatever web-server you are using) to listen for requests on the new public IP address. Take a look through your web-server's documentation on how to do this. For apache, read:

Hope that helps.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.