5s-servers-1024x598

Install newrelic nginx plugin on Ubuntu

Add nginx repository to your /etc/apt/sources.list (replace codename with your ubuntu codename ex: 14.04 – trusty ):

deb http://nginx.org/packages/ubuntu/ <i>codename</i> nginx
deb-src http://nginx.org/packages/ubuntu/ <i>codename</i> nginx

Download nginx PGP key and add it to your server (eliminate warnings about missing PGP key during installation) :

wget http://nginx.org/keys/nginx_signing.key &amp;&amp; sudo apt-key add nginx_signing.key &amp;&amp; rm nginx_signing.key

Update your repository and install the plugin :

apt-get update &amp;&amp; apt-get install nginx-nr-agent -y

Insert your newrelic licence key on your newrelic nginx plugin page:

vim /etc/nginx-nr-agent/nginx-nr-agent.ini
Find this line and replace with your licence key on your newrelic account:
newrelic_license_key=<strong>YOUR_LICENSE_KEY_HERE
</strong>    poll_interval=60

Insert this line (change to your suit, incase you haven't setup your status page i'll explain on later post):

[source2]
name=example.com
url=http://example.com/status
http_user=testuser
http_pass=testpass

And finally start your agent with : service nginx-nr-agent start