Are there any web apps that allow for source code collaboration? I'm thinking of something that could look at an SVN repo/local folder/etc. and publish the code with support for threaded discussions under each file or class. Ideally I want to find something that I could deploy/host myself, so being based in PHP would be a huge plus.
Atlassian has a product called Crucible that does this. It's not free, but if it's as good as some of their other products (we use Jira), it will be very well done.
Look at Attlassian Crucible (http://www.atlassian.com/software/crucible/)
And no, I am not associated with Atlassian in any way :)
You could try Trac (http://trac.edgewall.org/)
Although it is based in python not PHP.
SmartBear software, which is one of Jeff's sponsors, has some pretty compelling stuff. And a free book about peer review that is only slightly biased to their product.
One of the most popular solutions for web-based code hosting and management out there is google code. It's free to register a space and has SVN/Trac support, Wiki's for your project, hosted downloads, and alot of other things. However, you can only have 6 projects registered under your account at one time, and all your code is by default(I don't think this is changable either) visible to the public, and you're forced to select a license to use(the selection is decent, however).
However, my personal favorite in web-based project management and code hosting is Assembla. It's got even more features than GCode, and arguably easier to use. You can also have an unlimited(iirc) number of projects under your account, versus the maximum of 6 on google code. Like Google Code, it has SVN and Trac support.
EDIT: Oh, you're looking for an application you could deploy yourself. In that case, I would suggest you look at Fossil.