The Internet is emerging as a major contributor to the global carbon emission as it consumes in the US alone more energy than that consumed by all of the automotive industry. Content distribution as video on demand represents the majority of the Internet traffic. Therefore, in order to reduce the carbon footprint of the Internet, greener methods for content delivery have to be employed. In this paper, we allow the intermediate nodes to be powered by renewable energy sources, i.e., solar or wind. We also assume that these nodes have a storage capability and can store some of the packets to serve future requests without going back to the source of the contents. Under this model, we formulate the problem of minimizing the brown energy usage, while satisfying the users requests. The problem is formulated as a mixed Integer Linear program. We use a relaxation technique and heuristics to find an efficient solution within 10% of the optimal one in a fast way. We also show that when we code the data, the problem can be formulated using a linear program, which can be computed very fast. Our simulation results show that our optimization framework saves about 40%-90% of the energy consumed by the traditional non-energy aware shortest path routing method.