Shadow map camera alignment ?

I suppose im wondering if there is even a answer for this. Or do i need to be asking for links to better teqniques.

The problem i have atm is besides minor ones is that the camera for my shadow mapping doesn’t always or cant seem to line up with the scene.

So how is shadow mapping handled when looking at things that are at a right angle between the camera and the light or in between them ?
How is the camera handled in a 360 degree world ?