The magistrate shall be entitled to demand and receive from the person applying for such warrant a fee of two dollars before issuing the warrant, and the sheriff or constable shall in like manner be entitled to demand and receive from such person a fee of two dollars and mileage before executing such warrant.