Skip to content

Instantly share code, notes, and snippets.

@aqidd
Created November 26, 2016 15:30
Show Gist options
  • Save aqidd/f1984e1aa09e3eb179faaeb269522485 to your computer and use it in GitHub Desktop.
Save aqidd/f1984e1aa09e3eb179faaeb269522485 to your computer and use it in GitHub Desktop.
installing new relic for your server and PHP app
#!/bin/bash
license_key=$1
if [[ -n "$license_key" ]]; then
echo "Installing newrelic..."
else
echo "no license key. please add license key as parameter"
exit 1
fi
#steps to install newrelic server
echo "Installing newrelic server..."
echo 'deb http://apt.newrelic.com/debian/ newrelic non-free' | sudo tee /etc/apt/sources.list.d/newrelic.list
sudowget -O - https://download.newrelic.com/548C16BF.gpg | sudo apt-key add -
sudo apt-get update
sudo apt-get install newrelic-sysmond
sudo nrsysmond-config --set license_key=license_key
sudo systemctl start newrelic-sysmond
sudo /etc/init.d/newrelic-sysmond start
#steps to install newrelic apm
echo "Installing newrelic apm..."
sudo wget -O - https://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 newrelic-php5
sudo newrelic-install install
#Add your license key to the file you've set up with your New Relic properties: newrelic.ini or php.ini.
#setup per-directory monitoring
#https://docs.newrelic.com/docs/agents/php-agent/configuration/php-directory-ini-settings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment