If you are using lighttpd to host several php applications via virtual hosts and are using the newrelic php monitoring service then you’ll have noticed that setting the php application name per virtual host does not seem possible at first.
I was able to workaround the problem by using the pecl htscanner package. It scans for .htaccess files in your applications directory and imports their settings into you php application.
- install the htscanner extension (usually something like
sudo pecl install htscanner)
- configure the extension
- restart lighttpd
- create an
.htaccessfile in your virtual hosts directories
php_value newrelic.appname "myapp.example.com"
Example htscanner configuration
This file usually goes to
[htscanner] extension="htscanner.so" config_file=".htaccess" default_docroot="/" default_ttl=300 stop_on_error = 0 verbose = 0