仅使用一个VPS托管两个域? [英] Hosting two domains using only one VPS?
本文介绍了仅使用一个VPS托管两个域?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可以吗?有人告诉我,但是我不确定。
Is it possible? Someone told me it is but I'm not sure.
如果可能的话,该怎么办?我的网站有一个/ www文件夹。如何配置2个不同的网站?
If its possible, how should I do it? I have one /www folder where my website lies. How can I configure 2 different sites?
推荐答案
程序是:
将两个域指向VPS的IP。
Point both domains to the ip of the VPS.
将您在VPS上安装的Web服务器配置为对这两个领域的回答。
Configure the webserver you have installed on your VPS to answer to those two domains.
在Nginx与Passenger的情况下,这是一个向你添加条目的问题nginx.conf文件。像这样:
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.
这篇关于仅使用一个VPS托管两个域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文