Yes you will need to update apache to point newdomain.com at your Moodle install directory.
You then need to update Moodle config to tell Moodle iteself it is now on newdomain.com
The other thing you need to do is replace all references in the database changing olddomain.com to new domain.com
Let us say for example a teacher hard coded a link in a label linking to another page or file in Moodle, or made a forum post that said "please enroll on this course [click here link]", those links all need to be updated and there are dozens of places they can appear, forum posts, labels, pages... anywhere the text editor allows you to drop a link in Moodle could potentially have hard coded (manually added by users) links.
That is why Bret has recommended using the string replace tool in Moodle.
There is another way to do this which is to dump the database to a text file and do the string replace on the file system then re-import the file.
One thing you need to be mindful of is that if muchlongernewdomain.com is longer than olddomain.com, that is the new domain has more characters in it you can run into problems with serialized data in html blocks and any other fields which track character length. I have never used the string replace tool Bret mentions but would hope (given it is a Moodle built tool) it handles issues around serialization of blocks where the serialized data contains the number of characters and throws errors if actual characters are different to the expected values).