In the past I have really enjoyed using Trac with subversion repositories hosted on some of my own servers. The integrated ticketing and online code browsing is very conven
Tip: A completely different way to get Trac ticketing functionality is ditz.
"Ditz is a simple, light-weight distributed issue tracker designed to work with distributed version control systems like git, darcs, Mercurial, and Bazaar."
Your tickets reside with your code. It's not possible to lose one and have the other; which is a good thing. The Trac-like website is generated by the ditz command-line tool.
I enjoy it.