Want to subscribe to topics you're interested in?
Become a Member

Nginx How to add rtmp module

Discussion in 'Install & Upgrades or Pre-Install Questions' started by EckyBrazzz, Oct 6, 2019.

  1. EckyBrazzz

    EckyBrazzz Active Member

    699
    139
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +258
    Local Time:
    11:34 AM
    1.17.x Cluster
    10.3.x Cluster & Redis
    Hi,

    I need this on my server for a site with live streaming
    arut/nginx-rtmp-module

    Already have the part with RED5 and the JAVA working, installed ffmpeg only missing this little part. Wowza is Payed, and I like the free GitHub stuff the like RED5-Server.

    But I don't know how it will interfere with centmin.

    Or better setup a separate server for it.

    Maybe a better question was how to set up what you want that is on NGINX 3rd Party Modules | NGINX
     
  2. EckyBrazzz

    EckyBrazzz Active Member

    699
    139
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +258
    Local Time:
    11:34 AM
    1.17.x Cluster
    10.3.x Cluster & Redis
    This one is resolved, but still want to add some other modules
    NGINX_RTMP='n' # Nginx RTMP Module support arut/nginx-rtmp-module
     
  3. eva2000

    eva2000 Administrator Staff Member

    41,723
    9,395
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,431
    Local Time:
    12:34 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    see Beta Branch - add NGINX_VIDEO control variable in 123.09beta01
     
  4. eva2000

    eva2000 Administrator Staff Member

    41,723
    9,395
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,431
    Local Time:
    12:34 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    If you need to custom add additional modules not supported by Centmin Mod Nginx read below. But first check with Centmin Mod 123.09beta01 as it has added variable support for other Nginx modules similar to above MP4 module via NGINX_MP4 that you can enable and recompile Nginx with. 123.09beta01 change log and centmin.sh list of variables you can place in the persistent config file at /etc/centminmod/custom_config.inc.

    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.

    Another example below. Actual Github commits for adding 3 new Centmin Mod Nginx modules, echo-nginx-module, set-misc-nginx-module and ngx_devel_kit 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 3 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 only if NGINX_OPENRESTY='y'
    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 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/[email protected] · 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.
     
  5. EckyBrazzz

    EckyBrazzz Active Member

    699
    139
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +258
    Local Time:
    11:34 AM
    1.17.x Cluster
    10.3.x Cluster & Redis
    @eva2000 Guess there is something wrong. I can't downgrade to 1.17.3, missing my nginx data in netdata, see Nginx - Nginx - Perfect install for netdata (system monitor) - Step by step

    I guess this has to do with the kernel
    Code (Text):
    uname  -r
    5.3.2-1.el7.elrepo.x86_64

    This because I have the same issue is on several servers

    You have mail

     
    Last edited: Oct 7, 2019
  6. eva2000

    eva2000 Administrator Staff Member

    41,723
    9,395
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,431
    Local Time:
    12:34 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    The clue is in nginx_upgrade log you provided as per Install - Nginx - How to troubleshoot Nginx installs/upgrades
    Code (Text):
    ../http2-push-nginx-module/src/ngx_http_v2_push_module.c: In function ‘ngx_http_v2_push_above_max_pushes’:
    ../http2-push-nginx-module/src/ngx_http_v2_push_module.c:685:1: error: control reaches end of non-void function [-Werror=return-type]
     }
     ^
    cc1: all warnings being treated as errors
    make[1]: *** [objs/addon/src/ngx_http_v2_push_module.o] Error 1
    make[1]: *** Waiting for unfinished jobs....
    make[1]: Leaving directory `/svr-setup/nginx-1.17.3'
    make: *** [build] Error 2
    
    real    0m53.892s
    user    2m10.284s
    sys    0m45.151s
    
    Sun Oct  6 19:40:06 UTC 2019
    Error: 2, Nginx make failed
    
    report errors on the forums at community.centminmod.com/forums/8/
    with info asked at community.centminmod.com/threads/17778/

    you're enabling Nginx optional persistent config file /etc/centminmod/custom_config.inc options which are not compatible with native Nginx HTTP/2 and HTTP/2 push - the option below is a patch to Nginx by 3rd parties (Cloudflare) before Nginx officially had HTTP/2 push support which was released in Nginx 1.13.9 Nginx - Nginx HTTP/2 Server Push Finally Supported
    Code (Text):
    NGINX_HTTPPUSH='y'              # Nginx http/2 push patch [URL]https://community.centminmod.com/threads/11910/[/URL]
    

    Centmin Mod defaults to NGINX_HTTPPUSH='n' as it's no longer needed due to Nginx 1.13.9 and newer having native HTTP/2 Push support.

    To troubleshoot future Nginx and PHP-FPM compile issues, it's best to have a clean persistent config file /etc/centminmod/custom_config.inc version to re-test against your custom persistent config file /etc/centminmod/custom_config.inc and systematically rule out which option maybe incorrectly enabled.
     
  7. EckyBrazzz

    EckyBrazzz Active Member

    699
    139
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +258
    Local Time:
    11:34 AM
    1.17.x Cluster
    10.3.x Cluster & Redis
    Hi,

    The NGINX_HTTPPUSH='y' I only had on 01 server, and still no go on the video and netdata issue.

    As already told. Guess it is the kernel so went back to
    Code (Text):
    uname -r
    3.10.0-1062.1.2.el7.x86_64
    

    Changed NGINX_IOURING_PATCH='n'

    Now my nginx -V work fine. Might have a look into the new kernel. Only netdata still won't show up the nginx stats. Have to look at that part because it's in the nginx -V

    Code (Text):
    curl http://localhost/stub_status
    curl: (52) Empty reply from server
    




    I'm not longer @ DO where I also had netdata after reading a nice tweet.

    You can find it on Google, just Google "How x just killed our company x. A long thread for a very sad story"

    Had many issues with them also.
     
    Last edited: Oct 7, 2019
  8. eva2000

    eva2000 Administrator Staff Member

    41,723
    9,395
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,431
    Local Time:
    12:34 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    tried with mod_security disabled ? anyway netdata is something left to you to figure out as you best know how you installed and configured it in the first place.

    my site at https://geoip.centminmod.com/ runs with linux 5.x kernel with CentOS 7 and Centmin Mod 12.09beta01 Nginx 1.17.4 and compiles fine on Upcloud 1 cpu KVM VPS
    persistent config file /etc/centminmod/custom_config.inc with
    Code (Text):
    NGINX_IOURING_PATCH='y'
    LETSENCRYPT_DETECT='y'
    DUALCERTS='y'
    PHP_PGO='y'
    PHP_PGO_ALWAYS='y'
    MARCH_TARGETNATIVE='n'
    NGINX_GEOIPTWOLITE='y'
    NGXDYNAMIC_GEOIPTWOLITE='y'
    NGINX_DYNAMICTLS='y'
    

    Code (Text):
    uname -r; cat /etc/redhat-release ; cat /etc/centminmod-release
    5.3.4-1.el7.elrepo.x86_64
    CentOS Linux release 7.7.1908 (Core)
    123.09beta01.b290
    
     
  9. eva2000

    eva2000 Administrator Staff Member

    41,723
    9,395
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,431
    Local Time:
    12:34 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    FYI, unless you modified Centmin Mod Nginx's default, the Nginx status stats are at /nginx_status
    Code (Text):
    curl -s localhost/nginx_status     
    Active connections: 1 
    server accepts handled requests
     30 30 32 
    Reading: 0 Writing: 1 Waiting: 0 
    
     
  10. EckyBrazzz

    EckyBrazzz Active Member

    699
    139
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +258
    Local Time:
    11:34 AM
    1.17.x Cluster
    10.3.x Cluster & Redis
    It was working on all servers, suddenly stopped. Noticed on a new server that the nginx_status was already inside the default config. So NO, no need to change it.
     
  11. EckyBrazzz

    EckyBrazzz Active Member

    699
    139
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +258
    Local Time:
    11:34 AM
    1.17.x Cluster
    10.3.x Cluster & Redis
    Yeap, have to update the manual about netdata, made a little mistake there.

    Code (Text):
    curl -s localhost/nginx_status    
    Active connections: 2
    server accepts handled requests
     7684 7684 50660
    Reading: 0 Writing: 1 Waiting: 1
    

    Project_CMM_7321.png
     
    Last edited: Oct 8, 2019
    • Informative Informative x 1
  12. eva2000

    eva2000 Administrator Staff Member

    41,723
    9,395
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,431
    Local Time:
    12:34 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    (y):D Glad to hear :)