Hosting two domains using only one VPS?

后端 未结 3 1535
离开以前
离开以前 2020-12-04 05:43

Is it possible? Someone told me it is but I\'m not sure.

If its possible, how should I do it? I have one /www folder where my website lies. How can I configure 2 dif

3条回答
  •  隐瞒了意图╮
    2020-12-04 06:28

    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.

提交回复
热议问题