How to install Jekyll + nginx + Ubuntu + subdomain of godday

I used the following for : blog.algorithmninja.com

Let’s say you have a site www.example.com hosted in aws EC2 with IP: exampleIP


 

For Goddady stuff go here  and following values.

  • Host – blog
  • Points to – exampleIP or the new IP
  • TTL – 600

 

Ngnix Conf:

Write the following conf to /etc/nginx/sites-enabled/example_blog_conf

server { 
 listen 0.0.0.0:80;

 server_name blog.example.com;

 access_log /var/log/nginx/blog.example.log;

 location / {
 proxy_set_header X-Real-IP $remote_addr;
 proxy_set_header HOST $http_host;
 proxy_set_header X-NginX-Proxy true;

 proxy_pass http://127.0.0.1:4000;
 proxy_redirect off;
 }
}
$ sudo service nginx restart

Jekyll setup

$jekyll new blog
$ sudo apt-get install ruby-full
$ curl -sSL https://get.rvm.io | bash -s stable --ruby
$ source /home/ubuntu/.rvm/scripts/rvm
$ rvm install ruby --latest
$ rvm use ruby --latest
$ gem install jekyll bundler
$ jekyll new blog
$ bundle install

 

Update: blog/_config.yml

title:Example
email: your-email@example.com
description: > # this means to ignore newlines until "baseurl:"
 I have an awesome new Example blog
baseurl: "" # the subpath of your site, e.g. /blog
url: "http://blog.example.com" 
twitter_username: jekyllrb
github_username: jekyll
# Build settings
markdown: kramdown
theme: minima
gems:
 - jekyll-feed
exclude:
 - Gemfile
 - Gemfile.lock
~
$ jekyll serve

..