I just started to test Google compute engine. Now I'm trying to deploy my Go (golang) application on it, so that it can be reached from outside. I use compute engine in favor of the app engine, since my application requires a MongoDB database.
I did the following:
- create compute engine instance
- setup up firewall so that port 1234 is open and IP is static
- install MongoDB
- upload my application
- start
The application starts just fine. But I cannot reach it from outside if I open it in my browser with ip:1234. I also tried to start it on port 80 as root user, but this didn't work neither.
The server is configured as following:
{
"host": "localhost:1234",
"dbhost": "localhost",
"db": "dbname",
"logfile": "log"
}
When I'm using an apache server it servers port 80 and the page is displayed... OS is ubuntu 14.04.
The main simply adds some handlers to a mux and adds a FileServer to the public dir:
mux.Handle("/", http.FileServer(http.Dir(public_dir)))
// [...]
if err := http.ListenAndServe(cfg.Host, mux); err != nil {
panic(err)
}
So what's the issue here?