Join the community today
Become a Member

Nginx unable to install brotli

Discussion in 'Install & Upgrades or Pre-Install Questions' started by narji, Oct 18, 2016.

  1. narji

    narji Member

    69
    6
    8
    Feb 4, 2016
    Ratings:
    +12
    Local Time:
    8:43 AM
    after upgrade to nginx 1.11.5 from menu centmin 4
    centos 7

    Code:
     nginx -V
    nginx version: nginx/1.11.5
    built by gcc 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC)
    built with LibreSSL 2.4.3
    TLS SNI support enabled
    configure arguments: --with-ld-opt='-lrt -ljemalloc -Wl,-z,relro -Wl,-rpath,/usr/local/lib' --with-cc-opt='-m64 -mtune=native -mfpmath=sse -g -O3 -fstack-protector-strong --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2' --sbin-path=/usr/local/sbin/nginx --conf-path=/usr/local/nginx/conf/nginx.conf --with-http_ssl_module --with-http_v2_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_sub_module --with-http_addition_module --with-http_image_filter_module=dynamic --with-http_secure_link_module --with-http_realip_module --with-http_geoip_module --with-stream_geoip_module --with-stream_realip_module --with-threads --with-stream=dynamic --with-stream_ssl_module --add-dynamic-module=../ngx-fancyindex-0.4.0 --add-module=../ngx_cache_purge-2.3 --add-module=../memc-nginx-module-0.17 --add-module=../srcache-nginx-module-0.31 --add-module=../ngx_devel_kit-0.3.0 --add-module=../set-misc-nginx-module-0.31 --add-module=../echo-nginx-module-0.60 --add-module=../redis2-nginx-module-0.13 --add-module=../ngx_http_redis-0.3.7 --add-module=../nginx-module-vts --add-module=../headers-more-nginx-module-0.31 --with-openssl=../libressl-2.4.3 --with-libatomic --with-pcre=../pcre-8.39 --with-pcre-jit
    no brotli module with nginx

    custom_config.inc
    Code:
    LETSENCRYPT_DETECT='y'
    # LibreSSL
    LIBRESSL_SWITCH='y'        # if set to 'y' it overrides OpenSSL as the default static compiled option for Nginx server
    LIBRESSL_VERSION='2.4.3'   # Use this version of LibreSSL http://www.libressl.org/
    NGXMODULE_ALTORDER='y'
    NGXDYNAMIC_BROTLI='y'
    NGINX_LIBBROTLI='y'
    CLANG='n'
    PHP_PGO='y'
    PHPPGO_INDEXPATH='/home/nginx/domains/my domain/public/index.php'
    NGINX_DEVTOOLSETGCC='y'
    GENERAL_DEVTOOLSETGCC='y'
    please help

    regards
     
    Last edited: Oct 18, 2016
  2. eva2000

    eva2000 Administrator Staff Member

    29,031
    6,589
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,782
    Local Time:
    11:43 AM
    Nginx 1.13.x
    MariaDB 5.5
  3. eva2000

    eva2000 Administrator Staff Member

    29,031
    6,589
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,782
    Local Time:
    11:43 AM
    Nginx 1.13.x
    MariaDB 5.5
    To troubleshoot, you need to check the the nginx upgrade log at /root/centminlogs and instructions under Sharing logs and errors heading for using Pastebin.com or Gists to share a sanitised version of the contents of the nginx_upgrade.log log. You can see full details at How to troubleshoot Centmin Mod initial install issues

    also what's output of
    Code (Text):
    nginx -t

    when you run centmin.sh menu option 4 there's a nginx upgrade log timestamped at /root/centminlogs

    if you type this command it lists all logs in date ascending order so latest log at bottom
    Code (Text):
    ls -lArt /root/centminlogs

    so copy the entire contents of latest nginx_upgrade log to gist.github.com or pastebin.com

    you can use grep to filter the logs, i.e. look for nginx_upgrade in log name
    Code (Text):
    ls -lahrt /root/centminlogs/ | grep nginx_upgrade
    -rw-r--r--  1 root root 3.2M Oct 11 15:55 centminmod_1.2.3-eva2000.09.001_111016-155345_nginx_upgrade.log
    -rw-r--r--  1 root root 672K Oct 11 22:06 centminmod_1.2.3-eva2000.09.001_111016-220515_nginx_upgrade.log

    So the last nginx upgrade log was named centminmod_1.2.3-eva2000.09.001_111016-220515_nginx_upgrade.log and located at /root/centminlogs/centminmod_1.2.3-eva2000.09.001_111016-220515_nginx_upgrade.log
    then use cat command to output the contents of that log

    clear your ssh window buffer/screen and type
    Code (Text):
    cat /root/centminlogs/centminmod_1.2.3-eva2000.09.001_111016-220515_nginx_upgrade.log

    then select and copy and paste output to pastebin.com or gist.github.com file to share

    so only need content of one specific log, in this case most recent nginx_upgrade.log log
     
  4. eva2000

    eva2000 Administrator Staff Member

    29,031
    6,589
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,782
    Local Time:
    11:43 AM
    Nginx 1.13.x
    MariaDB 5.5
    fyi, ngx_brotli is only available in 123.09beta01 and not 123.08stable
     
  5. narji

    narji Member

    69
    6
    8
    Feb 4, 2016
    Ratings:
    +12
    Local Time:
    8:43 AM
    trying to restart with service nginx restart
    failed
    Code:
    systemctl status nginx.service
         Docs: man:systemd-sysv-generator(8)
      Process: 31421 ExecStart=/etc/rc.d/init.d/nginx start (code=exited, status=1/FAILURE)
     Main PID: 6997 (code=exited, status=0/SUCCESS)
    ● nginx.service - SYSV: Nginx is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3 proxy server
       Loaded: loaded (/etc/rc.d/init.d/nginx)
       Active: failed (Result: exit-code) since Mon 2016-10-17 22:42:18 WIB; 4min 11s ago
         Docs: man:systemd-sysv-generator(8)
      Process: 31421 ExecStart=/etc/rc.d/init.d/nginx start (code=exited, status=1/FAILURE)
     Main PID: 6997 (code=exited, status=0/SUCCESS)
    
    systemd[1]: Starting SYSV: Nginx is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3 proxy server...
    
    nginx[31421]: Starting nginx: nginx: [emerg] unknown directive "brotli" in /usr/local/nginx/conf/brotli_inc.conf:1
    
    nginx[31421]: [FAILED]
    
    systemd[1]: nginx.service: control process exited, code=exited status=1
    
    systemd[1]: Failed to start SYSV: Nginx is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3 proxy server.
    
    systemd[1]: Unit nginx.service entered failed state.
    
    systemd[1]: nginx.service failed.
    i'm using 123.09beta01 not 123.08stable
    previous install before upgrade to nginx 1.11.5 or nginx 1.11.4 and using clang not gcc , there is no problem
     
  6. eva2000

    eva2000 Administrator Staff Member

    29,031
    6,589
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,782
    Local Time:
    11:43 AM
    Nginx 1.13.x
    MariaDB 5.5
  7. narji

    narji Member

    69
    6
    8
    Feb 4, 2016
    Ratings:
    +12
    Local Time:
    8:43 AM
  8. eva2000

    eva2000 Administrator Staff Member

    29,031
    6,589
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,782
    Local Time:
    11:43 AM
    Nginx 1.13.x
    MariaDB 5.5
    looks like persistent config variables didn't get detected did you edit right file at /etc/centminmod/custom_config.inc and before running centmin.sh. Has to be before running centmin.sh not after.
     
  9. narji

    narji Member

    69
    6
    8
    Feb 4, 2016
    Ratings:
    +12
    Local Time:
    8:43 AM
    yes i did
    this third times running upgrade from centmin menu 4
    i try to change
    NGXDYNAMIC_BROTLI='n' and combine with NGINX_LIBBROTLI='y'
    and change back again

    Code:
    LETSENCRYPT_DETECT='y'
    # LibreSSL
    LIBRESSL_SWITCH='y'        # if set to 'y' it overrides OpenSSL as the default static compiled option for Nginx server
    LIBRESSL_VERSION='2.4.3'   # Use this version of LibreSSL http://www.libressl.org/
    NGXMODULE_ALTORDER='y'
    NGXDYNAMIC_BROTLI='y'
    NGINX_LIBBROTLI='y'
    CLANG='n'
    PHP_PGO='y'
    PHPPGO_INDEXPATH='/home/nginx/domains/my domain/public/index.php'
    NGINX_DEVTOOLSETGCC='y'
    GENERAL_DEVTOOLSETGCC='y'
     
  10. eva2000

    eva2000 Administrator Staff Member

    29,031
    6,589
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,782
    Local Time:
    11:43 AM
    Nginx 1.13.x
    MariaDB 5.5
    strange as those variables aren't being detected i.e. NGXMODULE_ALTORDER='y' is already default for 123.09beta01, so when nginx compile, the log should have mention of the words

    Code (Text):
    nginx configure options (alternate ordering):


    but searching the posted log, there is no mention and NGINX_DEVTOOLSETGCC='y' will switch GCC version compiler from 4.8.5 to 4.9.2 in CentOS 7 but your nginx -V output shows 4.8.5, meaning /etc/centminmod/custom_config.inc wasn't detected. Which means likely that NGXDYNAMIC_BROTLI='y' and NGINX_LIBBROTLI='y' weren't detected either

    what do you get for output of these commands

    Code (Text):
    cd /usr/local/src/centminmod
    git stash
    git pull
    

    and
    Code (Text):
    grep -Ro 'NGINX_LIBBROTLI' /etc/centminmod /usr/local/src/centminmod | uniq
     
  11. narji

    narji Member

    69
    6
    8
    Feb 4, 2016
    Ratings:
    +12
    Local Time:
    8:43 AM
    Code:
    cd /usr/local/src/centminmod
    git stash
    No local changes to save
    git pull
    Already up-to-date.
    
    grep -Ro 'NGINX_LIBBROTLI' /etc/centminmod /usr/local/src/centminmod | uniq
    
    /etc/centminmod/custom_config.inc:NGINX_LIBBROTLI
    /usr/local/src/centminmod/installer-latest-gitlab.sh:NGINX_LIBBROTLI
    /usr/local/src/centminmod/tools/nginxupdate.sh:NGINX_LIBBROTLI
    /usr/local/src/centminmod/example/custom_config.inc:NGINX_LIBBROTLI
    /usr/local/src/centminmod/installer-latest.sh:NGINX_LIBBROTLI
    /usr/local/src/centminmod/centmin.sh:NGINX_LIBBROTLI
    /usr/local/src/centminmod/inc/nginx_configure.inc:NGINX_LIBBROTLI
    /usr/local/src/centminmod/inc/brotli.inc:NGINX_LIBBROTLI
    
    try to edit custom_config.inc
    with adding #
    #NGXDYNAMIC_BROTLI='n'
    #NGINX_LIBBROTLI='y'
    then upgrade again with centmin menu 4

    nprestart
    Code:
    systemctl status nginx.service
    ● nginx.service - SYSV: Nginx is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3 proxy server
       Loaded: loaded (/etc/rc.d/init.d/nginx)
       Active: failed (Result: exit-code) since Mon 2016-10-17 23:29:02 WIB; 8min ago
         Docs: man:systemd-sysv-generator(8)
      Process: 16579 ExecStart=/etc/rc.d/init.d/nginx start (code=exited, status=1/FAILURE)
     Main PID: 6997 (code=exited, status=0/SUCCESS)
    
    systemd[1]: Starting SYSV: Nginx is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3 proxy server...
    
    nginx[16579]: Starting nginx: nginx: [emerg] unknown directive "brotli" in /usr/local/nginx/conf/brotli_inc.conf:1
    nginx[16579]: [FAILED]
    systemd[1]: nginx.service: control process exited, code=exited status=1
    systemd[1]: Failed to start SYSV: Nginx is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3 proxy server.
    systemd[1]: Unit nginx.service entered failed state.
    systemd[1]: nginx.service failed.
     
    Last edited: Oct 18, 2016
  12. eva2000

    eva2000 Administrator Staff Member

    29,031
    6,589
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,782
    Local Time:
    11:43 AM
    Nginx 1.13.x
    MariaDB 5.5
    output looks good so strange indeed.

    also your nginx -V output order of modules isn't matching 123.09beta01 defined order, it looks like order from older 123.08stable. But it's definitely 123.09beta01 as nginx dynamic module support is only available in 123.09beta01. Did you previously use 123.08stable and upgraded to 123.09beta01 ?

    just did a test with 123.09beta01 and centos 7
     
  13. eva2000

    eva2000 Administrator Staff Member

    29,031
    6,589
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,782
    Local Time:
    11:43 AM
    Nginx 1.13.x
    MariaDB 5.5
    what's output for commands

    Code (Text):
    find / -type f -name "*custom_config*"
     
  14. narji

    narji Member

    69
    6
    8
    Feb 4, 2016
    Ratings:
    +12
    Local Time:
    8:43 AM
  15. narji

    narji Member

    69
    6
    8
    Feb 4, 2016
    Ratings:
    +12
    Local Time:
    8:43 AM
    Code:
    find / -type f -name "*custom_config*"
    /usr/local/src/centminmod/example/custom_config.inc
    /etc/centminmod/custom_config.inc
    
     
  16. eva2000

    eva2000 Administrator Staff Member

    29,031
    6,589
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,782
    Local Time:
    11:43 AM
    Nginx 1.13.x
    MariaDB 5.5
    everything points to correct config and 123.09beta01 just nginx -V output and nginx_upgrade log says otherwise i.e. incorrect module order and not detected persistent config variables.

    if you have more than one centmin mod server, make sure you're not editing persistent config file on one server but running centmin.sh on another server accidentally
     
  17. narji

    narji Member

    69
    6
    8
    Feb 4, 2016
    Ratings:
    +12
    Local Time:
    8:43 AM
    i just edit this custom_config.inc in directory /etc/centminmod

    not in /usr/local/src/centminmod/example/custom_config.inc
     
  18. eva2000

    eva2000 Administrator Staff Member

    29,031
    6,589
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,782
    Local Time:
    11:43 AM
    Nginx 1.13.x
    MariaDB 5.5
    yes that is correct

    for now to start nginx just change in nginx.conf the include file from

    Code (Text):
     include /usr/local/nginx/conf/brotli_inc.conf;

    to
    Code (Text):
     #include /usr/local/nginx/conf/brotli_inc.conf;

    keeping the single space format for the front of the line as centmin needs to be able to comment or uncomment the line when needed

    then restart nginx

    there's nothing i can see that would cause this besides my suspicions that either custom_config.inc edited isn't correct one (you can confirm by typing in ssh = customconfig - it is command shortcut to launch nano text editor for persistent config file). But doesn't explain the nginx module ordering not matching 123.09beta01 order of nginx modules
     
    Last edited: Oct 18, 2016
  19. eva2000

    eva2000 Administrator Staff Member

    29,031
    6,589
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,782
    Local Time:
    11:43 AM
    Nginx 1.13.x
    MariaDB 5.5
    try changing /etc/centminmod/custom_config.inc persistent config file to
    Code (Text):
    LETSENCRYPT_DETECT='y'
    LIBRESSL_SWITCH='y'        # if set to 'y' it overrides OpenSSL as the default static compiled option for Nginx server
    NGXDYNAMIC_BROTLI='y'
    NGINX_LIBBROTLI='y'
    CLANG='n'
    PHP_PGO='y'
    NGINX_DEVTOOLSETGCC='y'
    GENERAL_DEVTOOLSETGCC='y'

    And recompile nginx via centmin.sh menu option 4
     
  20. narji

    narji Member

    69
    6
    8
    Feb 4, 2016
    Ratings:
    +12
    Local Time:
    8:43 AM
    customconfig from ssh
    Code:
    #LETSENCRYPT_DETECT='y'
    # LibreSSL
    #LIBRESSL_SWITCH='y'        # if set to 'y' it overrides OpenSSL as the default static compiled option for Nginx server
    #LIBRESSL_VERSION='2.4.3'   # Use this version of LibreSSL http://www.libressl.org/
    #NGXMODULE_ALTORDER='y'
    #NGXDYNAMIC_BROTLI='y'
    #NGINX_LIBBROTLI='y'
    #CLANG='n'
    #PHP_PGO='y'
    #PHPPGO_INDEXPATH='/home/nginx/domains/my domain/public/index.php'
    #NGINX_DEVTOOLSETGCC='y'
    #GENERAL_DEVTOOLSETGCC='y'
    LETSENCRYPT_DETECT='y'
    LIBRESSL_SWITCH='y'        # if set to 'y' it overrides OpenSSL as the default static compiled option for Nginx server
    NGXDYNAMIC_BROTLI='y'
    NGINX_LIBBROTLI='y'
    CLANG='n'
    PHP_PGO='y'
    NGINX_DEVTOOLSETGCC='y'
    GENERAL_DEVTOOLSETGCC='y'
    upgrade again from centmin menu 4

    Code:
    nginx -V
    nginx version: nginx/1.11.5
    built by gcc 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC)
    built with LibreSSL 2.4.3
    TLS SNI support enabled
    configure arguments: --with-ld-opt='-lrt -ljemalloc -Wl,-z,relro -Wl,-rpath,/usr/local/lib' --with-cc-opt='-m64 -mtune=native -mfpmath=sse -g -O3 -fstack-protector-strong --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2' --sbin-path=/usr/local/sbin/nginx --conf-path=/usr/local/nginx/conf/nginx.conf --with-http_stub_status_module --with-http_secure_link_module --add-module=../nginx-module-vts --with-libatomic --with-http_gzip_static_module --with-http_sub_module --with-http_addition_module --with-http_image_filter_module=dynamic --with-http_geoip_module --with-stream_geoip_module --with-stream_realip_module --with-threads --with-stream=dynamic --with-stream_ssl_module --with-http_realip_module --add-dynamic-module=../ngx-fancyindex-0.4.0 --add-module=../ngx_cache_purge-2.3 --add-module=../ngx_devel_kit-0.3.0 --add-module=../set-misc-nginx-module-0.31 --add-module=../echo-nginx-module-0.60 --add-module=../redis2-nginx-module-0.13 --add-module=../ngx_http_redis-0.3.7 --add-module=../memc-nginx-module-0.17 --add-module=../srcache-nginx-module-0.31 --add-module=../headers-more-nginx-module-0.31 --with-pcre=../pcre-8.39 --with-pcre-jit --with-http_ssl_module --with-http_v2_module --with-openssl=../libressl-2.4.3
    still no brotli module and edit nginx.conf adding comment #include /usr/local/nginx/conf/brotli_inc.conf;
    nprestart