Get the most out of your Centmin Mod LEMP stack
Become a Member

Installing TraceView Agent on Centminmod

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by deltahf, Nov 19, 2017.

  1. deltahf

    deltahf Active Member

    216
    104
    43
    Jun 8, 2014
    Ratings:
    +161
    Local Time:
    4:20 AM
    I am replacing NewRelic with TraceView, and I am going through the installation process.

    However, I am a bit confused about installing the web server agent for Nginx, which asks me to just run yum install nginx. The detailed instructions can be viewed here.

    Correct me if I'm wrong, but I don't think that will work on my Centminmod server. What's the best way for me to install this? Do I need to compile from source?
     
  2. RoldanLT

    RoldanLT Well-Known Member

    3,979
    966
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,331
    Local Time:
    5:20 PM
    1.11
    10.2
    It will work as nginx module.
    --add-module=../nginx_oboe
     
  3. eva2000

    eva2000 Administrator Staff Member

    30,961
    6,918
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,419
    Local Time:
    7:20 PM
    Nginx 1.13.x
    MariaDB 5.5
    No yum install of nginx isn't required. It won't be that straight forward with Centmin Mod Nginx as you need to build/add nginx_oboe nginx module to nginx http://docs.traceview.solarwinds.com/Instrumentation/nginx.html#building-from-source which luckily is easy to adapt as Centmin Mod Nginx is build via source install so just matter of installing nginx_oboe nginx module + enabling Centmin Mod's ngx_pagespeed module and then add any nginx_oboe related directives to your nginx.conf file

    I posted an example of how to add nginx modules to Centmin Mod at centminmod.com/nginx_webdav.html for webdav prior to it becoming an official part of Centmin Mod's default module list. You can use that example to pretty much add or extend Nginx with additional modules.

    Only limitations are
    1. You need to know generally how to add Nginx modules and that is basically the same for any Nginx server not just Centmin Mod
    2. You also need to know the instructions for specific Nginx module
    3. You also need to know any prerequiste system dependencies and YUM packages that the Nginx module requires as I may not know what they are as I may have never used the Nginx module you want.
    4. I'm limited to what I can add to Centmin Mod by what I know and use usually and what I am comfortable with supporting. So that limits what officially I can add to Centmin Mod. But you are free to add whatever you need using above as a guide.
    For Centmin Mod Nginx, download tar.gz nginx modules to /svr-setup and extract and then editing inc/nginx_configure.inc just use the same --add-module=../nginx-module-name line. In Centmin Mod 123.09beta01 and higher, there's a few additional variables which allow you to add the actual nginx module configure line so it persists on centmin mod updates outlined here for DYNAMICOPT_BEGIN, DYNAMICOPT_MIDDLE, DYNAMICOPT_AFTERGZIP, and DYNAMICOPT_END.

    Posted a more recent example below. Actual Github commits for adding 4 new Centmin Mod Nginx modules, echo-nginx-module, set-misc-nginx-module, ngx_devel_kit and testcookie-nginx-module are located below (you can use these changes and webdav example as a blue print for understanding how to extend and add your own Centmin Mod Nginx modules.

    Github commits for 4 new Nginx modules

    General Info on Adding New Nginx Modules



    There's 5 basic steps involve in adding a new Nginx module into Centmin Mod Nginx server for Centmin Mod .08 beta02 and higher. They involve editing 5 Centmin Mod files.
    1. centmin.sh - add VARIABLE name to define the nginx module's version number if there is one
    2. inc/downloadlinks.inc - add 2 VARIABLES to define the module download link and filename
    3. inc/downloads.inc - add download function to download the module using download link defined in inc/downloadlinks.inc and test the download validity i.e. untar it using filename defined in inc/downloadlinks.inc
    4. inc/nginx_configure.inc - add check variables to grab latest nginx module extracted directory and put it info directory variable to be called from Nginx ./configure options
    5. inc/nginx_upgrade.inc - add to existing file check, the new module download file name (defined in inc/downloadlinks.inc). This ensures, when you run centmin.sh menu option 4 to upgrade Nginx, if the new nginx module download file doesn't exist in /svr-setup, it will download it and extract it before the Nginx compilation begins
    Another way of doing it is shown at Nginx - A straight forward tutorial to install test-cookie? | Centmin Mod Community This way doesn't allow for managing nginx module version updates and auto updates via centmin.sh menu option 4 like the above method.

    The above is for nginx modules requiring additional downloads to be configured. There's also nginx modules which do not need additional downloads but just enabling of the nginx module itself. I just added ngx_http_auth_request_module to Nginx for .08 beta 03 as it only required adding --with-http_auth_request_module to configure options. You can see the changes I did here add ngx_http_auth_request_module support · centminmod/centminmod@ec079c5 · GitHub - similar to above instructions just did not need to touch inc/downloadslinks.inc and inc/downloads.inc and inc/nginx_upgrade.inc as there are NO additional downloads to account for and check.

    Adding Nginx Dynamic Module



    Adding and switching from static to dynamic nginx module in Centmin Mod involves a few more steps. An example is switching ngx_fancyindex module from static to dynamic nginx module. The nginx module itself has to support Nginx 1.9.11+ feature for dynamic module to be able to be used as a dynamic loadable nginx module.
     
    • Informative Informative x 1
  4. eva2000

    eva2000 Administrator Staff Member

    30,961
    6,918
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,419
    Local Time:
    7:20 PM
    Nginx 1.13.x
    MariaDB 5.5
    @deltahf Just had a quick look at TraceView installation for Nginx implementation via nginx_oboe nginx module and it's quite complicated with a minor bug in their nginx_oboe config file which strips -Werror flag and thus breaks Centmin Mod Nginx recompiles via centmin.sh menu option 4 and their AppNet yum repo install might not even have CentOS/RHEL 7 support as docs only list yum repo file configs for CentOS/RHEL 5 and 6.

    I didn't get that far for AppNet yum repo install as I don't have an access key so didn't install their AppNet repo provided liboboe, liboboe-devel and tracelyzer packages. I've outlined how far I could go with Centmin Mod 123.09beta01 Nginx 1.13.6 and attempts at nginx_oboe install and AppNet yup repo setup at https://gist.github.com/centminmod/3dee1fdda49b2002361183350273077f. So maybe contact Traceview/SolarWinds support and link them to that gist to see if they have more insights for you.
     
    • Informative Informative x 1
  5. deltahf

    deltahf Active Member

    216
    104
    43
    Jun 8, 2014
    Ratings:
    +161
    Local Time:
    4:20 AM
    Thanks for looking into this, George, I had a feeling it was going to get complicated. :(

    I will definitely pass along your Gist to TraceView team. I will post again with any updates.
     
  6. deltahf

    deltahf Active Member

    216
    104
    43
    Jun 8, 2014
    Ratings:
    +161
    Local Time:
    4:20 AM
    Here's their response, which was impressive given it was on the Thanksgiving holiday here in the U.S.:

    I sent him the logs, it was full of stuff.

    But, I've had a look at AppOptics and I agree, it would probably be an even better solution for me. :) I have signed up but have had some issues during the installation process. Waiting for their support to help me figure out the problem...
     
    • Informative Informative x 1
  7. eva2000

    eva2000 Administrator Staff Member

    30,961
    6,918
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,419
    Local Time:
    7:20 PM
    Nginx 1.13.x
    MariaDB 5.5
    ah that sounds like good news to not require nginx module addition :)

    let us know how it goes :)