Is it possible?, someone told me it is but Im not sure.

Thx.

(If its possible, how should I do it?, I mean, I got one /www folder where my website lies... how can I configure 2 different sites?)

Comments

Not really a programming question, belongs on webmasters site. But, in short, yes, you can, unless your VPS contract forbids it.

Written by Marc B

Yes, is some kind of greay area,

Written by Artemix

Accepted Answer

The procedure is:

  1. Point both domains to the ip of the VPS.

  2. Configure the webserver you have installed on your VPS to answer to those two domains.

In the case of Nginx with Passenger, it is a matter of adding entries to you nginx.conf file. Like this:

server {
      listen 80;
      server_name domain1;
      root /path/to/your/project;
      passenger_enabled on;
   } 
server {
      listen 80;
      server_name domain2;
      root /path/to/your/project;
      passenger_enabled on;
   }

Check your webserver documentation to do a similar thing.

Written by Nerian
This page was build to provide you fast access to the question and the direct accepted answer.
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki