如何在 IIS 下设置 TeamCity?

发布于 2024-07-19 07:52:53 字数 1431 浏览 3 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

两人的回忆 2024-07-26 07:52:53

使用 IIS 7.5,您可以使用应用程序请求路由将 teamcity.server.domain.com:80 的请求路由到 server.domain.com:81 的 Tomcat。 我认为这种方法更优越,因为 Tomcat 连接器在 WS2008 x64 下似乎有点不稳定。

Jon Alb 有一篇关于如何在 WS2008 上配置 TeamCity 和 IIS 的精彩文章:

此外,您需要确保您的 DNS 可以解析 teamcity.server.domain.com< /code> 到 server.domain.com。 我的 IIS 服务器需要 ipconfig /registerdns 来正确更新其 DNS 条目。 在这种情况下,正确意味着要在domain.com 查找区域中为服务器 创建一个 条目,简单的A 记录是不够的。 在该域中,您需要为 * 创建 CNAME 记录,因此任何子域都将被重定向到 server.domain.com

我遇到的一个大问题是 IIS 7.5 似乎不再正确编写applicationHost.config 文件,因此端口号最终不会被保留。 这将导致令人讨厌的 400.0 Bad Request 错误,因为将达到 MAX_FORWARDS 限制(请求植根于圆圈)。

要解决此问题,请将以下内容添加到 C:\Windows\System32\inetsrv\config

<webFarms>
  <webFarm name="teamcity" enabled="true" adminUserName="" adminPassword="[enc:AesProvider:2blZ7roifGTktpn8zBBuVQ==:enc]" primaryServer="">
    <server address="localhost" enabled="true">
      <applicationRequestRouting httpPort="YOURPORTHERE!!!" />
    </server>
    <applicationRequestRouting>
      <loadBalancing algorithm="WeightedRoundRobin" />
      <protocol reverseRewriteHostInResponseHeaders="true" />
    </applicationRequestRouting>
  </webFarm>
</webFarms>

编辑 如果您正在运行其他网站,并且除了遵循第 2 部分之外,还收到 404您需要创建一个虚拟站点来捕获主机名,如下面的 Ian Patrick Hughes 回答所述。

With IIS 7.5 you can use Application Request Routing to route requests at teamcity.server.domain.com:80 to Tomcat at server.domain.com:81. I would consider this approach superior since the Tomcat Connector seems a bit flaky under WS2008 x64.

Jon Alb has a good writeup on how to configure TeamCity plus IIS on WS2008:

Additionally, you need to ensure that your DNS can resolve teamcity.server.domain.com to server.domain.com. My IIS server needed a ipconfig /registerdns to update its DNS entry correctly. Correctly means in this case to create a Domain entry in the domain.com lookup zone for server, a simple A-Record does not suffice. In that domain, you need to create a CNAME record for * , so any subdomain will be redirected to server.domain.com

A big problem I ran into is that IIS 7.5 seems to no longer correctly write the applicationHost.config file, so the port number won't endup being persisted. This will result in a nasty 400.0 Bad Request error because the MAX_FORWARDS limit will be reached (the request is rooted in circles).

To fix this, add the following to C:\Windows\System32\inetsrv\config:

<webFarms>
  <webFarm name="teamcity" enabled="true" adminUserName="" adminPassword="[enc:AesProvider:2blZ7roifGTktpn8zBBuVQ==:enc]" primaryServer="">
    <server address="localhost" enabled="true">
      <applicationRequestRouting httpPort="YOURPORTHERE!!!" />
    </server>
    <applicationRequestRouting>
      <loadBalancing algorithm="WeightedRoundRobin" />
      <protocol reverseRewriteHostInResponseHeaders="true" />
    </applicationRequestRouting>
  </webFarm>
</webFarms>

Edit If you are running other sites, and getting a 404, besides following Part 2 you need to create a dummy site to catch the hostname as the below Ian Patrick Hughes answer states.

太傻旳人生 2024-07-26 07:52:53

添加到 Johannes Rudolph 的答案中...Jon Alb 的文章是对在 IIS 7.5 中公开 Team City 进行简单细分的最佳选择。 唯一要提到的是,如果您在该服务器实例上运行其他站点,则在执行他的 第二部分,您可能需要创建一个虚拟站点来查找子域主机标头值,因为如果没有匹配的站点,IIS 似乎从未执行我的场重写 url。 但是,如果您想保护端口 80 上的 Team City 登录页面,这也应该允许您使用 HTTP 身份验证。

To add to Johannes Rudolph's answer...The Jon Alb article is the best for a simple breakdown on exposing Team City in IIS 7.5. The only thing to mention is that if you are running other sites on that server instance, after you follow through his second part, you might need to create a dummy site looking for a subdomain host header value because it seemed like IIS never executed my farm re-write url if there was no site that matched. However, this should also allow you employ HTTP Authentication if you want to protect your Team City login page on port 80.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文