For serving a writ out of any court, no officer shall be allowed to receive or charge for mileage upon any greater number of miles from and to the courthouse of his county than shall have been actually and necessarily traveled by him in making such service.
N.J.S. § 22A:1-6