Nowadays, most network CCTV cameras offer a special installation mode called “Corridor Mode”. This setting may have an advantage when monitoring a narrow space, such as a hallway. This video illustrates a situation where distance vision is more important than left/right:
First, you need to mount the camera at 90 degrees. Sometimes it is possible to rotate only the lens inside the camera. Other times you have to directly screw the camera at 90 degrees.
Another step is necessary and must be done in the camera settings. By logging into the webpage of the camera, find the setting to rotate the camera image. This parameter may be called by a different name, depending on the brand of the camera. It can be image rotation, corridor mode, rotation, flip/mirror, etc.