The canons used to be those persons who resided in the buildings contiguous to the cathedral, employed either in the daily service, or in the education of the choristers. The word is Greek, and means a measuring rod, the beam of a balance; then, a roll or register containing the names of the clergy who are licensed to officiate in a cathedral church.
Or that the Everlasting had not flxed His canon 'gainst self-slaughter.
Shakespeare: Hamlet, i. 2.
Source: Dictionary of Phrase and Fable, E. Cobham Brewer, 1894
More on Canon from Infoplease: