configure Apache24 for ubuntu 13.10 and higher

configured apache2.4 for ubuntu 13.10 and higher
also cleaned up code