Linode Xen Virtual VPS Installation Configuration Ghost method

Source: Internet
Author: User
Tags zip vps net domain

My VPS Situation:

Operating system –centos 7 64-bit
Web Server Software –apache
Ghost1 is based on Node.js, which itself has a Web server and does not need Apache.

Install Ghost

Main reference Ghost official Help 2.
Download Ghost
$ curl-l Https://ghost.org/zip/ghost-latest.zip-o ghost.zip
Decompression Ghost
$ unzip-uo ghost.zip-d Ghost
Install Ghost
$ CD Ghost
$ NPM Install--production
Start Ghost
$ npm Start--production
Now, you can access the Ghost blog via the 127.0.0.1:2368 path on the VPS.

Configure Apache with Ghost

Of course, your goal is not to visit Ghost on the VPS, but to access Ghost through the domain name.
Ghost Directory has a config.example.js file, used to configure information 3, such as domain names, ports and so on.
Before you do the following, make sure you bind the domain name to the IP address of the VPS on the DNS server.
Copy a Config.js
$ CD Ghost
$ CP config.example.js Config.js

Modify Config.js

Change the URL in the production section of Config.js: ' http://my-ghost-blog.com ' to URL: ' Http://111cn.net ', which is the domain name I want to use.

Restart Ghost

Press Ctrl-c to turn off Ghost, and then perform NPM start--production to start it.
At this point you can see the following message:
Migrations:up to date at version 003
Ghost is running ...
Your Blog is now available on http://111cn.net
CTRL + C to shut down
But this information does not mean that we have access to Ghost. Because the 111cn.net domain name accesses port 80, the port is listening on Apache instead of node.js– it is listening on the 2368 port.
So we also need to configure Apache.

Open the/etc/httpd/conf.d/vhost.conf file (CentOS system) and add the following:

<virtualhost *:80>
ServerName www.111cn.net
Serveralias 111cn.net
Proxypreservehost on
proxypass/http://localhost:2368/
proxypassreverse/http://localhost:2368/
</VirtualHost>

Restart Apache:

$ sudo service httpd Restart
in this way, Apache acts as a proxy, forwarding the traffic it hears to the node.js listening port, and when we visit http://111cn.net, we can open the Ghost blog

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.