本地 IP 重定向至公共 IP

本地 IP 重定向至公共 IP

我有一个网站Ubuntu VPS我可以通过我的公共有效 IP 访问我的网站(185.211.88.62)但当本地网络上的计算机未连接到互联网并想要使用本地无效 IP 时(172.16.1.103)它重定向到公共 IP 并且不起作用!

我的接口:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto ens32
iface ens32 inet static
        address 172.16.1.103
        netmask 255.255.255.240
        network 172.16.1.96
        broadcast 172.16.1.111
        gateway 172.16.1.97
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 172.16.1.97
        dns-search xcv.ikl.com

如何配置我的网站,使其可以使用本地 IP 从本地网络访问而无需重定向?

纳米/etc/apache2/httpd.conf显示空文件!

** sudo service apache2 status ** 输出:

● apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: active (running) since Sun 2017-11-12 05:19:01 EST; 1min 52s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 24060 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
  Process: 24086 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)
    Tasks: 55
   Memory: 6.3M
      CPU: 135ms
   CGroup: /system.slice/apache2.service
           ├─24104 /usr/sbin/apache2 -k start
           ├─24106 /usr/sbin/apache2 -k start
           └─24107 /usr/sbin/apache2 -k start

Nov 12 05:19:00 student systemd[1]: Stopped LSB: Apache2 web server.
Nov 12 05:19:00 student systemd[1]: Starting LSB: Apache2 web server...
Nov 12 05:19:00 student apache2[24086]:  * Starting Apache httpd web server apache2
Nov 12 05:19:01 student apache2[24086]:  *
Nov 12 05:19:01 student systemd[1]: Started LSB: Apache2 web server.

相关内容