[英]How to install Ghost inside an existing node.js application on Azure?
您可以安装Ghost( http://ghost.org ),使其在现有的node.js Express应用程序(例如:{my domain} / blog)中运行吗?
我正在使用Azure网站托管网站。
请注意:我希望可以在任何平台上运行的通用解决方案...但是我想我要提到的是,它在Azure上提供了一种简单的方法来实现。
是的,你可以这么做。
您将需要:
基本上转到门户->配置选项卡->一直滚动到底部并添加类似的内容
将Ghost发布到您在上述步骤中映射到应用程序的任何文件夹。 您可以使用FTP, webdeploy或SCM( https://<YouSiteName>.scm.azurewebsites.net/DebugConsole
,这是我选择的,我的文件夹布局如下所示
igonre deployments
文件夹,与此无关
在Ghost的config.js
中的“ Production
环境”节点下,确保您的网址为
production: {
url: 'http://<YourSiteName>.azurewebsites.net/blog',
mail: {
......
}
}
web.config
转到您的主要站点web.config并将整个<system.webServer>
元素包装在<location path="." inheritInChildApplications="false">
<location path="." inheritInChildApplications="false">
基本上您的web.config
应该看起来像这样
<configuration>
<system.webServer>
<handlers>
<add name="iisnode" path="server.js" verb="*" modules="iisnode"/>
</handlers>
<rewrite>
<rules>
<!-- Some rewrite rules -->
</rules>
</rewrite>
....
</system.webServer>
</configuration>
现在看起来像这样
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="iisnode" path="server.js" verb="*" modules="iisnode"/>
</handlers>
<rewrite>
<rules>
<!-- Some rewrite rules -->
</rules>
</rewrite>
....
</system.webServer>
</location>
</configuration>
请注意,这是针对您所使用的Express.js而不是Ghost网站的主要网站
那应该就是你要做的。
不知道是否可以将其安装为现有网站的补充,但是Ghost作为Azure站点画廊中Blogs下的可部署模板存在:
这不是您要找的完整答案,但是这些有关如何在Azure网站上手动安装Ghost的说明可能会帮助您正确方向: http : //www.hanselman.com/blog/HowToInstallTheNodejsGhostBloggingSoftwareOnAzureWebsites.aspx
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.