Skip to content

Instantly share code, notes, and snippets.

@nrshrivatsan
Last active December 5, 2016 05:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nrshrivatsan/4a1c288801a00e173bd9 to your computer and use it in GitHub Desktop.
Save nrshrivatsan/4a1c288801a00e173bd9 to your computer and use it in GitHub Desktop.
Ubuntu Kill nginx + Start Apache 2
# ubuntu 14.01 comes with nginx I guess.For simple testing purposes I use apache2.
########################################################
# Assumption
# - nginx & apache2 have already been installed on ubuntu 14.04
# Goal
# - Kill nginx and start apache2
#############################################################################################################
# The following single line command does the following
#============================================================================================================
sudo nginx -s stop | ps -ef | grep nginx | awk {'print $2'} | xargs sudo kill -9 | sudo service apache2 start
#============================================================================================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment