Follow

I really want to give Hugo (gohugo.io) a fair shot, but even after hours of trying I can’t get the localhost:1313 up and running - feeling very stupid and frustrated

(it’s one of the reasons for my love-hate relationship with web development work; at the moment I hate it)

@naii I haven’t seen your other posts, but what commands have you tried? Any errors? I’m sort of familiar with Hugo and might be able to help.

@max Oh cool.

So, I’ve tried the regular server commands:

$ hugo server

$ hugo server -D

$ hugo server --theme=ananke

$ hugo -v --debug -D

$ lsof -i tcp:1313 (to see which process is currently using port 1313)

All commands ran error-free on the terminal.

I also tried…

$ ps -ax | grep hugo

…got this as the result…

$ 12707 ttys000 0:00.00 grep hugo

…then tried to kill this process by using…

kill 12707

…but then it says…

$ -bash: kill: (12707) - No such process

I should add…

@max

…that when starting the server and opening the browser with the url…

https://localhost:1313

…the browser says…

Couldn’t establish a secure connection. So maybe there’s even an issue with my local https.

I’m pretty clueless right now.

@naii just for shits and giggles try http://127.0.0.1:1313

@max OMG, that’s impossible… BUT… it actually worked *lol* have no idea why :P

THANKS MAXIE!!!… now I need figure out how to make localhost:1313 work.

@max I’m pretty sure it has something to do with the `/etc/hosts` file

@max I moved a step further meaning…

I tried…

$ sudo apachectl configtest

…and got the response…

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using Alexanders-Mac-mini.local. Set the 'ServerName' directive globally to suppress this message
Syntax OK

So. I tried to enter this URL into the browser…

alexanders-mac-mini.local

…and…

alexanders-mac-mini.local:1313 (for Hugo)

and both work.

So now I want to find a way rename this to localhost.

@naii Apache doesn’t need to have a server name unless you are hosting multiple sites.

For the localhost thing, that will be in you /etc/hosts file.

There should be something like:

127.0.0.1 localhost

@max

Ok.

Regarding /etc/hosts…

This is what’s inside:

127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost

@naii hmmm maybe Hugo on Mac just doesn’t bind to that name idk then..

@max Ok, that’s fine.

You’ve been a great help - thanks a lot :)

@max Oh and someone else gave me the tip to use this command to start the server:

$ hugo server -D --baseURL "http://alexanders-Mac-mini.local"

It works well, and I will stick to that solution.

Apart from that he’s pretty sure it’s a macOS Catalina issue, see: discourse.gohugo.io/t/macos-ca

Sign in to participate in the conversation
naii.io’s Mastodon

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!