What you are doing fits under the umbrella of power distribution, and generally requires an electrician's license to perform. It is sometimes tricky to get right, so I recommend that you do not venture into that without the appropriate knowledge and qualifications.
Code prohibits appliances that are not certified by one of the several underwriters (UL, CSA, Intertek/ETL…) to be connected to a receptacle. Since you are building the rack yourself, the whole rack counts as such an "appliance", meaning that if you do not want to void your homeowner insurance, your setup will need to be verified and approved by an electrician (or possibly an electrical engineer).
Going with off-the-shelf products like Harper suggests seems to be a very good idea, safety-wise, but your insurance policy might still require you to get your setup verified by an electrician. Ask your insurer and a qualified electrician. Your typical contractor might not know much about server rooms, so try to look for server room experts who also happen to have an electrician contractor's license.
User Dave Tweed said that "the electrical code doesn't care what happens beyond the wall socket". This is true only to a certain extent. For example, code will say things like a type of appliance (e.g. a dishwasher or a refrigerator) will require its own dedicated receptacle or branch circuit on its own breaker. Also, code will prohibit doing things like stapling power cords to a wall to route cords to e.g. a lamp. Code will also prohibit one from connecting devices that are not certified to a receptacle; a device requires a nameplate that lists the name of the manufacturer, model number, serial number, utility voltage, sustained current use, peak current use if applicable, cycles, additional certifications (e.g. wet-location approved). Also, it is forbidden in the Canadian electrical code to run an extension cord or circuit from one building to another to power one-off receptacles or circuits, save very exceptional cases.