Glam Prestige Journal

Bright entertainment trends with youth appeal.

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.

2

6 Answers

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.

0

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.

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.

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

You can have as many domains as you like with 1 IP address if you create separate directories for each domain, and then set up virtual host on the server for each directory. You then need to log in to your DNS provider and set up URL redirect for each domain.

1

You can also set up server blocks (essentially virtual hosts) if you are using nginx as your web server. There are step by step instructions for setting it up on an Ubuntu 16.04 DigitalOcean droplet located here, and the nginx documentation can be found here.