Search code examples
phpapachewampvirtualhostwampserver

How can i setup my wamp server to access to a virtual Host from intranet?


I have some virtual-host and I can access it on the PC that has the server intalled. But I have others Pc and I want to access via the domain name.

I just can access to the server configuration page changing the statement "Require local" to "Require all granted". This only allow me to access through the ip address.

<VirtualHost *:80>
    ServerName localhost
    DocumentRoot D:/wamp64/www
    <Directory  "D:/wamp64/www/">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName laravel5.1.app
    DocumentRoot "d:/wamp64/www/laravel5_1/public"
    <Directory  "d:/wamp64/www/laravel5_1/public/">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

Solution

  • To access the site using your domain names you must tell each of the other PC's where to find the domain name.

    So you either need a local DNS Server or you edit the HOSTS file on each PC that you want to access the site from by adding something like this to the other PC's HOSTS

    192.168.1.100 laravel5.1.app
    

    Assuming your WAMPServer (Apache) is running on ip address 192.168.1.100