Join the community today
Become a Member

Centmin Mod 1.2.3-eva2000.08 FTP hostname change

Discussion in 'Install & Upgrades or Pre-Install Questions' started by Bambi838, Sep 15, 2015.

  1. Bambi838

    Bambi838 New Member

    3
    0
    1
    Jan 27, 2015
    Ratings:
    +0
    Local Time:
    2:57 PM
    Hello,

    I recently purchased a VM what use 1to1 NAT for internet access.
    Everything goes good with the install but seems that when i create the DNS the FTP host is
    a private ip instead of the public. I would like to know how to solve this problem on a Centos7 box.
     
  2. eva2000

    eva2000 Administrator Staff Member

    31,001
    6,919
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,424
    Local Time:
    11:57 PM
    Nginx 1.13.x
    MariaDB 5.5
    could you elaborate on that ? you mean you're using your VPS as kind of VPN for internet usage ?

    the Centmin Mod add vhost function gets the server IP from line 109 of inc/nginx_addvhost.inc
    Code:
    CNIP=$(ip route get 8.8.8.8 | awk 'NR==1 {print $NF}')
    if you have more than 1 ip address on the server, that line might returned the incorrect IP for the server. You can check by typing in SSH window the command manually
    Code:
    ip route get 8.8.8.8
    to see what it returns

    and then
    Code:
    ip route get 8.8.8.8 | awk 'NR==1 {print $NF}'
    it would help to improve this function if you can provide what you get outputted from both these commands, you can replace the actual IPs with fake ip numbers. Just need the format and structure that is returned. You can wrap output in CODE tags How to use forum BBCODE code tags | Centmin Mod Community to perserve format

    the good news is centmin.sh menu option 2 add vhost's returned FTP IP is just cosmetic in what it returns. If you setup ftp connection using real server IP instead of incorrectly shown one, it will connect
     
  3. Bambi838

    Bambi838 New Member

    3
    0
    1
    Jan 27, 2015
    Ratings:
    +0
    Local Time:
    2:57 PM
    Code:
     ip route get 8.8.8.8
    8.8.8.8 via 172.31.1.1 dev eth0  src 172.31.1.100
      cache  mtu 1500 advmss 1460 hoplimit 64
    
    [root@server ~]# ip route get 8.8.8.8 | awk 'NR==1 {print $NF}'
    172.31.1.100
    
    This might help:
    VServer/en – Hetzner DokuWiki
    Why does my VM have the IP 172.31.1.100?
    Or also:

    Why does my VM have a different IP from the one shown in the Robot?
    Why does my VM have a private IP?

    With the CX models the IPv4 address of the virtual server is a private IP, which is configured 1:1 via NAT on the public IP. Currently the private IP is the same for all: 172.31.1.100. The public IP is displayed in the Robot.

    Regarding the...
    "the good news is centmin.sh menu option 2 add vhost's returned FTP IP is just cosmetic in what it returns. If you setup ftp connection using real server IP instead of incorrectly shown one, it will connect"

    In my case it couldn't connect... if you provide me your email i can fire up on vps for you and do the install yourself ... for testing porpuses and for the sake of helping one user too. I reinstalled the server like 6 times yesterday. :)
     
  4. eva2000

    eva2000 Administrator Staff Member

    31,001
    6,919
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,424
    Local Time:
    11:57 PM
    Nginx 1.13.x
    MariaDB 5.5
    unfortunately, i'm not sure where I'd begin when your VPS IP resolves to a private IP address and unfortunately, don't have spare time to look at this as currently pretty busy.

    you'd want to ask hetzner support about how you normally would connect via ftp for their CX servers and what needs to be done when server has a firewall like CSF Firewall in place which is a wrapper script/tool to iptables ConfigServer Security & Firewall
     
  5. eva2000

    eva2000 Administrator Staff Member

    31,001
    6,919
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,424
    Local Time:
    11:57 PM
    Nginx 1.13.x
    MariaDB 5.5
    maybe one thing you can try is add to /etc/pure-ftpd/pure-ftpd.conf config file the line

    replace YOURREALSERVERIPADDRESS with your real public ip address of server
    Code:
    ForcePassiveIP YOURREALSERVERIPADDRESS
    then restart pure-ftpd
    Code:
    service pure-ftpd restart