It it appropriate to request a letter of recommendation via LinkedIn?
If someone is on LinkedIn, especially if they are active on LinkedIn, I see no reason why they would be offended if you sent them a message on LinkedIn. LinkedIn is a professional networking site. That would be exactly what you are doing. I would write something straight forward:

[Salutation]
I am applying to graduate programs at a few schools. I enjoyed your class in Underwater Heavy Metal Guitar and felt I did well in the class. Would you be willing to write me a letter of recommendation for my graduate program applications?
Sincerely,
-bron10

Three weeks is a long enough time that this professor has likely not seen (or has forgotten about) your email. There is no reason to cower in fear about asking for a letter of recommendation from a professor who said he would write you one. If he is at all reasonable, a simple message on LinkedIn will be just fine.