Serving Jekyll site via Vagrant machine
In the root of your jekyll site create a Vagrantfile
:
Vagrant::Config.run do |config|
config.vm.box = "precise32"
config.vm.box_url = "http://files.vagrantup.com/precise32.box"
config.vm.forward_port 4000, 4000
config.vm.provision :shell,
:inline => "sudo apt-get update && sudo apt-get -y install build-essential git ruby1.9.3 && sudo gem install github-pages --no-ri --no-rdoc"
config.ssh.forward_agent = true
end
Start the machine and connect to SSH:
$ vagrant up
$ vagrant ssh
Now, you can start Jekyll on the machine:
$ cd /vagrant/
$ jekyll serve -twP 4000
Your site is served on http://localhost:4000/ address.
When you are done just pres ctrl+c
and then type exit
.
Written by Aleš Roubíček
Related protips
1 Response
hey, you need to bind host to 0.0.0.0
check this http://stackoverflow.com/questions/27617217/cannot-reach-jekyll-server-on-vagrant-from-outside
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Vagrant
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#