  (Abridged) This paper addresses the issue of magnetic field generation in a
relativistic shock precursor through micro-instabilities. The level of
magnetization of the upstream plasma turns out to be a crucial parameter,
notably because the length scale of the shock precursor is limited by the
Larmor rotation of the accelerated particles in the background magnetic field
and by the speed of the shock wave. We discuss in detail and calculate the
growth rates of the following beam plasma instabilities seeded by the
accelerated and reflected particle populations: for an unmagnetized shock, the
Weibel and filamentation instabilities, as well as the Cerenkov resonant
longitudinal and oblique modes; for a magnetized shock, the Weibel instability
and the resonant Cerenkov instabilities with the longitudinal electrostatic
modes, as well as the Alfven, Whisler and extraordinary modes. All these
instabilities are generated upstream, then they are transmitted downstream. The
modes excited by Cerenkov resonant instabilities take on particular importance
with respect to the magnetisation of the downstream medium since, being plasma
eigenmodes, they have a longer lifetime than the Weibel modes. We discuss the
main limitation of the wave growth associated with the length of the precursor
and the magnetisation of the upstream medium for both oblique and parallel
shock waves. We also characterize the proper conditions to obtain Fermi
acceleration. We recover some results of most recent particle-in-cell
simulations and conclude with some applications to astrophysical cases of
interest, pulsar winds and gamma-ray burst external shock waves in particular.
(Abridged)
