### shutdown apache2
echo;echo "Stopping apache2 to setup nginx...";sleep 3
systemctl stop apache2
-
+# Make sure apache2 is dead just in case.
+echo;echo killing apache2 processes just in case...
+sleep 3
+ps -ef | grep apache2 | grep -v grep | awk '{print $2}' | xargs kill
+if ps -ef | grep apache2
+then
+ echo;echo
+ echo "apache2 processes are still running please kill them manually"
+ read -p "Press [Enter] to continue after you have killed the processes" ENTER
+fi
### Install nginx
$APT_TOOL install -y nginx