If you follow the New Relic instruction to setup the daemon. You will get all web applications as a single New Relic App named as PHP Application in the New Relic application console.
So how could we setup multiple New Relic Apps for different virtual hosts in Apache? Here you are.
1. Make sure you have enabled the Apache php5 module. If it is not enabled, enable it by the following command with root privilege.
2. For the virtual hosts which you want to enable the New Relic monitor, add the newrelic.appname in the VirtualHost file as follow.
<VirtualHost 192.168.42.43> ServerName www.myvhost1.com DocumentRoot "/path/to/vhost1/" ... #Enable New Relic monitor <IfModule php5_module> php_value newrelic.appname "Virtual Host 1" </IfModule> </VirtualHost>
3. On the other hand, if you want to disable the monitor, edit the VirtualHost as follow.
<VirtualHost 192.168.42.43> ServerName www.myvhost1.com DocumentRoot "/path/to/vhost1/" ... #Disable New Relic monitor <IfModule php5_module> php_flag newrelic.enabled off </IfModule> </VirtualHost>
4. Restart the New Relic dameon.
5. Restart the Apache.
6. Open a browser an access the websites which have New Relic monitor enabled.
7. Check your New Relic application console.
Reference: Per-directory INI Settings
5 thoughts on “New Relic – Monitor multiple web applications or virtual hosts”
Be aware they send you lots of spam
and do not give promised t-shirt
AFAIK the monitoring tool is not free
That’s not really a spam, just their sales team wanna know more detail from the user.
And i did get the T-shirt from them, it’s really nice.
Thats not true, they started calling me to try and buy their stuff. Its spam.
then i think i am lucky…