  We deal with the following general version of the classical moment problem:
when can a linear functional on a unital commutative real algebra $A$ be
represented as an integral with respect to a Radon measure on the character
space $X(A)$ of $A$ equipped with the Borel $\sigma-$algebra generated by the
weak topology? We approach this problem by constructing $X(A)$ as a projective
limit of the character spaces of all finitely generated unital subalgebras of
$A$. Using some fundamental results for measures on projective limits of
measurable spaces, we determine a criterion for the existence of an integral
representation of a linear functional on $A$ with respect to a measure on the
cylinder $\sigma-$algebra on $X(A)$ (resp. a Radon measure on the Borel
$\sigma-$algebra on $X(A)$) provided that for any finitely generated unital
subalgebra of $A$ the corresponding moment problem is solvable. We also
investigate how to localize the support of representing measures for linear
functionals on $A$. These results allow us to establish infinite dimensional
analogues of the classical Riesz-Haviland and Nussbaum theorems as well as a
representation theorem for linear functionals non-negative on a "partially
Archimedean" quadratic module of $A$. Our results in particular apply to the
case when $A$ is the algebra of polynomials in infinitely many variables or the
symmetric tensor algebra of a real infinite dimensional vector space, providing
a unified setting which enables comparisons between some recent results for
these instances of the moment problem.
