I run a simple Go server behind Apache for my weekend project (<a href="http://www.thespanishsite.com" rel="nofollow">http://www.thespanishsite.com</a>). I started with this blog:<p><a href="http://www.jeffreybolle.com/blog/run-google-go-web-apps-behind-apache" rel="nofollow">http://www.jeffreybolle.com/blog/run-google-go-web-apps-behi...</a><p>I also use MySql on Digital Ocean with a $10/month droplet. The few issues at first where that I started with a $5/month which didn't enough RAM so I'd run out of memory until I created swap:<p><a href="https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04" rel="nofollow">https://www.digitalocean.com/community/tutorials/how-to-add-...</a><p>Still need to make it a daemon, but I'm not finished. I have one big method to set up my pages. I could write a blog, github repo or create a summary page on my site, if there's any interest.<p>func runWeb() {<p><pre><code> serveSingle("/robots.txt", "./robots.txt")
http.Handle("/css/", http.StripPrefix("/css/", http.FileServer(http.Dir("./css/"))))
http.Handle("/resources/", http.StripPrefix("/resources/", http.FileServer(http.Dir("./resources/"))))
http.Handle("/static", http.FileServer(http.Dir("./static/")))
http.HandleFunc("/chinese", chineseHomeHandler)
http.HandleFunc("/french", frenchHomeHandler)
http.HandleFunc("/chinese/numbers", chineseNumbersHomeHandler)
// Many handlers deleted ...
http.HandleFunc("/", homeHandler)
// http.ListenAndServe("localhost:9999", nil)
port := GetPort()
fmt.Println("listening...", port)
err := http.ListenAndServe(port, nil)
if err != nil {
panic(err)
}</code></pre>
}<p>/*
<a href="http://stackoverflow.com/questions/14086063/serve-homepage-and-static-content-from-root" rel="nofollow">http://stackoverflow.com/questions/14086063/serve-homepage-a...</a>
<i>/<p>func serveSingle(pattern string, filename string) {<p><pre><code> http.HandleFunc(pattern, func(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, filename)
})
}</code></pre>