How to publish an academic book but make the PDF freely available online?
Cambridge University Press allows authors to freely distribute electronic copies of the books that it publishes, at least in mathematics and computer science.  (Of course this has to be explicitly negotiated into the publishing contract.)  Two good examples are Allen Hatcher's Algebraic Topology and Steve LaValle's Planning Algorithms.

You could also just release the book on the web, let people create their own physical copies through a book-printing service like Lulu or Blurb, and rely on the quality of the text to bolster your reputation instead of a traditional publisher's imprimatur.  See, for example, Pat Morin's excellent Open Data Structures.  However, I don't recommend this route unless (a) you write an amazingly good book, and (b) you already have tenure.