Some typical methods include:
Fixed via a base plate screwed into the wall,
End with half post screwed into the wall,
Chemical anchoring with threaded rod in the absence of any other means of fixing.