如何在Windows上安装Ghost

Ghost is a new, free and open source blogging platform with a very simple and easy to use interface. Ghost focuses on one thing: Publishing. If you haven’t read Joe Hewitson’s recent article, you should.

Ghost是一个新的,免费的开源博客平台,具有非常简单易用的界面。 Ghost专注于一件事:发布。 如果您尚未阅读Joe Hewitson的最新文章 ,则应该阅读。

PHP is the world’s most popular and widely supported programming language. Some of the most popular CMS like WordPress, Joomla, Drupal – and even Facebook – use PHP as their core language, but Ghost has been built with Node.Js, not with PHP.

PHP是世界上最受欢迎和广泛支持的编程语言。 一些最受欢迎的CMS,例如WordPress,Joomla,Drupal甚至Facebook,都使用PHP作为其核心语言,但是Ghost是使用Node.Js构建的 ,而不是PHP。

Ghost claims to be a simple blogging platform, but unfortunately the first step to get started with Ghost is not simple. Installation process of Ghost is not simple and easy. It is complicated and might be confusing for some users. Installation on a live server and a local PC is not simple.

Ghost声称是一个简单的博客平台,但是不幸的是,开始使用Ghost的第一步并不简单。 Ghost的安装过程并不简单。 它很复杂,可能使某些用户感到困惑。 在实时服务器和本地PC上进行安装并不简单。

Node.js is a software platform that is used to build server-side applications. Node.js utilizes JavaScript as its scripting language. Ghost is Node.Js based, so it means many of you won’t be able to install it on shared web hosting, a very popular hosting plan for beginners. You need a cloud (Amazon EC2, DigitalOcean, Windows Azure etc) that supports Node.Js but not everyone uses the cloud.

Node.js是用于构建服务器端应用程序的软件平台。 Node.js利用JavaScript作为其脚本语言。 Ghost是基于Node.Js的,因此这意味着你们中的许多人将无法将其安装在共享网络托管上,这是一个非常适合初学者的托管计划。 您需要支持Node.Js的云(Amazon EC2,DigitalOcean,Windows Azure等),但并非所有人都使用该云。

If you install Ghost on a local PC, you will have to install additional programs like Node.Js and fire up the command line. No doubt, using the command line can be confusing if you’re not used to it.

如果在本地PC上安装Ghost,则必须安装Node.Js等其他程序并启动命令行。 毫无疑问,如果您不习惯使用命令行,可能会造成混淆。

当前可用的安装程序 (Currently available installers)

There are a couple of installers available at the moment for local and live web server installation.

目前,有两个安装程序可用于本地和实时Web服务器安装。

在实时服务器上安装 (Installation on Live Servers)

Here are some options to deploy to the cloud.

以下是一些部署到云的选项。

在Windows,Mac或Linux上本地安装 (Local installation on Windows, Mac or Linux)

Bitnami ghost installer is the easiest way to install Ghost on Windows, Mac or Linux. You can download it from http://bitnami.com/stack/ghost/installer.

Bitnami Ghost安装程序是在Windows,Mac或Linux上安装Ghost的最简单方法。 您可以从http://bitnami.com/stack/ghost/installer下载

If Bitnami Ghost installer does not work for you and you see any errors then you can install Ghost manually. In this tutorial I am going to share my experience of installing Ghost on a Windows PC.

如果Bitnami Ghost安装程序对您不起作用,并且您看到任何错误,则可以手动安装Ghost。 在本教程中,我将分享我在Windows PC上安装Ghost的经验。

I downloaded Bitnami Ghost installer for Windows, it worked fine on Windows 7 (the most widely used Operating System with 46.42% market share) but it gave me a PHP 5.5 error on Windows XP (the second most popular Operating System with 31.24% market share).

我下载了适用于Windows的Bitnami Ghost安装程序,在Windows 7(市场上使用最广泛的操作系统,市场份额为46.42%)上运行良好,但是在Windows XP(市场上第二受欢迎的操作系统,市场份额为31.24%)上却给了我PHP 5.5错误。 )。

I decided to install Ghost manually on Windows XP. Here is a screenshot of the error message in Windows XP.

我决定在Windows XP上手动安装Ghost。 这是Windows XP中错误消息的屏幕截图。

Bitnami ghost error in XP

如何手动安装Ghost? (How to install Ghost manually?)

For manual installation you need to install Node.Js and the Ghost source files.

对于手动安装,您需要安装Node.Js和Ghost源文件。

Step 1 : Download and install Node.Js

步骤1:下载并安装Node.Js

Go to nodejs.org, download the Node installer and install it.

转到nodejs.org ,下载并安装Node安装程序。

Step 2 : Download and Extract Ghost files

步骤2:下载并提取Ghost文件



Visit Ghost.org, sign up for an account or log in if you already have an account and download the Ghost zipped archive. Next we need to extract the Ghost files. Go to the root of your C drive, create a new folder, name it ghost-#.#.# ( replace # with the version of ghost) and extract all the files from the zipped archive to this new folder.

访问Ghost.org ,注册一个帐户或登录(如果您已经拥有一个帐户)并下载Ghost压缩存档。 接下来,我们需要提取Ghost文件。 转到C驱动器的根目录,创建一个新文件夹,将其命名为ghost-#。#。#(将#替换为ghost的版本),然后将所有压缩文件中的文件提取到该新文件夹中。

启动Node.js命令提示符 ( Start Node.js Command Prompt)

In your Start Menu go to All Programs, find ‘Node.js’ and then choose ‘Node.js Command Prompt’. Now we need to change the directory to c:\ghost-0.3.3, where we extracted Ghost.

在“开始”菜单中,转到“所有程序”,找到“ Node.js”,然后选择“ Node.js命令提示符”。 现在我们需要将目录更改为c:\ghost-0.3.3 ,在其中提取了Ghost。

  • Type cd c:\ghost-#.#.# (replace # with Ghost version number) and press Enter

    键入cd c:\ghost-#.#.# (用Ghost版本号替换#),然后按Enter键

  • Next type npm install --production and press the Enter key

    接下来键入npm install --production并按Enter键

Here is a screenshot of the Node command prompt.

这是Node命令提示符的屏幕截图。

Node command prompt

Now you need to wait for a minute or two. When npm has finished installing, type npm start to start Ghost.

现在您需要等待一两分钟。 npm完成安装后,键入npm start启动Ghost。

start Ghost

Open your browser (Firefox, Chrome, Safari) and navigate to 127.0.0.1:2368 to see your newly setup Ghost blog home page.

打开浏览器(Firefox,Chrome,Safari),然后导航到127.0.0.1:2368以查看新设置的Ghost博客主页。

Welcome to Ghost

Now just change the URL to 127.0.0.1:2368/ghost and create your admin user to log in to the Ghost admin. Enter your full name, email and password (must be 8 characters long) and click sign up, and you will be logged in to your Ghost Dashboard.

现在,只需将URL更改为127.0.0.1:2368/ghost并创建您的管理员用户即可登录到Ghost管理员。 输入您的全名,电子邮件和密码(长度必须为8个字符),然后单击“注册”,您将登录到Ghost仪表板。

步骤3:在config.js文件中更改Ghost URL ( Step 3: Change Ghost URL in config.js file )

When you visit 127.0.0.1:2368/ghost you will see two notifications. The first one is for mail and another one is about Ghost URL. You will have to change the URL in config.js file. You can find config.js in the root directory of Ghost. (C:\ghost-0.3.3)

当您访问127.0.0.1:2368/ghost您会看到两个通知。 第一个用于邮件,另一个用于Ghost URL。 您将不得不在config.js文件中更改URL。 您可以在Ghost的根目录中找到config.js。 (C:\ ghost-0.3.3)

Ghost notifications

Open config.js file in any text editor (SublimeText, Brackets etc) or you can use NotePad in Windows. Find http://my-ghost-blog.com and replace it with http://127.0.0.1:2368/ around line 11 and line 47.

在任何文本编辑器(SublimeText,方括号等)中打开config.js文件,或者您可以在Windows中使用NotePad。 在第11行和第47行附近找到http://my-ghost-blog.com并将其替换为http://127.0.0.1:2368/

步骤4:重新启动Node.js命令提示符 ( Step 4: Restart Node.js Command Prompt)



Now close Node.js Command Prompt and start it again, so changes can take effect. If you don’t restart Node.js Comamand Prompt, you will see following screen.

现在关闭Node.js命令提示符并重新启动,以便更改生效。 如果不重新启动Node.js Comamand Prompt,则会看到以下屏幕。

Ghost error message screen

After restarting Node Command Prompt, change the directory to where you have extracted Ghost and type npm start to start Ghost blog.

重新启动节点命令提示符后,将目录更改为您提取Ghost的目录,然后键入npm start来启动Ghost博客。

Node command prompt

恭喜你! 您已经成功安装了Ghost。 (Congratulations! You have installed Ghost successfully. )

Keep in mind if you close Node.js Command Propmt or restart your PC, your Ghost blog won’t work. You will have to restart it via Node.js Command Prompt.

请记住,如果关闭Node.js命令提示符或重新启动PC,则Ghost博客将无法工作。 您将必须通过Node.js命令提示符重新启动它。

Now you know how to install Ghost, give it a try and share your experience in the comments.

现在您知道了如何安装Ghost ,尝试一下并在评论中分享您的经验。

翻译自: https://www.sitepoint.com/install-ghost-windows/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值