【问题标题】:host many domain to the same server [closed]将多个域托管到同一台服务器[关闭]
【发布时间】:2013-05-08 17:33:37
【问题描述】:

我有这个域名:

站点 1:/var/www/porttail1

有了这个配置:

/etc/httpd/conf.d

我要做的是将此域添加到同一台服务器:

站点 2:/var/www/porttail2

但我的问题是站点 1 默认调用 conf.d,我需要第二个 conf.d 对于站点 2,那么我如何告诉站点 2 从(例如 /etc/httpd/conf2.d)搜索他的 conf?

【问题讨论】:

  • 您不需要创建额外的 conf.d。只需在您的 apache 配置中添加一个额外的 VirtualHost 指令。
  • 我知道,但我必须获得两个完全独立的域(我不是经理:p)所以我需要创建一个新的 /etc/httpd,但我必须将它添加到 httpd 服务在 /etc/init.d/httpd... 我不知道你是否明白我所说的???
  • 我想我明白了。我写了一个答案.. :)

标签: linux apache hosting virtualhost


【解决方案1】:

您可以在单个服务器中创建多个虚拟主机。以Virtual host examples 为例。

【讨论】:

    【解决方案2】:

    默认情况下,您的主要 apache 配置中应该有 Include 指令:httpd.conf 或 apache2.conf。

    在我的 ubuntu apache2.conf 中,是这样的:

    # Include generic snippets of statements
    Include conf.d/
    
    # Include the virtual host configurations:
    Include sites-enabled/
    

    因此,如果您在 conf.d/ 或 sites-enabled/ 中添加另一个 conf 文件,那么它将在启动期间被 apache 自动包含和读取。

    【讨论】:

      猜你喜欢
      • 2017-02-16
      • 1970-01-01
      • 2016-09-11
      • 1970-01-01
      • 2016-07-13
      • 2015-12-16
      • 2015-08-23
      • 2010-10-12
      • 2016-02-20
      相关资源
      最近更新 更多