是否可以在同一个 Azure 实例上运行 PHP 和 WCF?

发布于 2024-09-26 11:54:16 字数 225 浏览 1 评论 0原文

我正在研究在 Azure 上托管 CMS(用 php 编写的 wordpress)的可能性。我已经在运行一个公开 WCF 服务的 ASP.NET Web 角色。 WordPress 需要 PHP。我的所有研究表明我应该创建一个新的 CGI Web 角色来处理 PHP 功能。是否可以在单个 Azure 实例下运行 CGI Web 角色和 ASP.NET Web 角色?或者我需要两个实例(一个用于 asp.net;另一个用于 cgi)?

I'm investigating the possibility of hosting a CMS (wordpress written in php) on Azure. I'm already running an ASP.NET Web Role which exposes WCF services. WordPress requires PHP. All my research suggests that I should create a new CGI Web Role to handle the PHP functionality. Is it possible to run the CGI Web Role and the ASP.NET Web Role under a single Azure instance? Or will I need two instances (one for asp.net; other for cgi)?

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

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

发布评论

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

评论(3

安稳善良 2024-10-03 11:54:16

实际上,“CGI Web 角色”只是一个已填充一些 FastCGI 设置的 Web 角色。您仍然可以将 ASP.NET(或 WCF 服务)与 PHP 一起放置在那里。请参阅 http://blog.smarx.com/posts/php- asp-net-in-windows-azure 为例(但演示应用程序不再启动)。

Actually, the "CGI Web Role" is just a web role with some FastCGI settings already populated. You can still put ASP.NET (or WCF services) there alongside the PHP. See http://blog.smarx.com/posts/php-asp-net-in-windows-azure for an example (but the demo app is no longer up).

好久不见√ 2024-10-03 11:54:16

您应该查看最新的 Windows Azure Companion,它可以让您执行此操作。这将以辅助角色安装一个管理网站,然后让您通过菜单安装基于 PHP 的工具(例如 WordPress)以及 PHP itelf。

如果您查看 Azure Companion 的源代码,您将看到托管 Web 核心是如何启动的。如果您需要自定义超出伴侣允许您做的事情,您就可以在那里获得所需的所有代码。

在辅助角色中,您可以托管多个 TCP 端口,因此让后台辅助角色在与 WordPress 站点相同的角色实例中运行是非常合理的。

稍微无关:在 Web 角色中,您仍然可以拥有后台进程,但您将无法打开任意端口。例如,您可以很好地创建队列侦听器。只需在 Run() 方法中启动代码(您需要添加此代码,因为默认情况下它不会通过 Web 角色添加,仅在辅助角色模板中添加)。

You should look at the latest Windows Azure Companion that will let you do this. This will install an administrative website in a worker role and let you then install PHP-based tools such as WordPress, along with PHP itelf, via menu.

If you look at the source code of the Azure Companion, you'll see how the hosted web core is being launched. If you need to customize things beyond what the companion lets you do, you have all the code you need right there.

In a worker role, you can host multiple TCP ports, so it's very reasonable to have background workers running in the same role instance as your WordPress site.

Slightly unrelated: In a Web Role, you can still have background processes, but you'll just be unable to open arbitrary ports. You'll be fine creating, say, queue listeners. Just fire up your code in the Run() method (you'll need to add this, as it doesn't get added by default with a Web Role, only in the Worker Role template).

水水月牙 2024-10-03 11:54:16

Worker 角色的灵活性使您能够运行几乎任何内容,包括 IIS 本身:) 您可以使用角色来托管您自己的 IIS Hostable Web Core 实例,该实例可以利用 IIS 的更多功能(如多个应用程序)并且可能使您能够通过单个实例执行您想要的操作。我自己没有太多这样做的经验,只是知道这是可能的。

我见过的最好的例子是 Steve Marx 的博客
http:// /blog.smarx.com/posts/build-your-own-web-role-running-hosted-web-core-in-windows-azure

除此之外,搜索“Azure 上的可托管 Web 核心”并你会发现一些好的资源。

The flexibility of the Worker role enables you to run almost anything, including IIS itself :) You can use a role to host your own instance of IIS Hostable Web Core, which can leverage a few more of the features of IIS (like multiple applications) and likely enable you to do what you are wanting with a single instance. I don't have a ton of experience doing this myself, just know its possible.

The best example I've seen is at Steve Marx's blog
http://blog.smarx.com/posts/build-your-own-web-role-running-hosted-web-core-in-windows-azure

Beyond that, search around for "hostable web core on Azure" and you'll find some good resources.

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