Build it yourself with "server grade" components. My previous machine was almost 10 years old when i retired it. It had 0 hardware failures in that time, and i retired it only because i wanted something with better performance. The previous machine was a SuperMicro motherboard with dual Pentium II-450, 1/2 GB ECC RAM, and SCSI hard disk.
I'm sure my previous machine would have lasted another 5 years if i'd really wanted to run it for 15 years. The other thing i do is about once per year shut the machine down, open it up, and clean out all the dust. At that time i also check that the fans are all functional and replace any that aren't. Really, though, as long as you don't let fans get overly clogged with dust and you don't buy the cheapest ones they are fairly reliable and will usually run for years. If the machine is placed on the floor, it should probably be cleaned more than once per year as it will suck in more dust than if it is placed higher.
My current machine was built with a similar philosophy as to the previous one, and i expect it also to last about 10 years before it is too slow for my taste. Again i used a SuperMicro motherboard and ECC RAM, but this time with SATA instead of SCSI disk. However, i chose one of the "server" SATA disks that is basically disk built to the same standards usually associated with SCSI, but with an SATA interface. That required giving up some capacity (it is only 74 GB), but it is large enough for my needs since i'm not storing multimedia on it. I added the additional requirement of wanting my current machine to be quiet, so i replaced the heat sinks on motherboard and CPU with larger versions, and then used large fans that spin slowly.