I have configured a Wamp server in my local network and it works great. I can access each project with xxx.xxx.xxx/myproject, but, as another option, can I configure them to access like www.myproject.com or http://myproject.com from the local network? I am an embedded system programmer and I have to access my embedded Ethernet boards with various machines. It works fine with an IP address, but I just want to know if it is possible.
Open C:\Windows\system32\drivers\etc\hosts and after that localhost address(127.0. 0.1) add the domain name which you want like www.example.com and make a space between ip address and domain name. Note: You need to open 'hosts' file in Administrator Privileges .
Update Windows Host fileStep 1: Go to C:\Windows\System32\drivers\etc and edit hosts file “as Administrator”. [ For that open, any text editor in administrator mode then navigate to hosts file.] Step 2: Add 127.0. 0.1 and custom domain at the end of file.
You could simply use the Put Online option of your WAMP Server and you can use this current system IP address and to directly access from the other computer. Then, you could find your IP address using typing ipconfig or whatismyip.com website and then access it on another system.
you can do that by configuring your virtual hosts and the httpd.conf file of your apache
configure apache
the file of your apache will be located in:
search for something like:
DocumentRoot 'c:/wamp/www'
and add the following code after the DocumentRoot 'c:/wamp/www' into the file:
NameVirtualHost 127.0.0.1
<VirtualHost 127.0.0.1>
ServerName localhost
DocumentRoot 'C:\wamp\www'
</VirtualHost>
<VirtualHost 127.0.0.1>
ServerName yourdomain.com
DocumentRoot 'C:\wamp\www\ClientsMyClient'
</VirtualHost>
configure hostfile
on mac via terminal:
on windows 7:
(source: edit hosts file in windows 7)
when you have it opened just write a new line into the file:
XXX.XXX.XXX yourdomain.com
(mostly this will be: 127.0.0.1 yourdomain.com)
I do suggest you use yourdomain.local, because if you ever host a website, you might get confused about which one is the public one and which one is the local website :).
in your browser you then type: yourdomain.com and you should be able to have a project hosted on a wamp server, with his own domain.
hope this helps! :-)
(source: http://viralpatel.net/blogs/how-to-setup-multiple-virtual-hosts-in-wamp/)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With