1

Can you install Ghost (http://ghost.org) so that it runs inside an existing node.js express application (like this: {my domain}/blog)?

I'm using Azure Websites to host the site.

Please note: I would prefer a generic solution that can run on any platform... however I thought I would mention that it's on Azure in case it provides a simple way to do this.

4

3 回答 3

2

是的,你可以这么做。

您将需要:

1.添加一个新的博客应用程序

基本上去门户-> 配置选项卡-> 一直滚动到底部并添加类似这样的内容

添加应用程序

2.配置Ghost在子文件夹上运行

将 Ghost 发布到您在上述步骤中映射到应用程序的任何文件夹。您可以使用 FTP、webdeploy或 SCM(https://<YouSiteName>.scm.azurewebsites.net/DebugConsole 这是我选择的,我的文件夹布局如下所示

安慰

igonredeployments文件夹,与此无关

在你的config.jsfor Ghost 中,在Production环境节点下确保你的 url 为

production: {
        url: 'http://<YourSiteName>.azurewebsites.net/blog',
        mail: {
          ......
         }
 }

3.修复主站点的web.config

转到您的主要站点 web.config 并将整个<system.webServer>元素包装在一个<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 站点

这应该是你需要做的。

于 2014-05-30T02:49:14.963 回答
0

这不是您正在寻找的完整答案,但这些关于如何在 Azure 网站上手动安装 Ghost 的说明可能会帮助您朝着正确的方向前进: http ://www.hanselman.com/blog/HowToInstallTheNodejsGhostBloggingSoftwareOnAzureWebsites.aspx

于 2014-05-29T18:12:07.170 回答
0

不确定是否可以将其作为现有站点的补充安装,但 Ghost 作为 Azure 网站库中的可部署模板存在,位于Blogs下:

在此处输入图像描述

于 2014-05-29T17:41:30.690 回答