Where I'm from it's mostly just a greeting, but people can and do answer it literally. It just takes a little bit of common sense. A random coworker you hardly know is not the person to tell that your dog just died and that you spent all night crying and eating ice cream. So we do answer the question honestly but we just don't give too much information to people we aren't close with and we don't make our problems other people's. Usually that involves some insurance that you're ok so that they don't feel obliged to offer you help or discuss the problem at length.
Here's an example of honest answers which would be totally normal among acquaintances/coworkers/neighbours etc. where I'm from:
"Hey, how are you doing?"
"Oh, I'm alright, I've been sleeping pretty poorly lately actually but still trucking along."
"Oh sorry to hear [at this point they may say something like "my cousin had a similar issue and melatonin tablets worked great for him" or not]
"[Acknowledge any advice]... anyway, how about you?"
"Yeah I'm fine. Been a bit miserable about the weather but what can you do?"
"Oh absolutely. Can't wait for a little bit of sunshine again. Anyway, I better run to work, see you around!"
"Bye!"
Obviously neither of those are deeply personal or heart-breaking problems, at least not in the level of depth with which they were addressed in the conversation, but again you should limit deeply personal problems to people with whom you have a solid personal relationship with.