Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
litespeed_wiki:php:new_relic [2014/03/25 14:21]
Kevin Fwu
litespeed_wiki:php:new_relic [2020/12/01 04:30] (current)
Eric Leu
Line 1: Line 1:
-==== Litespeed Web Server New Relic Installation Guide ====+==== Litespeed Web Server New Relic Installation Guide(PHP Monitoring) ​====
  
-=== Notes before we begin: === +=== Step 1PHP agent installation=== 
-  * In this example, we used the tarball installation (v4.6.5.40),​ not the Ubuntu/​Debian nor the RedHat/​CentOS ​installation,​ so the steps may be different on those installations. +  * Red Hat/CentOS:
-  * We used PHP v5.4.25 installed by the Web Admin Console in its default directory. +
-  * We have LSWS installed in the default directory (/​usr/​local/​lsws). +
-  * These steps assume that you have downloaded the New Relic installation package and decompressed the tarball if you chose that method. +
-  * **If you got the installation working, but newrelic isn't recognizing any information on your web server, go to [[litespeed_wiki:php:​new_relic#​Step_3|Step 3]]** +
-  * If PHP was installed to a non-standard location (**if you installed via the Web Console, this applies to you**), then you need to do step one.  If the New Relic installation still didn't work with a standard PHP installation,​ then you might also need to do the first step.  Otherwise, you may skip it.  **For cPanel users, PHP is by default installed to /usr/local, which will be found by the install script.**+
  
-=== Step 1=== +  sudo rpm -Uvh http://yum.newrelic.com/pub/newrelic/el5/x86_64/​newrelic-repo-5-3.noarch.rpm 
-There are two ways to get the installer to recognize the PHP installation Both options are ways to get the installer to find the correct PHP installation //Please read through both and decide for yourself which is the best option.//+  yum install newrelic-php5 -y 
 +  sudo newrelic-install install
  
-  * Option 1: +  * Debian/Ubuntu:
-    - Go to the newrelic download directory and open the ''​newrelic-install''​ script in an editor. +
-    - Go to line 460 or so, there are a bunch of paths added for the script to find the PHP installation. +
-    - In a separate window, find your PHP bin path.  The default for the Web Admin compilation is ''​/usr/​local/​lsws/​lsphp5/​bin''​. +
-    - Add the path to the script, following the format of the other paths added, and save.   +
-      * i.e.''​add_to_path /​usr/​local/​lsws/​lsphp5/​bin''​ +
-  * Option 2: +
-    - Backup your local PHP binary if you have one: +
-      * ''/​usr/​local/​bin/​php''​ +
-    - Copy the lsphp5 binary into the local PHP binary'​s place. ​ The lsphp5 binary is located in the fcgi-bin sub-directory in the lsws directory. +
-      * ''/​usr/​local/​lsws/​fcgi-bin/​lsphp5''​ +
-    - Rename the lsphp5 binary to ''​php''​ to make the installer recognize the binary. ​ Now, you have two copies //of the same binary// in the following directories with their respective names: +
-      * ''/​usr/​local/​bin/​php''​ +
-      * ''/​usr/​local/​lsws/​fcgi-bin/​lsphp5''​ +
-  * After implementing one of these options, try installing New Relic via its install script. ​ If one option doesn'​t work, try the other. +
-  * **IMPORTANT:​ The installer may have recognized your //local// PHP installation and not the LSWS one.  Check to make sure that it is using the same installation as LSWS to prevent any issues that may come up.**+
  
-=== Step 2===  +  echo 'deb http://apt.newrelic.com/debian/ newrelic non-free'​ | sudo tee /​etc/​apt/​sources.list.d/​newrelic.list 
-In the lib subdirectory of your PHP installation,​ look for a newrelic.ini or php.ini file.+  wget -O- https://​download.newrelic.com/​548C16BF.gpg | sudo apt-key add - 
 +  sudo apt-get update 
 +  sudo apt-get install newrelic-php5 -y 
 +  sudo newrelic-install install
  
-i.e. ''/​usr/​local/​lsws/​lsphp5/​lib''​ +Configure your application name and New Relic license key
-  * If it exists, you likely do not need to do this step. +The installation process prompts ​for your application name and license ​keyYour license ​key appears in the account information section of Account settings.
-  * If it doesn'​t:​ +
-  - Create a ''​php.ini''​ file in that directory. +
-  - Copy the contents of the template file in the newrelic directory. ​ It should be located in the script subdirectory:​ ''​newrelic-php5-4.6.5.40-linux/​scripts/​newrelic.ini.template''  ​and paste it in the newly created php.ini file+
-  - Inside the copied template, there is a section ​for the license. ​ Paste your license ​there. +
-  * Note: I un-commented ​the commented configuration lines. ​ I'm not sure if this is a necessary step unless you want to do custom configurations for New Relic, so you can try without changing it first if you wish.+
  
-=== Step 3: ===  +=== Step 2Restart your web server and PHP service=== 
-If you run your web server in [[http://​www.litespeedtech.com/​products/​litespeed-sapi/​php/​suexec-daemon-mode|suEXEC Daemon Mode]], then you can skip this step.  If you don't, you may need to give permissions to the newrelic log directory to get it working. +  ​systemctl restart lsws 
-  ​* If you need to do this step, I did: +  ​killall lsphp
-<​code>​ > cd /var/log +
- > chmod 777 newrelic +
-</​code>​ +
-  * NOTE: If you chose to enable Daemon Mode, it took a few minutes for New Relic to work for me, so try waiting a few minutes before restarting.+
  
-=== Step 4: ===  +=== Step 3Hit PHP page===  
-Gracefully restart the server and check the phpinfo ​page (default is http://​[address]:​8088/​phpinfo.php) +Visit any PHP page to generate some traffic
-  * Search for newrelic and it should be there. ​ If not, try restarting the New Relic Daemon first. ​ If that didn't work, try to enable Daemon Mode or grant permission to the log directory ([[litespeed_wiki:​php:​new_relic#​step_3|Step 3]]) +
  
-=== Step 5: === +=== Step 4Check New Relic staticsitcs=== 
 Attempt to connect to the application on the New Relic account page, and it should be working. Attempt to connect to the application on the New Relic account page, and it should be working.
 +
  • Admin
  • Last modified: 2014/03/25 14:21
  • by Kevin Fwu