NAT + NameVirtualHost

Discussion in 'Installation/Configuration' started by Rein van 't Veer, Oct 12, 2015.

  1. Hi,
    I use a vps service that provides 1:1 nat and thus my server has a private ipv4 IP address.
    ipv6 address is pointing straight to the box.
    This is the first time I use ISPConfig

    I figured, lets add both addresses (external ipv4 and ipv6 address) to the server ip config with the checkbox for HTTP NameVirtualHost unchecked so that it does not get added to the vhost configs written by ISPConfig
    ISPConfig report: (removed the iptables)
    Code:
    root@srv010 ~ # cat htf_report.txt
    
    ##### SERVER #####
    IP-address (as per hostname): ***.***.***.***
    IP-address(es) (as per ifconfig): ***.***.***.***
    [INFO] ISPConfig is installed.
    
    ##### ISPCONFIG #####
    ISPConfig version is 3.0.5.4p8
    
    
    ##### VERSION CHECK #####
    
    [INFO] php (cli) version is 5.6.13-0+deb8u1
    [INFO] php-cgi (used for cgi php in default vhost!) is version 5.6.13-0+deb8u1
    
    ##### PORT CHECK #####
    
    [WARN] Port 8080 (ISPConfig) seems NOT to be listening
    [WARN] Port 22 (SSH server) seems NOT to be listening
    
    ##### MAIL SERVER CHECK #####
    
    
    ##### RUNNING SERVER PROCESSES #####
    
    [INFO] I found the following web server(s):
        Apache 2 (PID 8427)
    [INFO] I found the following mail server(s):
        Postfix (PID 1424)
    [INFO] I found the following pop3 server(s):
        Dovecot (PID 741)
    [INFO] I found the following imap server(s):
        Unknown process (init) (PID 1)
    [INFO] I found the following ftp server(s):
        PureFTP (PID 1340)
    
    ##### LISTENING PORTS #####
    (only        ()
    Local        (Address)
    [anywhere]:110        (741/dovecot)
    [anywhere]:143        (1/init)
    [anywhere]:465        (1424/master)
    [anywhere]:21        (1340/pure-ftpd)
    ***.***.***.***:53        (688/named)
    [localhost]:53        (688/named)
    [anywhere]:2200        (690/sshd)
    [anywhere]:25        (1424/master)
    [localhost]:953        (688/named)
    [anywhere]:993        (1/init)
    [anywhere]:995        (741/dovecot)
    [localhost]:8997        (8203/php-fpm.conf))
    [localhost]:8998        (6418/php-fpm.conf))
    [localhost]:8999        (6265/php-fpm.conf))
    [localhost]:10024        (1441/amavisd-new)
    [localhost]:10025        (1424/master)
    [localhost]:9001        (8351/php-fpm.conf))
    [anywhere]:587        (1424/master)
    [localhost]:11211        (691/memcached)
    [localhost]10        (741/dovecot)
    *:*:*:*::*:9999        (8427/apache2)
    [localhost]43        (1/init)
    *:*:*:*::*:80        (8427/apache2)
    *:*:*:*::*:8081        (8427/apache2)
    *:*:*:*::*:465        (1424/master)
    *:*:*:*::*:21        (1340/pure-ftpd)
    *:*:*:*::*:53        (688/named)
    *:*:*:*::*:2200        (690/sshd)
    *:*:*:*::*:25        (1424/master)
    *:*:*:*::*:953        (688/named)
    *:*:*:*::*:443        (8427/apache2)
    *:*:*:*::*:993        (1/init)
    *:*:*:*::*:995        (741/dovecot)
    *:*:*:*::*:10024        (1441/amavisd-new)
    *:*:*:*::*:3306        (1113/mysqld)
    *:*:*:*::*:587        (1424/master)
    ifconfig output:
    Code:
    eth0      Link encap:Ethernet  HWaddr 52:54:a2:01:0c:af
              inet addr:172.31.1.100  Bcast:172.31.1.255  Mask:255.255.255.0
              inet6 addr: 2a01:4f8:c17:aac::2/64 Scope:Global
              inet6 addr: fe80::5054:a2ff:fe01:caf/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:79575 errors:0 dropped:0 overruns:0 frame:0
              TX packets:88265 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:9452857 (9.0 MiB)  TX bytes:106636844 (101.6 MiB)
    
    lo        Link encap:Local Loopback
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:65536  Metric:1
              RX packets:1358 errors:0 dropped:0 overruns:0 frame:0
              TX packets:1358 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:245334 (239.5 KiB)  TX bytes:245334 (239.5 KiB)
    The problem is that even though I unchecked the NamevirtualHost in System, Server IP Address, it still gets written into the apache config.

    I only noticed on ipv6 + ssl (https), because I get the wrong certificate for the wrong domain.

    With kind regards,
    Rein
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    You don't have to add an IP under System > Server IP. Remove the Ip from there and then select just * in the website settings.

    Regarding IP's and NAT. The IP that has to be added into the apache config when you want to use the IP in vhosts instead of * is the internal IP and not the external one, so you just add the internal IP then under System Server config and the NameVirtualhost checkbox has to be enabled. The external IP is only used in DNS records, not in apache.
     
  3. I removed all ip's and so the default is just * on ipv4 and empty on ipv6.

    It seems the database does not change this though. Is there a way for me to easily rewrite all apache configs with the current database configuration? I'll just remove the ipv6 address from the table web_domain and would rewrite all so that no ipv6 namevirtualhosts are to be found in the vhost configs.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    See Tools > Resync in ISPConfig.
     
  5. awesome ;-). This starts to be my new favourite all-round control panel ^^
     

Share This Page