I think these resources address the first part of the question: beer was not widely drunk to avoid water-borne diseases
That being said, none of the threads address the sources of potable water in Islamic nations, so that part of the question is still fair game!