Install Ghost Blog With Lighttpd and Mariadb

Introduction:

Ghost is a blogging platform which run on nodejs. I have tested this in a Ubuntu-12.04 64bit- 128mb/128mb openvz vps. Ghost requires Node.js 0.10.x (latest stable). Recommended Node.js 0.10.30 & npm 1.4.21.
Objective:

We will install nodejs, npm, lighttpd, mariadb for ghost blog. Lighttpd is for reverse proxy for ghost blog and it is really light enough to run smoothly on small vps boxes. Mariadb for saving posts as it is better than Mysql in some cases and also optimized for good performance. A benchmark of Mysql vs Mariadb. We will also install sendmail for ghost blog to act as a fully functional blog.

Installation Procedure:

1st Step: Nodejs – Npm

Let us install nodejs and npm as ghost blog build to run on this. We need repository to install latest versions.
First install curl and nano to download and edit files and also unzip to extract files.

Then let’s use curl to get repository. This command will add repository and will let us to download/install latest nodejs.

After running above command we can now install nodejs.

Check the versions.

 2nd Step: Lighttpd and Mariadb

Install the repo manager to use “add-apt-repository” command.

Import the GnuPG signing key

Add repository.

Update Source and install:

Now create a database.( It will ask you for root database password.)

 3rd Step: Ghost

Let we will install ghost in a domain “domain.com”, so we will create folder.

Now enter into that folder.

Now we will download the zip file by which we will install ghost. (Latest) in this folder.

Now let’s extract the zip file into a directory.

Above unzip command will extract ghost blog to a folder “ghost”, enter ghost directory.

Now have to run below code as we will run our blog in production mode. This command will get the dependencies.

We have to configure config file by our choice. Let’s replicate the sample config file to config.js-

Now edit that config file by our need.

Find // ### Production. This is the start of Production based configuration. Also find // Developers only need to edit below here and above this line end of Production based configuration. You can just delete all from that and paste below codes which is good enough with sendmail and database.

 

Change that domain with yours and change database section like above with the latest created database and add the server/vps ip in 127.0.0.1 and save it. In database connection do not use localhost, use 127.0.0.1 instead.
Now let’s test the ghost and nodejs server.

the oputput should be something like this

So it is running but we will not be able to browse by that domain yet. We have to use http://domain.com:2368 as ghost or nodejs run by ports and we installed ghost in 2368 port.

 

4th Step: Start Script

Create a blank file as ghost.conf in /etc/init/ folder.

Edit that file by nano and put below code.

Change the location And save that file. Now you can start and stop the service by simply running below command.

 

This will also act as an auto start configuration file when reboot the server.

5th Step: Lighttpd and Virtualhost

Edit /etc/lighttpd/lighttpd.conf and pur below codes in the bottom of that config file. But remember to change the ip and domain name and directory name.

Save the file and run below command-

Then restart lighttpd server. Above command for enabling proxy feature of lighttpd server.

Now you can access your blog by the domain name only.

Final Step:

Make sure you restarted the service accurately.

Now you will be able to register and use your very fast blogging platform. 🙂

Conclusion: We have installed successfully our beloved ghost blog with sendmail function and mariadb+lighttpd. This box is 128mb openvz and it’s running smoothly.

ghost_in_lighttpd

I have also tested the server by Apache Benchmark. It just doesn’t bother. 🙂
You can tweak mysql/mariadb and lighttpd to give it a fast reaction capability. A good optimised lighttpd+mysql will give you a breeze with ghost blog and your small vps. You can find some interesting post in this site about how to tweak mysql for better traffic handling.
Happy Blogging !

19 comments for “Install Ghost Blog With Lighttpd and Mariadb

  1. abangnoob
    November 15, 2015 at 06:39

    hello, my VPS LES 128 SG.

    when i start npm:

    it’s always: KILLED

    how i can fix it?

  2. March 28, 2016 at 19:01

    I’ve received to say that I was very impressed with the mmusicality aand complexity of those accompaniment chord patterns
    aand the facht you could also control different facets of the intelligent chords by
    taking out or muting the actual devices, bass line, orr drum rhythms, or a mixture of two or
    more of these features while you’re playing the chord.

  3. April 6, 2016 at 12:08

    Can I simply say what a relief to uncover somebody who truly understands
    what they’re discussing on the web. You certainly
    know how to bring an issue to light and make it important.
    More people ought to check this out and understand this side of your story.
    I was surprised you are not more popular because you most certainly possess the gift.

  4. April 15, 2016 at 18:10

    Excellent goods from you, man. I’ve be mindful your stuff prior to
    and you are simply too wonderful. I actually like what you have bought here, really like
    what you’re stating and the way in which through which you
    are saying it. You make it enjoyable and you continue to take care of to stay it wise.

    I can not wait to read far more from you. This is really a wonderful site.

  5. April 16, 2016 at 07:50

    I am no longer positive the place you’re getting your information,
    but good topic. I must spend some time learning much more or understanding more.
    Thanks for wonderful information I was searching for this information for my mission.

  6. April 17, 2016 at 08:39

    I likewise chechk in (as well as went down bucks) at St Marks Seems, Used Rose, aand also Academy on 18th.

  7. April 18, 2016 at 10:59

    Howdy I am so thrilled I found your blog page, I really found you by accident, while I was searching on Aol for something else, Anyways I am here now and would just like to say kudos for a marvelous post and a all round entertaining blog (I also love the theme/design), I don’t have time to look over it all at the
    minute but I have saved it and also added in your RSS feeds,
    so when I have time I will be back to read a lot more,
    Please do keep up the superb job.

  8. April 19, 2016 at 15:31

    You should be a part of a contest for one of the most useful sites on the web.
    I most certainly will highly recommend this site!

  9. May 2, 2016 at 22:56

    Woah! I’m really loving the template/theme of this blog.
    It’s simple, yet effective. A lot of times it’s challenging to get that “perfect balance” between superb usability and visual
    appearance. I must say you have done a great job with this.
    Also, the blog loads super quick for me on Firefox.
    Superb Blog!

  10. July 24, 2016 at 21:43

    I like reading a post that can make men and women think.
    Also, thank you for allowing for me to comment!

  11. July 27, 2016 at 18:18

    Genuinely no matter if someone doesn’t understand after that its up
    to other visitors that they will help, so here it takes place.

  12. October 21, 2016 at 08:43

    Good post. I certainly love this website. Thanks!

  13. November 28, 2016 at 22:39

    Great article.

  14. July 14, 2017 at 15:47

    From his expertise, anybody who’s critical about having future, top of the range site visitors for his or
    her website must be ready to buy about 7 or eight numerous products and commit 6+ several hours each day
    working with These purposes.

  15. August 9, 2017 at 04:19

    I like the helpful information you provide on your articles.

    I will bookmark your blog and check once more here regularly.
    I’m rather certain I’ll be told a lot of new stuff proper right here!
    Good luck for the next!

  16. August 21, 2017 at 23:10

    Do you mind if I quote a few of your articles as long as I
    provide credit and sources back to your site? My blog site is in the exact same
    niche as yours and my visitors would genuinely benefit from
    some of the information you provide here. Please let me know if this ok with you.
    Thank you!cheap nfl jerseys

  17. September 28, 2017 at 09:02

    With a better understanding of seo (web optimization), it’s time to construct out
    your retailer.

Leave a Reply

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