[英]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.