Shared Hosting for Everyone, imagined by developers, for developers.
Discovering the Public CloudNew Relic monitors the applications and helps to optimize them. It offers agents in a number of languages and here we will present the steps needed to install the PHP and Python agents.
In our example, we use the SSH access and consider the following information:
foo
[foo]
, [newrelic-last-version]
, [version]
et REPLACE_WITH_LICENSE_KEY
must be replaced by accurate informations.
Given the specificities of our infrastructure, their installation script cannot be used on our servers, so here are the steps to follow.
$HOME/newrelic/
foo@ssh:~/newrelic$ wget -O- https://download.newrelic.com/php_agent/release/<newrelic-last-version>-linux.tar.gz | tar -xz --strip-components=1
Add to php.ini
(Environment > PHP):
extension = /home/[foo]/newrelic/agent/x64/newrelic-[version].so
newrelic.license = "REPLACE_WITH_REAL_KEY"
newrelic.enabled = true
newrelic.loglevel = "info"
newrelic.logfile = "/home/[foo]/newrelic/php_agent.log"
More options are available from file /home/[foo]/newrelic/scripts/newrelic.ini.template
.
Create a service with the following details:
/home/[foo]/newrelic/daemon/newrelic-daemon.x64 -f --logfile /home/[foo]/newrelic/daemon/log
/home/[foo]/newrelic
foo@ssh:~/newrelic$ wget -O- https://download.newrelic.com/php_agent/release/<newrelic-last-version>-linux.tar.gz | tar -xz --strip-components=1
Add to php.ini
(Environment > PHP):
extension = /home/[foo]/newrelic/agent/x64/newrelic-[version].so
newrelic.license = "REPLACE_WITH_REAL_KEY"
newrelic.enabled = true
newrelic.loglevel = "info"
newrelic.logfile = "/home/[foo]/newrelic/php_agent.log"
newrelic.daemon.location="/home/[foo]/newrelic/daemon/newrelic-daemon.x64"
More options are available from file /home/[foo]/newrelic/scripts/newrelic.ini.template
.
New Relic is a Python module to be installed as other ones. If the application uses a virtualenv
, New Relic will need to be installed at its level.
foo@ssh:~$ python -m pip install newrelic
foo@ssh:~$ newrelic-admin generate-config REPLACE_WITH_LICENSE_KEY newrelic.ini
Add to the .py
application file:
import newrelic.agent
newrelic.agent.initialize('/home/[foo]/newrelic.ini')