  We apply the gaussian variational method (GVM) to study the equilibrium
statistical mechanics of the two related systems: (i) classical elastic
manifolds, such as flux lattices, in presence of columnar disorder correlated
along the $\tau$ direction (ii) interacting quantum particles in a static
random potential. We find localization by disorder, the localized phase being
described by a replica symmetry broken solution confined to the mode
$\omega=0$. For classical systems we compute the correlation function of
relative displacements. In $d=2+1$, in the absence of dislocations, the GVM
allows to describes the Bose glass phase. Along the columns the displacements
saturate at a length $l_{\perp}$ indicating flux-line localization.
Perpendicularly to the columns long range order is destroyed. We find divergent
tilt modulus $c_{44}=\infty$ and a $x \sim \tau^{1/2}$ scaling. Quantum systems
are studied using the analytic continuation from imaginary to real time $\tau
\to i t$. We compute the conductivity and find that it behaves at small
frequency as $\sigma(\omega) \approx \omega^2$ in all dimensions ($d < 4$) for
which disorder is relevant. We compute the quantum localization length $\xi$.
In $d=1$, where the model also describes interacting fermions in a static
random potential, we find a delocalization transition and obtain analytically
both the low and high frequency behavior of the conductivity for any value of
the interaction. We show that the marginality condition appears as the
condition to obtain the correct physical behavior. Agreement with
renormalization group results is found whenever it can be compared.
