Sol-gel porous materials with tailored or nanostructured cavities have been increasingly used as nanoreactors for the enhancement of reactions between entrapped chemical reactants. The domains of applications issued from these designs and engineering are extremely wide. This tutorial review will focus on one of these domains, in particular on optical chemical sensors, which are the subject of extensive research and development in environment, industry and health.