  We use the conditional luminosity function (CLF), which gives the number of
galaxies with luminosities in the range [L, L+dL] that reside in a halo of mass
M, to link the distribution of galaxies to that of dark matter haloes. We seek
the CLF that reproduces the galaxy luminosity function and the luminosity
dependence of the galaxy clustering strength and test the models by comparing
the resulting mass-to-light ratios (M/L) with constraints from the Tully-Fisher
(TF) relation. We obtain a number of stringent constraints on both galaxy
formation and cosmology. In particular, this method can break the degeneracy
between Omega_0 and the power-spectrum normalization sigma_8, inherent in
current weak-lensing and cluster-abundance studies. For flat LCDM cosmogonies
with sigma_8 normalized by recent weak lensing observations, the best results
are obtained for Omega_0~0.3; Omega_0 < 0.2 leads to too large galaxy
correlation lengths, while Omega_0 > 0.4 gives too high M/L. The best-fit model
for the LCDM concordance cosmology (Omega_0=0.3) predicts M/L that are slightly
too high. We discuss a number of possible effects that might remedy this
problem, including small modification of cosmological parameters, warm in stead
of cold dark matter, systematic errors in current observational data, and the
existence of dark galaxies. Finally we use the CLF to predict several
statistics about the distribution of galaxy light in the local Universe.
