Yes, and there is a lot of information about the little traps in the Moodle Docs about this. (I can't give you the pointer as I seem to be having some issue with them right now.)
This is how I would do it:
http://docs.moodle.org/22/en/Installing_Moodle_on_Debian_based_distributions.
http://docs.moodle.org/22/en/Installing_Moodle_on_Debian_based_distributions.