Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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 server which has one static IP address (let's say it's x.x.x.x). How can I set up multiple websites on this server?

What I can think of is creating multiple website and publish them through different ports. So I can access website 1 from x.x.x.x:8081 and website 2 from x.x.x.x:8082 etc. Then register different domains and point to x.x.x.x:8081 and x.x.x.x:8082 separately. Is that the correct way? This is the first time I'm doing this kind of work and I lack of confidence. Can anyone point me the right direction?

Also can anyone describe how to configure the domain(s) in my situation? Thanks.

share|improve this question
What server software are you using? Apache? Lighttpd? – Jorge Fuentes González May 27 '13 at 13:39
this is exactly the reason why the host header was made mandatory in http 1.1 – ratchet freak May 27 '13 at 15:17

As suggested, virtual hosts will allow this. I just want to add that since you are going to register different domains, you do NOT need to use a separate port for each. Each domain can use e.g. port 80. Apache will figure out which virtual host to use by the name.

share|improve this answer

What you need to set up are virtual hosts. I'm going to take a wild guess and assume you are running apache. There are instructions on the apache website which will point you in the right direction. Every webserver I can think of supports virtual hosts of some kind, so if you don't run apache, you'll have to google instructions for your webserver accordingly.

share|improve this answer

It depends on the web server software, but I think today most servers (certainly Apache) offers multiple sites through the same IP (the web browsers, connecting the server request the name of the site too).

The name to look for (google for) is "virtual host", e.g. here is a link showing an example with the Apache server.

share|improve this answer

As suggested before , Apache can do this , check this :

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .