Skip to content

Instantly share code, notes, and snippets.

@jentanbernardus
Forked from pangkalizer/newrelic php config
Created April 22, 2016 12:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jentanbernardus/a5a9045cc15e068613a31e51783b1c06 to your computer and use it in GitHub Desktop.
Save jentanbernardus/a5a9045cc15e068613a31e51783b1c06 to your computer and use it in GitHub Desktop.
# need to be run as root
# Add NewRelic repo
wget -O - https://download.newrelic.com/548C16BF.gpg | sudo apt-key add -
# sure the new repo on the list
# /etc/apt/sources.list.d/newrelic.list and set it to contain the line:
deb http://apt.newrelic.com/debian/ newrelic non-free
apt-get update
# install newrelic-agent for php
apt-get install newrelic-php5
newrelic-install install # (type in 56369fcf27cde80124b486e6515f0956783f2f9c the license key on the prompt)
# single PHP application on server
# change global newrelic.appname in /etc/php5/fpm/conf.d/newrelic.ini
vi /etc/php5/fpm/conf.d/newrelic.ini
# multiple PHP application on server (nginx/php-fpm combo)
# we can just use nginx in-directory settings
# https://docs.newrelic.com/docs/php/per-directory-settings
# edit individual nginx config
location / {
fastcgi_param PHP_VALUE "newrelic.appname=Application Name";
...
}
# restart php-fpm
/etc/init.d/php5-fpm stop && sleep 1 && /etc/init.d/php5-fpm start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment