Made the hostname uses in the virtualhost and Apache resources use the Facter fact so the code is more portable.
Added a port parameter to the virtualhost resource.