/ nodejs

How to setup a Ghost blog with Ajenti

Even though I am a CLI person but I use ajenti for personal website management because it simplifies a lot of things that makes maintainance easier even if your web applications are runnig on different platforms.

If you are not familiar with Ajenti or Ghost:

Ajenti : Ajenti is an Open-source web controll panel for BSD and Linux servers written in Python. It's very extensible via Pyhton and definetely best looking control panel out there. Ajenti V is an addon that enables web hosting capabilites for ajenti. Current language supports are Python, Node.js, Ruby & PHP.

Ghost : Ghost is just a platform for blogging written in JavaScript. You get up and running with ghost with thier hosted platform and it's also easy to get up and running on self hosting in many different ways. But with ajenti it's really quite simple & easy to maintain.

Lets proceed Now..


Installing Node.js on Ubuntu:

curl -sL https://deb.nodesource.com/setup | sudo bash -
sudo apt-get install nodejs

Setting up Ghost:

cd /srv/
sudo wget https://ghost.org/zip/ghost-latest.zip
sudo unzip -d myblog ghost-latest.zip
cd myblog/
sudo npm install --production
sudo cp config.example.js config.js

Ghost config:

sudo vi config.js

Change url on the Production section :


   url: 'http://yourblog.com',

Change permission of myblog directory:

sudo chown -R www-data:www-data *

Installing Ajenti on Ubuntu:

wget -O- https://raw.github.com/Eugeny/ajenti/master/scripts/install-ubuntu.sh | sudo sh

For more on installation please refer to Ajenti Installation KB

Installing Ajneti V & Nginx on Ubuntu:

sudo apt-get remove apache2
sudo apt-get install nginx ajenti-v ajenti-v-nginx ajenti-v-nodejs
sudo service ajenti restart

Setting up Ajenti for Ghost:

  • Goto https://yourserverip:8000
    • Log in to Ajenti Panel.
      • Go to Websites Section
      • Create a New
        • Manage
          • General section
            • Disable maintainance mode
            • Change website files location
          • Domain section
          • Content section
            • create a Node.js config
            • Script name index
            • Port 2368
            • Environment NODE_ENV=production
            • Process user www-data
          • Apply Changes

Now visit http://yourblog.com and your ghost blog is now live!

Notes :

  • Change port number in config.js and in Content setion if you want to run multiple Ghost blog.
  • If you can't reach ajenti login page then make sure ajenti is running and port 8000 is open in your firewall.
  • Default credentials for Ajenti, username : root & password: admin
  • Please, Do not forget to change your default password for Ajenti!