Tuesday, January 4, 2022

[SOLVED] Access Apache VirtualHost from any computer on LAN?

Issue

I have wamp setup with quite a few websites setup as virtual hosts like this in httpd.conf

<VirtualHost 127.0.0.1>
    ServerName project1.local
    DocumentRoot "c:/wamp/project1/"
</VirtualHost>

I have these input in the wamp machine's host file and I can access them just fine on that machine.

127.0.0.1 project1.local

However, when I try to put an entry on my OSX machine as (192.168.1.101 being the internal ip of the wamp machine) it won't pull the page up.

192.168.1.101 project1.local

Is there something else I need to do to make this work from other machines? Thanks!


Solution

You either need <VirtualHost 192.168.1.101> (in addition to 127.0.0.1), or simply use <VirtualHost *> to put the VH on all addresses.



Answered By - user502515