I never heard anyone saying that they were not ok, since the question How are you is usually not really intended to ask how the person is, but just to start a conversation.
So even if you are not ok, I would suggest you´d say that you are.
But if you still want to say you are not alright, this are my suggestions:
In an English School I attended (a long time ago!) it was taught that the reply to 'How do you do?' (the most common form) and 'How are you?' is a repetition of the same words: 'How do you do?' - 'How are you?'
I.e.: The inquirer isn't a bit interested in the reply.
At your disposal.
Yes, in general you would only answer with honesty that you are not feeling very well if you were asked by someone close to you, family / friends.
It is true that often when asked this question, the answer will seem to come back as just "How are you?". I think this is more because the two people are both talking at the same time. But it works to do it that way.
On top of other answers here, some good options are:
I'm good thanks. (a very standard but fine answer, for if you feel fine or are being polite).
I'm great thanks (if you are feeling more enthusiastic)
Not bad thanks. (less enthusiastic, but still polite).
(it's very common to add "thanks". Though not mandatory)
And sorry, Hermadoro, but "How do you do?" is not at all common these days. The only time it might be used is when meeting someone for the first time, And even then it's quite formal / for showing extra respect. (more common just to say "Nice/pleased to meet you").
ps. "I'm fine" - while this still works, for sure, it is a very common answer if you're annoyed at the person who asked you, or if you want to indicate that you don't want to talk. This depends, of course, on how it's said. But just something to be careful with.