fixing order of tasks in apache and adding correct restarts for nginx