added function to restart apache2 gracefully