Ghost is Node JS application built on Wordpress concept but more light weight. I have a Windows 2008 server running IIS service and I want to run Ghost on my Windows server.
Basically, the instruction for installing Ghost can be found on its GitHub page. At the present time, Node JS page provides Node 4 as stable version and Node 6 as preview version. I have tried the installation with Node 6 but it failed for it needs to compile
sqlite3 on Windows but my server does not have VC compiler installed.
With Node 4, the installation was smooth (it used pre-compiled binary of
sqlite3). Version of Ghost I was using was 0.8.0. Following the Ghost installation guide and it should just work.
Setting IIS as a Reverse Proxy
Setting IIS Site for blog
Ghost runs its own web server with NodeJS and I do not want to publish Ghost port directly. Since I have IIS installed, I can transform IIS into a Reverse Proxy with ARR1 add-on. I also want to publish my Ghost blog on domain
blog.ruxoz.net. What I have to do first is to create a new site for this blog under
Sites folder in IIS Manager.
Physical path in the setting can be anything since we are going to forward request to Ghost server, this value will be ignored (but alas, you have to input something, otherwise you cannot click
OK button :s )
The name of Site name does not matter as well. Just anything that is not existed in IIS yet. What matter is Host name, which IIS uses for routing requests when
blog.ruxoz.net is being accessed.
Forward request to Ghost
Click on the newly created site. Under IIS section, you should see
URL Rewrite. This is for forwarding request of this site to other server. Double-click on
URL Rewrite and add a new rule.
A rule dialog should be poped up. The rule we need is
Reverse Proxy, double-click on it to set up one. This step will invoke ARR installation if your IIS has never installed ARR before. Just following its ARR installation instruction, and resume adding this Reverse Proxy rule.
Enter Ghost server IP and port into the dialog. Default setting of Ghost server publishes on port 2368. So simply input 127.0.0.1:2368 into Inbound Rules and click
Change Ghost Server Port
In Ghost directory, there is a config file named
config.js 2. Default server setting is under
server node, as shown in the picture below.
Set Ghost Server URL
Another important setting is
url key, which normally is set to
http://my-ghost-blog.com as shown on the above picture. This value must be set to URL that will be accessed from outside, in this case I set to
This is also a mandatory but Ghost can work fine without this setting. Full email setting instruction can be found in http://support.ghost.org/mail. For me, I use my Gmail SMTP server, so I simply followed the Gmail setting instruction in the page.
To use Gmail SMTP, you have to generate Google's "App Password" in Google's Account manager. Then, use App Password in the email setting.
Allow Image Upload
The setting to allow image uploading is
fileStorage. Strangely, its description in Ghost configuration page2 states like it is enabled by default, but I find that it does not work if not specified. So I just add this flag into the config file to enable image upload.
Ghost uses SQLite database by default. Refer to Ghost configuration page2 for changing database. For me, I create a database and a credential in MySql, then just replace it in
Auto Start Ghost Server
I use Windows Task Scheduler to turn on Ghost server when Windows is started. Open Task Scheduler and, under Action menu, add a Basic Task.
Here, a few information you need to enter.
- Name: Name of Task, can be anything.
- Trigger: Use When the computer starts
- Action: Use Start a program
- Program/Script: Find
- Add arguments: Use
- Start in: Enter directory name of our Ghost Server.
- Program/Script: Find
- Finish: Tick Open the Properties dialog for this task when I click Finish
A few more settings are needed to be done in Task Properties dialog.
- General tab, under Security options: Use Run whether user is logged on or not. Also tick Do not store password.
- Settings tab: Untick Stop the task if it runs longer than
You can try to manually start the task by right-clicking at the task name and select
Once the site is started, you should setup a blog by goto path
/ghost/, such as
Following the provided instruction (i.e. Enter email/password, blog title, etc.) then your blog are ready!
Add Prism (Optional)
Code Injection in Ghost settings page. Push following code in Blog Header.
<link href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.5.1/themes/prism.css" rel="stylesheet" />
Depend on what kind of code you want to highlight, you can load one or more
prism*.min.js. Just put it in Blog Post like following example.
Application Request Routing -- more detail on (http://www.iis.net/downloads/microsoft/application-request-routing) ?