I'm not a native speaker but I've spent some time in the US and studied English linguistics. I think that "How are you?" is a little bit more formal than "How are you doing?".
You would say "How are you?" when you don't know the person very well, or when you meet someone for the first time, whereas you would say "How are you doing?" when you already know someone, or act as if you already knew them. So "How are you doing?" is more warmful but it can be felt as a little too friendly in a formal context. Here's an example from a rap song:
Hey how ya doin'? Sorry ya can't get through Why don't you leave your name And your number And I'll get back to you
Ring Ring Ring ( Ha Ha Hey) De La Soul
Now, "How do you do?" is a set phrase in formal English and is considered as old-fashioned. When you met someone for the first time you would say "How do you do?" and the person would reply "How do you do?", in a reciprocical way and with a handshake shared by both persons who meet, so the meaning was broadly that of "Nice to meet you".
As a consequence, "How do you do?" lost the meaning of a real question but it used to have the meaning of a real one : when you meet someone it is polite to ask if that person is doing well.
In France, when you meet someone for the first time, you can say "Enchanté!", which literally means "enchanted" or "delighted", but it's a set phrase too which has greatly lost its original meaning. This way of greeting people is old-fashioned, just like "How do you do?" in English. It may also sound too polite or a bit snobbish.
What's more, I would like to point out that the verb DO is polysemous; "How are you doing?" has not the same meaning as "What are you doing?". There are other examples:
Okay, Jimmy, that does it! (That's enough! Stop it!)
Well, I guess that does it.(Alright, that's a deal)
Good, that will do for today. (That will be enough)
How are you guys doing here? (Waitress addressing customers : Is everything all right?)
DO is a process verb: you can proceed through an action, that is perform an action (do one's duty, do one's homework, do the dishes), or you can proceed through an appreciation, as in "The firm doing great". You can even "do time" if you go to prison.
You can also compare "How are you doing?" and "How is it going?", which have about the same meaning. In this case you're going nowhere in the common sense of the verb GO, but there's still the abstract idea of motion as you ask a question that carries out a motion through an appreciation.
I believe that space and time are fundamental notions in the study of languages : if you go somewhere it takes some time, as when you do something it also takes some time.
Take the word "fare" for instance: it comes from from the Old English verb faran, to journey. In modern usage, to fare usually doesnt mean to travel, but we do still talk about seafarers, those who travel on the sea, and wayfarers, those who travel along the roads.
Also from faran is the word farewell, now a synonym for goodbye. Its a shortening of May you fare well., Good bye coming from May God be with you.
In modern usage, to fare usually means to do or to get along:
How did you fare on your exam? I dont think hes faring too well in his new job.
In British English, a fare is also "the charge for using transport", transportation in American English. Now, tranportation takes time to go from one place to another.