4

I'm trying to set up Jekyll on my Windows 10 machine, but can't connect to the website (127.0.0.1:4000) that is created by jekyll serve (or bundle exec jekyll serve). I have followed all the steps in Julian Thilo's Run Jekyll on Windows without any error messages. And when I run jekyll serve in PowerShell from my Jekyll website folder everything seems just fine:

Configuration file: C:/Users/fredr/dropbox/github/jekyll-website/_config.yml
            Source: C:/Users/fredr/dropbox/github/jekyll-website
       Destination: C:/Users/fredr/dropbox/github/jekyll-website/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
                    done in 0.457 seconds.
 Auto-regeneration: enabled for 'C:/Users/fredr/dropbox/github/jekyll-website'
    Server address: http://127.0.0.1:4000/
  Server running... press ctrl-c to stop.

But when I open http://127.0.0.1:4000 (or http://localhost:4000) in my browser, the connection fails.

When I run netstat -an, the port 4000 is listed as

  Proto  Local Address          Foreign Address        State
  TCP    127.0.0.1:4000         0.0.0.0:0              LISTENING

I have previously managed to set up a localhost using IIS, but that website is stopped now.

This Github issue seems related, but doesn't contain enough information for me to figure out how the problem was solved. It only says to use the "Jekyll on windows package", but I can't find any information on that.

Fredrik P
  • 682
  • 1
  • 8
  • 21

2 Answers2

2

Following in @Fredrik P's footsteps, I CD'd into the project's _site folder (this is where the home folder of the server should be) and ran a Python 3.x simple HTTP server:

D:\frida\frida-website\_site>python -m http.server 3999
Serving HTTP on 0.0.0.0 port 3999 (http://0.0.0.0:3999/) ...

Now pointing my browser to http://0.0.0.0:3999/ works like a charm.

If you need to use Python 2.x, the HTTP server command would be:

python -m SimpleHTTPServer 3999

For more information regarding SimpleHTTPServer (2.x) and http.server (3.x), see this Stack Overflow post.

Moshe Rubin
  • 1,944
  • 1
  • 17
  • 37
1

Until some better solution pops up, I will just host the _site folder with IIS. Not as fancy pancy but works like a charm :)

Fredrik P
  • 682
  • 1
  • 8
  • 21