2017-10-15 51 views
0

我有一个Windows Server 2016两个静态IP地址WAMP运行两个网站的两个静态IP的

IP - 1被链接到一个网站在C:\ WAMP \ WWW IP - 2我要链接到在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

+0

你有你的Windows服务器上的DNS服务器? – RiggsFolly

+0

我还没有安装它,但有权访问它来安装是 –

回答

0

我发现我的解决方案,以WAMP服务器指向两个不同的IP地址

上运行两个网站我已经改变了HTTP的虚拟主机文件遵循

<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 [email protected] 
    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 \额外