There are many ways of saying 'How are you?', but please note that 'How do you do' is NOT one of them. Here's a conversation using 'How do you do?'
A: Peter, this is my colleague, John. John, this is my neighbour Peter.
B: How do you do?
C: How do you do?
As you can see, 'How do you do?' is actually used in the same way as 'Nice to meet you' : it is a polite formula used when you meet someone or are introduced to someone for the first time. And although it looks like a question, it isn't in fact a question, because the response is identical. If someone says 'How do you do?' to you, you reply 'How do you do?'.