by Edmund Edgar.
Did you install your new Moodle under /usr/share/moodle?
The reason I ask is that the obvious place to put the Moodle PHP files in a manually install would be somewhere that's already served by the web server, usually /var/www. But a package manager like apt-get will want to put it in /usr/share/moodle, then make an Apache setting so that when you go to http://yoursite.example.com/moodle it'll serve its version out of there. AFAIK nobody's even made a package for Moodle 2.3.1, so that's making me wonder if you have an old Moodle package installed as well.