Reputation: 3757
So I've searched google a lot, and I've tried everything everyone is suggesting but nothing seems to be working.
I want to view my jekyll website on my mobile.
When I run jekyll it says server address: 127.0.0.1:4000
My computer's IP is 154.135.X.Y
I've opened up the port in the windows inbound rules
I've tried accessing from my mobile using both 154.135.X.Y:4000 and 127.0.0.1:4000 but to no avail.
Anyone know how I can access my jekyll site on mobile?
Upvotes: 9
Views: 5027
Reputation: 49350
bundle exec jekyll serve --host 0.0.0.0
or jekyll serve --host 0.0.0.0
TiP: use {{site.baseurl}}/
to add images/assets in the pages and make sure there's no url:~
key in _config.yml
Upvotes: 3
Reputation: 4575
If your server address is 127.0.0.1 it means Jekyll is only listening on your localhost. You'll need to start Jekyll and instruct it to bind to port 4000 on ANY interface:
jekyll serve --host 0.0.0.0
Configuration file: none
Auto-regeneration: enabled for '/private/tmp/test'
Configuration file: none
Server address: http://0.0.0.0:4000/
Server running... press ctrl-c to stop.
If you are accessing the computer from the web, you'll need to make sure your router forwards port 4000 to your PC.
If you are accessing the computer from your local LAN, make sure you accessing the private IP of your computer, and not the public IP.
Obviously you need to make sure there's not firewall that blocks incoming connections on your PC as well.
Upvotes: 24