VPS

Install and Configure GHOST(blogging platform)

Steps to Install GHOST 

First, we need to install Ghost. We’ll place Ghost in the /var/www/ ghost directory, which is the recommended installation location.

Download the latest version of Ghost from Ghost’s GitHub repository using wget:

wget https://ghost.org/zip/ghost-latest.zip

 

Install the unzip program with the package manager. Make sure that the system is up-to-date before installing a new program, so update the packages and install unzip with the following commands:

yum update -y
yum install unzip -y

 

The -y flag in the preceding commands updates and installs packages automatically.

Once unzip is installed, unzip the downloaded package to the /var/www/ghost directory. First, create the /var/www folder, then unzip the file:

mkdir /var/www
unzip -d /var/www/ghost ghost-latest.zip

 

Switch to the /var/www/ghost/ directory:

cd /var/www/ghost/

 

Then install the Ghost dependencies, but only the ones needed for production.

npm install --production

 

Ghost is installed once this process completes, but we need to set up Ghost before we can start it.

 

Configure GHOST

Ghost uses a configuration file located at /var/www/ghost/config.js. This file doesn’t exist out of the box, but the Ghost installation includes the file config.example.js, which we’ll use as a starting point.

Copy the example configuration file to /var/www/ghost/config.js. We’ll copy the file instead of moving it so that we have a copy of the original configuration file in case we need to revert your changes.

cp config.example.js config.js

 

Open the file for editing:

vi config.js

 

We have to change the URL that Ghost uses. If we don’t, the links on the blog will take visitors to my-ghost-blog.com. Change the value of the url field to your domain name, or to your server’s IP address if you don’t want to use a domain right now.

                  /var/www/ghost/config.js



...

config = {
// ### Production
// When running Ghost in the wild, use the production environment
// Configure your URL and mail settings here
production: {
url: 'http://your_domain_or_ip_address',
mail: {},
...

 

The url value must be in the form of a URL, like http://example.com or http://11.11.11.11. If this value is not formatted correctly, Ghost will not start.

Ghost can function without the mail settings; they’re only necessary if you need to support password recovery for Ghost users.

You can customize Ghost further by following the configuration details at the official site.

Save the file and exit the editor.

While still in the /var/www/ghost directory, start Ghost with the following command:

npm start --production

 

Output

> ghost@0.11.7 start /var/www/ghost
> node index

WARNING: Ghost is attempting to use a direct method to send email.
It is recommended that you explicitly configure an email service.
Help and documentation can be found at http://support.ghost.org/mail.

Migrations: Creating tables...
...

Ghost is running in production...
Your blog is now available on http://your_domain_or_ip_address
Ctrl+C to shut down

 

Ghost is listening on port 2368, and it’s not listening on the public network interface, so you won’t be able to access it directly.

Leave a Reply

Your email address will not be published. Required fields are marked *