Skip to content

Instantly share code, notes, and snippets.

@woss
Last active August 29, 2015 14:01
Show Gist options
  • Save woss/d464d99d55122c9f1e34 to your computer and use it in GitHub Desktop.
Save woss/d464d99d55122c9f1e34 to your computer and use it in GitHub Desktop.
#!/bin/sh -x -v
for i in "$@"
do
case $i in
-key=*|--license-key=*)
YOURLICENSEKEY="${i#*=}"
;;
-app=*|--app-name=*)
APP_NAME="${i#*=}"
;;
esac
done
wget -O - http://download.newrelic.com/548C16BF.gpg | sudo apt-key add -
sudo sh -c 'echo "deb http://apt.newrelic.com/debian/ newrelic non-free" > /etc/apt/sources.list.d/newrelic.list'
sudo apt-get update
sudo apt-get install -y -q newrelic-php5 newrelic-sysmond
sudo newrelic-install install
sed -i.bak 's/newrelic\.license \= \"\"/newrelic\.license \= \"'$YOURLICENSEKEY'\"/g' /etc/php5/conf.d/newrelic.ini
sed -i.bak 's/;newrelic\.appname \= \"PHP Application\"/newrelic\.appname \= \"'$APP_NAME'\"/g' /etc/php5/conf.d/newrelic.ini
nrsysmond-config --set license_key=$YOURLICENSEKEY
/etc/init.d/newrelic-sysmond start
/etc/init.d/apache2 reload
@woss
Copy link
Author

woss commented May 8, 2014

execute script like this:
curl https://gist.githubusercontent.com/woss/d464d99d55122c9f1e34/raw/install-newrelic > newrelic-installer.sh && sh newrelic-installer.sh --key=YOUR_KEY --app=NAME_OF_YOUR_APP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment