• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Tuesday, June 3, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System CentOS

Creating a Ghost Blog on a CentOS 7 Server

How VPS by How VPS
October 1, 2019
in CentOS
0
0
SHARES
41
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Step 1: Installing dependencies
  2. Step 2: Configuring Ghost
  3. Step 3: Configuring the NGINX proxy
  4. Conclusion
  5. Want to contribute?


In this article, we will be creating a Ghost blog on a CentOS 7 installation. Ghost is a free, open source blogging platform written in Javascript and NodeJS.

Ghost runs excellent on any sized Vultr instance.

If you wish to create a Ghost blog on Ubuntu, please read this article instead.

Step 1: Installing dependencies

Because the software was written in NodeJS, we’ll need to install the epel-release package in order to access the required repository to install NodeJS.

wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm
rpm -ivh epel-release-7-8.noarch.rpm
yum install npm nodejs unzip zip screen -y

Now, let’s create a directory for our Ghost blog.

mkdir -p /var/www/
cd /var/www/
wget https://ghost.org/zip/ghost-latest.zip && unzip ghost-latest.zip
npm install --production

Great job. Now, let’s configure it.

Step 2: Configuring Ghost

First off, we’ll need another user to isolate privileges.
Create one by executing:

useradd blog
chown blog:blog -R /var/www
su blog
cd /var/www/
cp config.example.js config.js

Before we actually start the blogging software, we need to make a few changes.

nano config.js

// # Ghost Configuration

var path = require('path'),
    config;

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

Also, find the line host: 127.0.0.1 and change it to host: 0.0.0.0.

Those will be the first lines of your configuration. Change http://my-ghost-blog.com to your blog’s URL.
Do not change the host, as it is critical that only local users can see it.

Last thing for this step is to install PM2, a NodeJS process manager.
Execute the following commands:

npm install -g pm2
su blog -c echo "export NODE_ENV=production" >> ~/.profile
su blog -c source ~/.profile
su blog -c pm2 kill

Step 3: Configuring the NGINX proxy

This is important if you want users to be able to see your blog.
Run the following commands as the root user once more:

wget http://nginx.org/packages/mainline/centos/7/x86_64/RPMS/nginx-1.11.0-1.el7.ngx.x86_64.rpm -O /tmp/nginx.rpm
rpm -ivh /tmp/nginx.rpm
rm /etc/nginx/conf.d/default.conf

Populate the default.conf file:

echo 'server {
    listen 80;
    server_name _;
    location / {
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   Host      $http_host;
        proxy_pass         http://127.0.0.1:2368;
    }
}' > /etc/nginx/conf.d/default.conf

Finally, start NGINX:

service nginx start

And Ghost:

cd /var/www
pm2 startup centos
su blog    
pm2 start index.js --name ghost
pm2 dump

Conclusion

In this article, you learned how to create your own Ghost blog and proxy it to the public.
Happy blogging!

Want to contribute?

You could earn up to $300 by adding new articles

Submit your article
Suggest an update
Request an article
Previous Post

Creating a Dota 2 Server on CentOS 6

Next Post

How to Install a Tekkit Classic Server on CentOS 6/7

Next Post

How to Install a Tekkit Classic Server on CentOS 6/7

Leave a Reply Cancel reply

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

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet