Is it appropriate to ask a professor via e-mail for a letter of recommendation?
In-person requests are always the best route, because you can gauge willingness and eagerness to write the letters much more directly than via telephone or email.

However, if you can't be there, because you've moved away, then it is of course appropriate to ask for letters by email. Whether or not the professor will grant the request or not is of course a question. However, I would mention that you've moved (and where you currently are) as part of your request, so that the professor knows why you're not able to come in for a meeting if asked.