First thing you want; the two Heavy Armor Specialization feats from Races of Stone. These'll give you +2 AC while in heavy armor, and -3 ACP while in heavy armor. Combine this with Knight 4 levels and Mithral Full Plate, and you've got an armor with +10 AC, -0 ACP and no penalty to speed.
The Knight levels will give you +1 AC when using a shield. Take Shield Specialization for another +1 from the shield, then take Shield Ward to add your shield bonus to your touch AC, which helps alleviate a huge problem in most tank builds. Knight levels will also allow you to treat your threatenes squares as difficult terrain, which helps you in your main goal. You can also use this to keep enemies from getting full attacks against you. Attack, take a 5ft step back, and wait. They can't 5ft step forward, since you can't take a 5ft step into difficult squares.
If you want, and if it fits the character and the setting, go with a couple of levels of Psychic Warrior for another Races of Stone feat. I forget the name, but it allows you to add your armor bonus against touch attacks, which makes you the hardest thing to hit, ever, anywhere.
After the Knight levels, and if you go for it the Psychic Warrior levels (I suggest no more than 2), go for Warblade. It has the d12 HD that will drive your taqnkiness for the rest of your career, and the maneuvers will help you dish out the damage as well. I suggest Mountian Hammer Strike (and future versions) combined with the Diamond Mind Concentration based maneuvers, combined with a high Concentration check.
If you're looking for more "You can't kill me... EVER.", then you might want to go for three levels of Paladin, and a level of Pious Templar, if you don't mind playing a holy tank. That gives you all teh nifty Paladin stuff, including Fear Immunity and some minor healing. With a decent Charisma, you get a nifty bonus to saves. The Pious Templar's Mettle ability is nice, as well. If you can manage it, and don't mind a couple of levels of low HD, go for 2 levels of Rogue for Evasion. Martial Rogue, if you can float it, for a couple more feats. That gives you phenominal saves, especially with Moment of Perfect Clarity, Action Before Thought and Mind Over Body. Combined with Mettle and Evasion, you'll never fail a save, and never take any effect from anything that allows a save.
Weapon wise, I'd suggest my old friend, Stormclaw. It was a +1 Keen Thundering Shocking Burst Adamantine Mercurial Longsword. It's not the most broken weapon around, which is cool, but it's got a 19-20/x4 crit, and deals MASSIVE damage if you do confirm that critical. 4d8 +4x Str base, +1d6 shocking, +3d10 shocking burst, +3d8 thundering, +4x any other static bonuses. Being the tank, you'll be making plenty of attacks, and those are bound to threaten eventually. Your shield should be just plain +x, the highest you can get it. Especially if you didn't go the psionic route, you'll need that boost to touch AC from Shield Ward. Your armor whould be +2, then add Light/Medium/Heavy Fortification, as soon as you can get them. Being the tank, you'll be taking plenty of attacks, and those are bound to threaten eventually. Get an item with Shield Other on it. DnD combat is hectic, and you can't be near everybody all the time. When battle starts, connect with the squishiest ally so they don't die when they wander off and get attacked by the hidden badguy. 'Cuz there's always a hidden badguy.
Stats are simple. If you're going the normal tank, go with Con/Str/Int/Dex/Wis/Cha. If you take the psionic route, switch Dex and Wis. if you go with Paladin, go Con/Str/Cha/Wis/Dex. This, of course, can be modified to fit your character's personality concept, but Con should ALWAYS be at the top of your list. It's the first thing you enhance, the first thing you read books about, and the only thing you use level-beased increases for.
In battle, with your Knight levels, always stay in the middle of things. Make sure that enemies can't move ANYWHERE without being in your threatened area at some point. First off, it'll give you an AoA as they move away, and if you get enough feats, take Standstill to keep them from moving away. Second, their movement will be slowed since your threatened squares are difficult terrain. This means that most enemies will either not be able to move far past you, or will stop and fight you instead of others. And that's what a tank is for.
So, that's generally my take on tanks. Make sure you're the guy who never dies, and you can have the dubious honor and glory of carrying your allies out of the dungeon just about every time.