Posted over 6 years ago. Visible to the public.

Lighttpd, newrelic php and per directory settings.

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.

  1. install the htscanner extension (usually something like sudo pecl install htscanner)
  2. configure the extension
  3. restart lighttpd
  4. create an .htaccess file in your virtual hosts directories

Example .htaccess

Copy
php_value newrelic.appname "myapp.example.com"

Example htscanner configuration

This file usually goes to /etc/php5/conf.d/htscanner.ini:

Copy
[htscanner] extension="htscanner.so" config_file=".htaccess" default_docroot="/" default_ttl=300 stop_on_error = 0 verbose = 0

Owner of this card:

Avatar
jan0sch
Last edit:
over 6 years ago
Posted by jan0sch to jan0sch's deck
This website uses cookies to improve usability and analyze traffic.
Accept or learn more