How can i connect to a Virtual Server from external IP?
Posted by: Occhioverde (---.cust.vodafonedsl.it)
Date: September 17, 2017 08:18PM

Good morning.
I created a Virtual Host with WAMPServer 3 (Call it "site2"winking smiley.
Obviously, if I want to connect to this site with my PC, just enter "[site2"]; in the address bar, but if I try to connect from another computer with the external address, I can only connect to the main host (localhost).
How can I connect to "site2" via external IP?
Thanks in advance for the help.

Options: ReplyQuote
Re: How can i connect to a Virtual Server from external IP?
Posted by: RiggsFolly (Moderator)
Date: September 18, 2017 10:09AM

Hi,

Because Apache finds you Virutal Host by matching the domain name used in the url to the ServerName you have to call it as `site2` from the other PC's

Now of course the problem is that the other PC's dont know anything about `site2`

So to get round this you can change the HOSTS file on the PC's that want to be able to use `site2` to point to the PC running WAMPServer (Apache). So assuming WAMPServer is running on 192.168.1.10 you can add this ti the HOSTS file of each of the other PC's


192.168.1.10  site2

Alternatively, but this is a lot more omplicated, you could install a DNS Server and make all your PC's use that DNS Server and add site2 to your DNS. Dont try this unless you know what you are doing with DNS!

---------------------------------------------------------------------------------------------
(Windows 7 Pro 32bit) (Wampserver 3.0.6 32bit)
<Apache 2.4.23/2.2.31> < 7.2/PHP 7.1/7.0/5.6/5.5/5.4> <MySQL 5.7.10/5.6.17/5.5.28>
<MariaDB 10.1.21> <phpMyAdmin4.7.5> <MySQL Workbench 6.3.6.511>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin -- WAMPServer alternate Repo
-?-?-?- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -?-?-?-

Options: ReplyQuote


Sorry, only registered users may post in this forum.