Is there a guide to install new relic with multiple application per domain?

Hi,
I have a server that host mutliple domains having multiple PHP version as FCGId (run as virtual server owner). I am require to install new relic with infrastructure agent and php agent in it.

All went good, but i am not able to change PHP Application name per domain and i don’t why its not working. I can see there is /home/mydomain/etc/php.ini per domain and i added newrelic.appname = "mydomain.com.au" but is not working.

Any help will be much appreciated,
Thank you,
Anill

Have you seen this link for installing PHP agent in a shared hosting environment?

https://docs.newrelic.com/docs/agents/php-agent/installation/install-php-agent-shared-hosting-service

The following is from that URL. This would be good advice to follow even for seeking assistance on the Virtualmin forums:

If your system meets New Relic’s compatibility requirements but your installation is unsuccessful, gather the following information:
*Exact steps you tried
*Results, including success or failure messages
*Your operating system and version (for example, Ubuntu Linux version 12.04 64-bit)
*Your hosting service provider and subscription level

Thanks for your reply,

I am able to follow their installation steps. They suggest to add php_value in php configuration which i am unsure where to put it.

For example, I have a screenshot of Plesk which is similar to Virtualmin has a settings page where one can put php_value,

But I am unable to find this type of place to add php_value in per domain in virtualmin.

This is Virtualmin -> Services -> PHP Configuration

The ‘Edit Configuration Manually’ button might let you do what you want.

or the ‘Show Directives’ button via Virtualmin -> Services -> Configure Website

So did you mean like this in Configure website ?

It is still not working. Do you think it is because of PHP Admin Configuration values are set engine off?

Are your PHP installations listed as PHP-FPM in the Dashboard/Servers Status section?

If so try this: Make sure the correct host is active in Virtualmin and from the menu select Services/PHP-FPM Configuration, then Edit Configuration Manually to edit the PHP-FPM pool file. Add the php_value at the bottom of that file. Then back to the Servers Status dashboard section and restart the PHP-FPM service for the version you’re working with. Restart Apache too.

I wish I had this option in my servers. There is one server with FPM (run as virtual server owner) option in Website Options but other 3 don’t have this. And also I am using this option if that’s what you are asking as PHP-FPM. There is no PHP-FPM in Dashboard/Server status as well.

All my servers are using FCGId and I am so confused that php_value is not changing even if I change it in apache conf or php.ini of my apache home directory of domain.

Here is the screenshot of my phpinfo()

I’m not familiar with the newrelic app, but it’s possible it has its own custom .ini file. The first place to look is in the /etc/php5/cgi/conf.d directory.

I ran into the same problem with Wordpress and WP added it’s own php.ini file to the /home/user/etc/ directory.

I ended up doing a

$find / -name “php.ini”

to find where all the php.ini files were being placed. The $ (or # if you are root) is the command prompt from ssh or putty login.

Sorry, @stuckinthehouse. I thought I was replying to @anil3a. Time for me to call it a day.

Thanks for your replies and great effort. I really appreciate it.

As you can see the screenshot of phpinfo(); of my server, newrelic.ini is located in /etc/php5/cgi/conf.d as /etc/php5/cgi/conf.d/20-newrelic.ini file. I have renamed it to 20-newrelic.ini instead of just newrelic.ini file just like other files were. And yes, it has its own ini file but it is for global and has default appname as “PHP Application”. What i wanted to have was custom name per domain.

There is already a php.ini file per domain in virtualmin domain setup in /home/domain.com/etc/php.ini and i tried to add newrelic.appname = "domain.com" there, was no luck. I don’t know if i should create another php.ini file in public directory of the domain i.e. /home/domain.com/public_html/php.ini or should i add php_value newrelic.appname "domain.com" in .htaccess of public_html folder.

Also, maybe should i remove 20-newrelic.ini file from getting included in gobal folders and copy this filer per domain php.ini file like copying content of 20-newrelic.ini to /home/domain.com/etc/php.ini such as following when mutliple domain:

  1. copy content of 20-newrelic.ini to /home/domain1.com/etc/php.ini
  2. copy content of 20-newrelic.ini to /home/domain2.com/etc/php.ini
  3. copy content of 20-newrelic.ini to /home/domain3.com/etc/php.ini
    and delete 20-newrelic.ini file from global folder i.e. /etc/php5/cgi/conf.d/20-newrelic.ini.

Sorry, just i am just thinking and writing my opinion. I haven’t tested this. I will try these above today sometime and let you guys know.

Thank you.

Not a problem and you’re welcome. You’re obviously invested in this software, so I hope you are seeking help in the New Relic support forum where your chances of finding answers are much better.