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.
a2enmod php5
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.
/etc/init.d/newrelic-daemon restart
5. Restart the Apache.
/etc/init.d/apache2 restart
6. Open a browser an access the websites which have New Relic monitor enabled.
7. Check your New Relic application console.
Image may be NSFW.
Clik here to view.
Done =)
Reference: Per-directory INI Settings
Filed under: New Relic Tagged: Apache, New Relic, PHP, VirtualHost Image may be NSFW.
Clik here to view.

Clik here to view.
