Website service over LAN on macOS Venutra—Jekyll RB's server

I work on websites processed using Ruby Jekyll (a flat-file site processor) that can, in testing out revisions, spin up a web server to host the website. It helps to access this server across my LAN on different devices to see how websites display on those devices.


I could do this easily on macOS Sierra and High Sierra. Finally updated my development box to Ventura, and now have regrets. Lol.


I feel like I'm missing something. It works fine if I run the Ruby Jekyll commands to spin up the server, and I can access it on the development box (macOS Ventura) at 127.0.0.1:400 or Bonjour-Name.local:4000.


But none of my other devices on the LAN can access it.


I believe in High Sierra, under sharing, there was a Web Sharing option that, if turned on, would open up the ports and server on the LAN.


I checked the Firewall—it's off—but it seems to have no settings for handling this.


I'd prefer not to get into ipconfig and what-not, or editing /etc/hosts—am I missing something obvious from High Sierra to Ventura on this?


(I did look at the "how to set up a web server in Ventura" posts, but those are all Apache servers, and this is a Ruby-based server—not Apache.)

Posted on Feb 28, 2024 2:06 PM

Reply
Question marked as Top-ranking reply

Posted on Feb 28, 2024 4:29 PM

Got it sorted.


When running the

jekyll serve

command, to enable Ruby to listen to all the bindable addresses I need to identify the host, which can be shortcutted to 0.0.0.0.


Then macOS dutifully asks whether I do indeed want to allow Ruby to listen on those ports through a popup.


Not sure how I got around this in the past. Probably something dumb on my part with the Firewall.


A good article on this, generally, as to the

jekyll serve

command can be found here:

https://zarino.co.uk/post/jekyll-local-network/


Hope this helps anyone else messing with this. (I suspect there is another way to force a bind and listening, but I did not find it before I found this.)

Similar questions

9 replies
Question marked as Top-ranking reply

Feb 28, 2024 4:29 PM in response to PacerLCAF

Got it sorted.


When running the

jekyll serve

command, to enable Ruby to listen to all the bindable addresses I need to identify the host, which can be shortcutted to 0.0.0.0.


Then macOS dutifully asks whether I do indeed want to allow Ruby to listen on those ports through a popup.


Not sure how I got around this in the past. Probably something dumb on my part with the Firewall.


A good article on this, generally, as to the

jekyll serve

command can be found here:

https://zarino.co.uk/post/jekyll-local-network/


Hope this helps anyone else messing with this. (I suspect there is another way to force a bind and listening, but I did not find it before I found this.)

Feb 28, 2024 2:42 PM in response to PacerLCAF

Unfortunately, I couldn't find anything about Ruby-based web servers that can help. One excellent User Tip article, by a valued forum member, in fact is specific to Apache, and I'm sure won't help you either.


Ref: Setting up a local web server on macOS 13… - Apple Community


However, one thought that came up as I happened to be creating a High Sierra VM with Parallels, may be a potential solution, or at least, a possible workaround. My thought is creating a VM of Sierra of High Sierra, using a VM manager like Parallels or VMware. Use this VM to host your Ruby web server for testing purposes. Your network clients would then access this server on the VM.

Feb 28, 2024 4:20 PM in response to PacerLCAF

PacerLCAF wrote:

your take on installing Apache would run into this same issue

Perhaps it does. I make a point to explain that those instructions are only for doing local development. And those instructions include the config file option to limit connections to localhost. Most likely, your Ruby and/or Jekyll configuration has a similar setting.


Feb 28, 2024 3:20 PM in response to PacerLCAF

Whelp, up, ports are closed. Sigh. Now I just have to figure out why, and how to open them up. NMAP results:


Nmap scan report for 192.168.1.*

Host is up (0.0078s latency).

Not shown: 998 closed tcp ports (conn-refused)

PORT   STATE  SERVICE

5000/tcp filtered upnp

7000/tcp filtered afs3-fileserver


Nmap done: 1 IP address (1 host up) scanned in 5.15 seconds

Feb 28, 2024 2:50 PM in response to Tesserax

No, the Apache-based solution doesn't work. In fact, in that solution, if I recall, it does not discuss opening up the server to the LAN anyhow. (There is another post on changing the config file to grant access to all hosts.)


The issue appears to be an inability to access the TCP port for the Mac, but I'm not sure why that is not the case (or what I did in prior OS versions to allow for it).


It's a pain. Installing Homebrew so I can add nmap and do some port scanning. Maybe that will help narrow it down.


I know the server is up and running. I can access it on the computer itself. I simply cannot hit port 4000 and access it on the LAN. But I CAN ping the computer on the LAN.


Alas. I feel like there is a setting somewhere obivous that I'm missing.

Feb 28, 2024 3:02 PM in response to PacerLCAF

There isn't anything special you need to do to "open up" the machine on the network. There was never any setting in High Sierra to do that. Ventura is an officially supported version on the Jekyll website. However, they don't recommend using the system version of ruby. Instead, they recommend Homebrew. Personally, I would never recommend Homebrew for anything, but that's me.

Feb 28, 2024 3:09 PM in response to etresoft

Yea. I know. It should just work. And, yeah, I don't use the system version of Ruby. Chruby is installed.


Once again, the issue is that everything works on the machine, but the LAN cannot access the server for some reason.


And now I'm stuck installing Homebrew on one of those external machines on the LAN so I can do some port sniffing.


It's a bit of a pain. For example, your take on installing Apache would run into this same issue (although, I do wonder if changing some of the hostname access settings in config files would work).


I could maybe edit /etc/hosts, but my machines IP address may change over time (it's assigned by the router).


It should just work—and it DID just work in older macOS versions—but, for the life of me, I can't remember what the switch was that I used to get it to work. (I think it was as simple as opening up the Port in the Firewall; but that's OFF entirely in Ventura, so that shouldn't be it, either.)


Just waiting on Homebrew to stop being a shallow clone, doing a brew update, and trying out nmap . . .

Feb 28, 2024 3:45 PM in response to PacerLCAF

And on the local machine running the server, here is what NMAP shows:

Nmap scan report for localhost (127.0.0.1)

Host is up (0.00011s latency).

Not shown: 996 closed tcp ports (conn-refused)

PORT   STATE SERVICE

631/tcp open ipp

4000/tcp open remoteanything

5000/tcp open upnp

7000/tcp open afs3-fileserver


RemoteAnything is the Jekyll Server (running on port 4000).


For the life of me, I cannot sort out how to open up this port. But it may be a tomorrow issue.


It stinks when you get around to missing Linux.


(And Homebrew is perfectly fine. It's less risky than Macports. And if you're doing serious development on the Mac, then it's a great tool for setting up common development environments across POSIX and *NIX systems.)

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Website service over LAN on macOS Venutra—Jekyll RB's server

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.