Install apache if install_apache flag is true.
Removed trailing whitespaces and fixed other code formatting issues.