Learn about Centmin Mod LEMP Stack today
Become a Member

Nginx IPv6 Install

Discussion in 'Install & Upgrades or Pre-Install Questions' started by WPSparky, Mar 21, 2022.

  1. WPSparky

    WPSparky New Member

    2
    1
    3
    Mar 21, 2022
    Ratings:
    +1
    Local Time:
    3:47 PM
    Please fill in any relevant information that applies to you:
    • CentOS Version: i.e. CentOS 6 32bit or 64bit / CentOS 7 64bit ?
    • Centmin Mod Version Installed: i.e. 123.08stable or 123.09beta01
    • Nginx Version Installed: i.e. 1.15.3
    • PHP Version Installed: i.e. 5.6.37, 7.0.31, 7.1.21, 7.2.9
    • MariaDB MySQL Version Installed: i.e. 10.0.x or 10.1.xx or 10.2.xx
    • When was last time updated Centmin Mod code base ? : i.e. run centmin.sh menu option 23 submenu option 2 or cmupdate command
    • Persistent Config: Do you have any persistent config file options set in /etc/centminmod/custom_config.inc ? You can check via this command:
      Code (Text):
      cat /etc/centminmod/custom_config.inc
      

      Post output in CODE tags.

    With a fresh install, What do I need to enable in the persistent config file? IPv6only 'y' ?

     
  2. eva2000

    eva2000 Administrator Staff Member

    48,519
    11,116
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,306
    Local Time:
    5:47 AM
    Nginx 1.21.x
    MariaDB 10.x
    Nothing is needed to change on Centmin Mod if you have a IPv4 + IPv6 system by default. The persistent config file variable if set to DISABLE_IPVSIX='y' option is mainly there to disable IPv6 by default if IPv6 system is supported. If you want IPv6 supported, you don't have to set any persistent config file variables. Though Nginx IPv6 listen directives aren't setup by default for new Nginx vhosts, you have to add them yourself - see official Centmin Mod FAQ item 34 FAQ - CentminMod.com LEMP Nginx web stack for CentOS
     
  3. tininho

    tininho Active Member

    176
    39
    28
    May 22, 2019
    Ratings:
    +127
    Local Time:
    10:47 PM
    If your problem is a server with ipv6 address only, I am actually looking into this myself as well as centminmod.com (for example) is not accessible from ipv6 only server. If you have ipv4 connectivity + ipv6, then my post is irrelevant.

    So for ipv6 only server (no ipv4 address available) a NAT64 or similar service is needed. If it helps, these are the ones I am looking into currently.

    TAYGA: Bridge an IPv6 Network Back to IPv4 using NAT64 – The New Stack
    Enable IPv4 Access in EUserv IPv6-only VS2-free (yoursunny.com)
    How to get IPv4 connectivity on an IPv6 only VPS. - Sentris Network LLC
     
  4. tininho

    tininho Active Member

    176
    39
    28
    May 22, 2019
    Ratings:
    +127
    Local Time:
    10:47 PM
    Correction, only this part results in "failed: Network is unreachable" error.
    Code:
    ALTPCRELINK="${LOCALCENTMINMOD_MIRROR}/centminmodparts/pcre/${ALTPCRELINKFILE}"
     
  5. eva2000

    eva2000 Administrator Staff Member

    48,519
    11,116
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,306
    Local Time:
    5:47 AM
    Nginx 1.21.x
    MariaDB 10.x
    what's output for these commands on your IPv6 server
    Code (Text):
    curl -Iv https://centminmod.com
    

    Code (Text):
    curl -4Iv https://centminmod.com
    

    Code (Text):
    curl -6Iv https://centminmod.com
    
     
  6. tininho

    tininho Active Member

    176
    39
    28
    May 22, 2019
    Ratings:
    +127
    Local Time:
    10:47 PM
    Code (Text):
    curl -Iv https://centminmod.com

    Code (Text):
    curl -6Iv https://centminmod.com

    Same response for both
    Code:
    < HTTP/1.1 200 OK
    HTTP/1.1 200 OK
    And
    Code (Text):
    curl -4Iv https://centminmod.com

    Code:
    curl: (7) Failed to connect to 104.18.11.170: Network is unreachable
    This is on fresh Centos7 install (ipv6 only), and using custom nameservers for DNS resolution:

    Code:
    2001:67c:2b0::4: provider: trex.fi / Location: Finland (Europe)
    I did not open own thread yet, since I thought there is something wrong on my end.
     
  7. tininho

    tininho Active Member

    176
    39
    28
    May 22, 2019
    Ratings:
    +127
    Local Time:
    10:47 PM
    Code:
    FORCE_IPVFOUR='n'
    NGINX_IPV='y'
    
    This is on my custom_config, but I get stuck the same way as user atomi explains here: IPV6 only install

    So I am trying the proxy/NAT64 way with tayga/clatd/jool, but it's a work in progress, as I have to learn this stuff at the same time.

    Could it be fixed with adding ipv_forceopt='6' here (on Centminmod installer*.php)?

    Code:
    if [ -f /etc/centminmod/custom_config.inc ]; then
      source /etc/centminmod/custom_config.inc
    fi
    if [[ "$FORCE_IPVFOUR" != [yY] ]]; then
      ipv_forceopt=""
    else
      ipv_forceopt='4'
    fi
    
     
  8. eva2000

    eva2000 Administrator Staff Member

    48,519
    11,116
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,306
    Local Time:
    5:47 AM
    Nginx 1.21.x
    MariaDB 10.x
    Ah yes that would probably be the reason IPv6 only Centmin Mod isn't working for downloads. I force IPv4 where possible to reduce IPv6 connectivity issues/instability with FORCE_IPVFOUR='y' but seems FORCE_IPVFOUR='n' isn't working for the initial install unless you set it up in persistent config file /etc/centminmod/custom_config.inc BEFORE initial install - are you doing that?
     
    Last edited: Mar 29, 2022
  9. tininho

    tininho Active Member

    176
    39
    28
    May 22, 2019
    Ratings:
    +127
    Local Time:
    10:47 PM
    I've set FORCE_IPVFOUR='n' on custom_config prior to install (fresh Centos7 ipv6 only vps), and I've actually set it on installer74.sh too (changed the hard coded from 'y' -> 'n'), just to be sure.

    Somehow wget -c4 still remains:

    From Centminmod logs:
    Code:
    wget -c4 --progress=bar https://libzip.org/download/libzip-1.7.3.tar.gz --tries=3
    --2022-03-29 14:33:26--  https://libzip.org/download/libzip-1.7.3.tar.gz
    Resolving libzip.org... 5.2.73.210
    Connecting to libzip.org|5.2.73.210|:443... failed: Network is unreachable.
    
    wget -c4 https://github.com/jedisct1/libsodium/releases/download/1.0.18-RELEASE/libsodium-1.0.18.tar.gz --tries=3
    --2022-03-29 14:33:27--  https://github.com/jedisct1/libsodium/releases/download/1.0.18-RELEASE/libsodium-1.0.18.tar.gz
    Resolving github.com... 140.82.121.3
    Connecting to github.com|140.82.121.3|:443... failed: Network is unreachable.
    
    wget -c4 https://github.com/P-H-C/phc-winner-argon2/archive/refs/tags/20190702.tar.gz --tries=3
    --2022-03-29 14:33:27--  https://github.com/P-H-C/phc-winner-argon2/archive/refs/tags/20190702.tar.gz
    Resolving github.com... 140.82.121.3
    Connecting to github.com|140.82.121.3|:443... failed: Network is unreachable.
    
    wget -c4 --progress=bar https://centminmod.com/centminmodparts/pcre/pcre-8.45.tar.gz -O pcre-8.45.tar.gz --tries=3
    --2022-03-29 14:30:04--  https://centminmod.com/centminmodparts/pcre/pcre-8.45.tar.gz
    Resolving centminmod.com... 104.18.11.170, 104.18.10.170
    Connecting to centminmod.com|104.18.11.170|:443... failed: Network is unreachable.

    I can install other stacks on the same server just fine, and get a working and reachable web domain (from ipv4 desktop). Would love to have Centminmod stack, so I will continue looking into this.
     
  10. eva2000

    eva2000 Administrator Staff Member

    48,519
    11,116
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,306
    Local Time:
    5:47 AM
    Nginx 1.21.x
    MariaDB 10.x
    Might be a few hardcoded instances in there that I need to fix :oops::sorry:
     
  11. eva2000

    eva2000 Administrator Staff Member

    48,519
    11,116
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,306
    Local Time:
    5:47 AM
    Nginx 1.21.x
    MariaDB 10.x
  12. tininho

    tininho Active Member

    176
    39
    28
    May 22, 2019
    Ratings:
    +127
    Local Time:
    10:47 PM
    Nice, thank you, but there are still some problems:

    Code:
    rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm [found]
    curl: (6) Could not resolve host: apt.sw.be; Unknown error
    error: http://apt.sw.be/RPM-GPG-KEY.dag.txt: import read failed(2).
    Code:
    [1;33;40mDownload ccache-3.7.12.tar.gz ...
    (B[mInitializing download: https://centminmod.com/centminmodparts/ccache/ccache-3.7.12.tar.gz
    Unable to connect to server centminmod.com:443: Name or service not known
    Code:
    Installing nginx
    (B[m*************************************************
    [1;32;40mInstalling nginx Modules / Prerequisites...
    (B[m[1;33;40mDownload pcre-8.45.tar.gz ...
    (B[mwget -c4 --progress=bar https://centminmod.com/centminmodparts/pcre/pcre-8.45.tar.gz -O pcre-8.45.tar.gz --tries=3
    --2022-03-31 11:24:48--  https://centminmod.com/centminmodparts/pcre/pcre-8.45.tar.gz
    Resolving centminmod.com... 104.18.10.170, 104.18.11.170
    Connecting to centminmod.com|104.18.10.170|:443... failed: Network is unreachable.
    Connecting to centminmod.com|104.18.11.170|:443... failed: Network is unreachable.
    [1;32;40mError: pcre-8.45.tar.gz download failed.
    Code:
    tar (child): openssl-1.1.1n.tar.gz: Cannot open: No such file or directory
    tar (child): Error is not recoverable: exiting now
    tar: Child returned status 2
    tar: Error is not recoverable: exiting now
    inc/openssl_install.inc: line 1174: cd: /svr-setup/openssl-1.1.1n: No such file or directory
    grep: Configure: No such file or directory
    Code:
    install zstd compression
    Error: zstd-1.5.1.tar.gz not found!!!  Downloading now......
    --2022-03-31 11:26:41--  https://github.com/facebook/zstd/archive/v1.5.1.tar.gz
    Resolving github.com... 140.82.121.3
    Connecting to github.com|140.82.121.3|:443... failed: Network is unreachable.
    Full logs here:

    installer.log (github.com)
    custom_config (github.com) (I tried with only FORCE_IPVFOUR='n' also)
    nginx_upgrade.log (github.com)
     
  13. eva2000

    eva2000 Administrator Staff Member

    48,519
    11,116
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,306
    Local Time:
    5:47 AM
    Nginx 1.21.x
    MariaDB 10.x
    Ah previous fixes only handled wget, curl was overlooked. Just updated 123.09beta01 for curl related IPv4/6 fixes :)
     
  14. tininho

    tininho Active Member

    176
    39
    28
    May 22, 2019
    Ratings:
    +127
    Local Time:
    10:47 PM
    Thanks again! Nearly there? :) Nginx and PHP still does not seem to work:

    centminmod_123.09beta01.b804_010422-132541_install.log (github.com)
    centminmod_123.09beta01.b804_010422-133210_nginx_upgrade.log (github.com)
    centminmod_123.09beta01.b804_010422-133210_php_upgrade.log (github.com)
     
  15. eva2000

    eva2000 Administrator Staff Member

    48,519
    11,116
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,306
    Local Time:
    5:47 AM
    Nginx 1.21.x
    MariaDB 10.x
    Ok updated 123.09beta01 again with more fixes - this time for Axel download accelerator and reordering one wget related variable assignment :D
     
  16. tininho

    tininho Active Member

    176
    39
    28
    May 22, 2019
    Ratings:
    +127
    Local Time:
    10:47 PM
    There are some errors still, but it looks like a cleaner install this time. Nginx and PHP does not install correctly. I will post full logs tomorrow!

    Code:
    Initializing download: https://nginx.org/download/nginx-1.21.6.tar.gz
    Unable to connect to server nginx.org:443: Name or service not known
    
    --2022-04-03 17:57:31--  https://nginx.org/download/nginx-1.21.6.tar.gz
    Resolving nginx.org... 52.58.199.22, 3.125.197.172
    Connecting to nginx.org|52.58.199.22|:443... failed: Network is unreachable.
    Connecting to nginx.org|3.125.197.172|:443... failed: Network is unreachable.
    
    inc/php_upgrade.inc: line 337: php-config: command not found
    Current PHP Version:
    inc/php_upgrade.inc: line 348: php-config: command not found
    
    0curl: (7) Failed to connect to 104.18.11.170: Network is unreachable
    Error: php-7.4.26.tar.xz download failed.
     
    Last edited: Apr 4, 2022
  17. eva2000

    eva2000 Administrator Staff Member

    48,519
    11,116
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,306
    Local Time:
    5:47 AM
    Nginx 1.21.x
    MariaDB 10.x
    Overlooked one change I missed. So updated Centmin Mod 123.09beta01 again. Should cover it I believe.
     
  18. tininho

    tininho Active Member

    176
    39
    28
    May 22, 2019
    Ratings:
    +127
    Local Time:
    10:47 PM
    PHP fails:

    Code:
    /svr-setup /svr-setup/php-7.4.28/fpm-build
    [1;33;40mDownload libzip-1.7.3.tar.gz ...
    (B[mwget -c4 --progress=bar https://libzip.org/download/libzip-1.7.3.tar.gz --tries=3
    --2022-04-04 10:47:15--  https://libzip.org/download/libzip-1.7.3.tar.gz
    Resolving libzip.org... 5.2.73.210
    Connecting to libzip.org|5.2.73.210|:443... failed: Network is unreachable.
    [1;32;40mError: libzip-1.7.3.tar.gz download failed.
    (B[mtar (child): libzip-1.7.3.tar.gz: Cannot open: No such file or directory
    tar (child): Error is not recoverable: exiting now
    tar: Child returned status 2
    tar: Error is not recoverable: exiting now
    inc/libzip.inc: line 61: cd: libzip-1.7.3: No such file or directory
    CMake Error: The source directory "/svr-setup" does not appear to contain CMakeLists.txt.
    Specify --help for usage, or press the help button on the CMake GUI.
    make: *** No targets specified and no makefile found.  Stop.
    make: *** No rule to make target 'install'.  Stop.
    /svr-setup/php-7.4.28/fpm-build
    /svr-setup /svr-setup/php-7.4.28/fpm-build
    wget -c4 https://github.com/jedisct1/libsodium/releases/download/1.0.18-RELEASE/libsodium-1.0.18.tar.gz --tries=3
    --2022-04-04 10:47:15--  https://github.com/jedisct1/libsodium/releases/download/1.0.18-RELEASE/libsodium-1.0.18.tar.gz
    Resolving github.com... 140.82.121.4
    Connecting to github.com|140.82.121.4|:443... failed: Network is unreachable.
    [1;32;40mError: libsodium-1.0.18.tar.gz download failed.
    
    /svr-setup /svr-setup/php-7.4.28/fpm-build
    wget -c4 https://github.com/P-H-C/phc-winner-argon2/archive/refs/tags/20190702.tar.gz --tries=3
    --2022-04-04 10:47:15--  https://github.com/P-H-C/phc-winner-argon2/archive/refs/tags/20190702.tar.gz
    Resolving github.com... 140.82.121.4
    Connecting to github.com|140.82.121.4|:443... failed: Network is unreachable.
    [1;32;40mError: 20190702.tar.gz download failed.
    
    In file included from /svr-setup/php-7.4.28/ext/zip/php_zip.c:32:
    /svr-setup/php-7.4.28/ext/zip/php_zip.h:30:10: fatal error: zip.h: No such file or directory
       30 | #include <zip.h>
          |          ^~~~~~~
    compilation terminated.
    make: *** [Makefile:1890: ext/zip/php_zip.lo] Error 1
    make: *** Waiting for unfinished jobs....
    
    starting php-fpm /etc/init.d/php-fpm: line 69: /usr/local/sbin/php-fpm: No such file or directory
     failed
    Gracefully shutting down php-fpm kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
    ................................... failed. Use force-quit
    /usr/local/src/centminmod/tools/php-systemd.sh: line 48: php-config: command not found
    
    Nginx fails:
    Code:
    [1;32;40m* Installing nginx
    (B[m*************************************************
    [1;32;40mInstalling nginx Modules / Prerequisites...
    (B[m[1;33;40mDownload pcre-8.45.tar.gz ...
    (B[mwget -c4 --progress=bar https://centminmod.com/centminmodparts/pcre/pcre-8.45.tar.gz -O pcre-8.45.tar.gz --tries=3
    --2022-04-04 10:37:14--  https://centminmod.com/centminmodparts/pcre/pcre-8.45.tar.gz
    Resolving centminmod.com... 104.18.10.170, 104.18.11.170
    Connecting to centminmod.com|104.18.10.170|:443... failed: Network is unreachable.
    Connecting to centminmod.com|104.18.11.170|:443... failed: Network is unreachable.
    [1;32;40mError: pcre-8.45.tar.gz download failed.
    
    --2022-04-04 10:43:18--  https://github.com/coreruleset/coreruleset/archive/v3.3.2.tar.gz
    Resolving github.com... 140.82.121.3
    Connecting to github.com|140.82.121.3|:443... failed: Network is unreachable.
    tar (child): v3.3.2.tar.gz: Cannot open: No such file or directory
    tar (child): Error is not recoverable: exiting now
    
    install zstd compression
    Error: zstd-1.5.1.tar.gz not found!!!  Downloading now......
    --2022-04-04 10:45:13--  https://github.com/facebook/zstd/archive/v1.5.1.tar.gz
    Resolving github.com... 140.82.121.4
    Connecting to github.com|140.82.121.4|:443... failed: Network is unreachable.
    
    
    installer_040422-103112.log (github.com)
     
  19. tininho

    tininho Active Member

    176
    39
    28
    May 22, 2019
    Ratings:
    +127
    Local Time:
    10:47 PM
    Today Centminmod seemed to complete the installation pretty much completely. Also option 22 wordpress site install works, but I have to check you posts on ipv6 and nginx to get the conf correctly. Great work as always!
     
  20. tininho

    tininho Active Member

    176
    39
    28
    May 22, 2019
    Ratings:
    +127
    Local Time:
    10:47 PM
    Errors while installing 130.00beta01 (ipv6 only):
    Code:
    [1;32;40mInstalling nginx Modules / Prerequisites...
    (B[m[1;33;40mDownload pcre-8.45.tar.gz ...
    (B[mwget -c4 --progress=bar https://centminmod.com/centminmodparts/pcre/pcre-8.45.tar.gz -O pcre-8.45.tar.gz --tries=3
    --2022-05-13 12:49:23--  https://centminmod.com/centminmodparts/pcre/pcre-8.45.tar.gz
    Resolving centminmod.com... 104.18.11.170, 104.18.10.170
    Connecting to centminmod.com|104.18.11.170|:443... failed: Network is unreachable.
    Connecting to centminmod.com|104.18.10.170|:443... failed: Network is unreachable.
    [1;32;40mError: pcre-8.45.tar.gz download failed.
    
    Code:
    --2022-05-13 12:58:14--  https://github.com/coreruleset/coreruleset/archive/v3.3.2.tar.gz
    Resolving github.com... 140.82.121.3
    Connecting to github.com|140.82.121.3|:443... failed: Network is unreachable.
    tar (child): v3.3.2.tar.gz: Cannot open: No such file or directory
    tar (child): Error is not recoverable: exiting now
    tar: Child returned status 2
    tar: Error is not recoverable: exiting now
    mv: cannot stat ‘coreruleset-3.3.2’: No such file or directory
    
    ls: cannot access /usr/local/nginx/coreruleset-3.3.2: No such file or directory
    
    cp: cannot stat ‘/usr/local/nginx/coreruleset-3.3.2/crs-setup.conf.example’: No such file or directory
    cp: cannot stat ‘/usr/local/nginx/coreruleset-3.3.2/rules/REQUEST-900-EXCLUSION-RULES-BEFORE-CRS.conf.example’: No such file or directory
    cp: cannot stat ‘/usr/local/nginx/coreruleset-3.3.2/rules/RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.conf.example’: No such file or directory
    
    ls: cannot access /usr/local/nginx/coreruleset-3.3.2/rules/: No such file or directory
    
    /svr-setup/nginx-1.21.6
    grep: /usr/local/nginx/conf/conf.d/virtual.conf: No such file or directory
    sed: can't read /usr/local/nginx/conf/conf.d/virtual.conf: No such file or directory
    
    Code:
    --2022-05-13 13:17:19--  https://pecl.php.net/get/timezonedb-2021.5.tgz
    Resolving pecl.php.net... 104.236.228.160
    Connecting to pecl.php.net|104.236.228.160|:443... failed: Network is unreachable.
    tar (child): timezonedb-2021.5.tgz: Cannot open: No such file or directory
    tar (child): Error is not recoverable: exiting now
    
    Code:
    --2022-05-13 13:17:19--  https://pecl.php.net/get/mcrypt-1.0.4.tgz
    Resolving pecl.php.net... 104.236.228.160
    Connecting to pecl.php.net|104.236.228.160|:443... failed: Network is unreachable.
    tar (child): mcrypt-1.0.4.tgz: Cannot open: No such file or directory
    tar (child): Error is not recoverable: exiting now
    
    custom_config.inc
    Code:
    (...)
    FORCE_IPVFOUR='n'
    NGINX_IPV='y'