【问题标题】:Apache2 : How to configure different/multiple websites in Dedicated IPApache2:如何在专用 IP 中配置不同/多个网站
【发布时间】:2016-08-22 19:30:29
【问题描述】:

我有 5 个网站将托管在一个专用服务器上。

### Many documents(apache2) provide help to achieve this 
site1.com > should access /var/www/html/site1
site2.com > should access /var/www/html/site2

但我想要的是下面的场景......我如何在 Apache2 中实现这个(下面)?

### So for example (eg. IP:  54.33.123.21) :
54.33.123.21/site1 > should access /var/www/html/site1
54.33.123.21/site2 > should access /var/www/html/site2

我只需要使用 IP。暂时没有任何域名。

提前致谢。

【问题讨论】:

    标签: apache hosting apache-config dedicated-server multiple-sites


    【解决方案1】:

    将 Apache 服务器 DocumentRoot 设置为 /var/www/html 并且...就是这样。

    【讨论】:

    • 您必须重新启动 apache 服务器才能刷新配置。另外,你得到什么样的错误?
    • 我已经尽力了。它是一个专用IP。所以 54.33.123.21/site1 应该访问 DocumentRoot /var/www/html/site1...
    • 如果您需要将这些站点作为不同的虚拟主机运行,您必须以某种方式将它们彼此区分开来 - 一种对您开放的方法是配置具有不同端口的虚拟主机。跨度>
    猜你喜欢
    • 1970-01-01
    • 2012-09-30
    • 1970-01-01
    • 2016-12-01
    • 1970-01-01
    • 2011-03-31
    • 2013-02-14
    • 1970-01-01
    • 2013-12-02
    相关资源
    最近更新 更多