Building confidence and self-esteem is a fun challenge for any dog and owner! All the rank reduction rules need not apply here, we can throw many of the normal rules regarding respect out, and instead focus on trust, structure, routine, exercise and allowing the dog lots of 'wins' to build confidence. Allowing a meek dog to win a tug of war, allowing him to lead the walk (perhaps with the help of a flexi-lead) and giving him more opportunities to experience new things, people and places will help boost confidence no end.
Trust is very important for relaxation where these dogs are concerned, a means of trusted communication with the dog can be found through obedience training that includes lots of reward and praise.
I would always advise people to be sure to protect their dog's personal space where confidence is an issue. It is not a good idea to allow other people or dogs to disrupt an insecure dog's comfort zone at all, even through direct eye contact. The goal is that you are trusted by the dog to control every situation so that he can relax. Avoid patting on top of the head or behind the ears, instead scratch the chest or neck area. All touching or moving into his intimate space should be on the dogs terms – assisted by the handler when it comes to third parties, if the dog is allowed to choose to approach rather than to be approached then he will become more curious and will begin to engage his nose more and more frequently and will generally become more adventurous and outgoing.
I would also recommend lots of play and praise. Having successful social relationships with other dogs through play is a fantastic way to boost confidence and self-esteem.
For very nervous dogs a lightweight brightly coloured coat or bandanna can be helpful to distract the eye from direct eye contact, in this way people that you pass or meet whilst out and about will be unlikely to look directly at the dog's face.
Obviously no praise or gentle words should be given during the fearful or shy moments, if the behaviour can't be ignored then it is far more encouraging to robustly pat the dog on the side or similar and encourage a tail wag and some excited play, acting happy and excited and completely unworried is the best way forward as this will feed to the dog.
Shy and anxious dogs with low self-esteem and confidence are usually very stressed. Good foundation work for a dog like this is plenty of off lead running, if they can romp and play unrestricted then a lot of nervous energy will be expended in this way, fetch or similar accompanied by effusive praise and excited petting is brilliant, as is celebrating his successes in all areas.
Above all no excessive pressure should be put upon the dog, each dog has his own personal 'time schedule' to adhere to, some move on more quickly than others and patience is required. Now and again if the dog experiences a 'mental block' it may be necessary to think up new approaches that rely on a little pressure followed by huge celebration upon success, but at the end of the day the dog has to consciously decide that a situation makes him feel comfortable or confident after he has the hindsight of many successful positive interactions that he has controlled. Providing that the foundation of trust is there between dog and owner, then bringing confidence up is extremely good fun and the reward of a happy confident dog is definitely worth the effort.