Hacker News new | past | comments | ask | show | jobs | submit login

I'm using DO to hack together some web pages to help me verify data for my mobile app. I'm thinking about building out the pages. However, at the moment I'm using a simple shell script to start.

#!/bin/sh

export PORT=8080 go run go/spanishdb.go go/Html.go

Any good blogs on using Go in a production ready server? Should I run behind Apache?




If you want to run Go directly you can use setcap to run it on port 80, without having to run it as root.

http://stackoverflow.com/questions/14537045/how-i-should-run...


Your best bet is probably to put it behind nginx and use something like supervisord to launch the server itself and restart it if it panics (supervisor will also handle log rotation etc).


Here here for supervisord watching Go behind nginx. I have this set up in production; even using the nginx tcpproxy plugin to reverse proxy some RPC servers.


FYI, you don't need to run go behind anything, the http server can handle thousands of requests per second. Of course you can if you want.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: