WAMP 运行 两个具有两个静态 IP 的网站
WAMP running two Websites with two Static IP's
我有一个 windows 服务器 2016 有两个静态 IP 地址
IP - 1 linked 到 c:\wamp\www 中的站点
IP - 2 我想 link 到 c:\wamp\www\site1
中的站点
目前我已经使用 https://www.virendrachandak.com/techtalk/creating-multiple-virtual-websites-in-wampserver/ 这个创建了两个站点,但我遇到的问题是它们都在一个 IP 范围内
我需要站点 A 使用本地主机或静态 IP,站点 B 使用它自己的 IP,以便我可以将域定向到该 IP 范围
简而言之
www.siteA.com - 100.0.0.1 ~
www.siteB.com - 100.0.0.2
我该如何实现这一点,因为目前我必须使用 100.0.0.1/site1 来获取站点 B,使用 100.0.0.1 来获取站点 A
我找到了 运行 WAMP 服务器上指向两个不同 IP 地址的两个网站的解决方案
我已将 http-vhost 文件更改如下
<VirtualHost *:80> //This I left as * as this was already running on 127.0.0.1 local host, it can be changed to your static IP Address as required
ServerAdmin admin@localhost
DocumentRoot "C:/wamp/www"
ServerName localhost
ServerAlias www.localhost.com
ErrorLog "logs/localhost-error.log"
CustomLog "logs/localhost-access.log" common
</VirtualHost>
<VirtualHost 154.*.166.*:80> //this can be your second IP address you directing to
DocumentRoot "C:/wamp/www/etrack"
ServerName etrack
ServerAlias **
ErrorLog "logs/localhost-error.log"
CustomLog "logs/localhost-access.log" common
</VirtualHost>
主机文件我也做了修改
127.0.0.1 localhost #eTrack GPS Tracking Software //pointing my first site to local host again
154.*.166.* etrack #eTrack Platform Software //pointing my second site to static IP
文件可以在以下目录中找到。
C:\Windows\System32\drivers\etc主机
C:\wamp\bin\apache\Apache2.4.4\conf\extra
我有一个 windows 服务器 2016 有两个静态 IP 地址
IP - 1 linked 到 c:\wamp\www 中的站点 IP - 2 我想 link 到 c:\wamp\www\site1
中的站点目前我已经使用 https://www.virendrachandak.com/techtalk/creating-multiple-virtual-websites-in-wampserver/ 这个创建了两个站点,但我遇到的问题是它们都在一个 IP 范围内
我需要站点 A 使用本地主机或静态 IP,站点 B 使用它自己的 IP,以便我可以将域定向到该 IP 范围
简而言之
www.siteA.com - 100.0.0.1 ~ www.siteB.com - 100.0.0.2
我该如何实现这一点,因为目前我必须使用 100.0.0.1/site1 来获取站点 B,使用 100.0.0.1 来获取站点 A
我找到了 运行 WAMP 服务器上指向两个不同 IP 地址的两个网站的解决方案
我已将 http-vhost 文件更改如下
<VirtualHost *:80> //This I left as * as this was already running on 127.0.0.1 local host, it can be changed to your static IP Address as required
ServerAdmin admin@localhost
DocumentRoot "C:/wamp/www"
ServerName localhost
ServerAlias www.localhost.com
ErrorLog "logs/localhost-error.log"
CustomLog "logs/localhost-access.log" common
</VirtualHost>
<VirtualHost 154.*.166.*:80> //this can be your second IP address you directing to
DocumentRoot "C:/wamp/www/etrack"
ServerName etrack
ServerAlias **
ErrorLog "logs/localhost-error.log"
CustomLog "logs/localhost-access.log" common
</VirtualHost>
主机文件我也做了修改
127.0.0.1 localhost #eTrack GPS Tracking Software //pointing my first site to local host again
154.*.166.* etrack #eTrack Platform Software //pointing my second site to static IP
文件可以在以下目录中找到。
C:\Windows\System32\drivers\etc主机
C:\wamp\bin\apache\Apache2.4.4\conf\extra