Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wamp in network with a domain name

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.

like image 433
Saneesh A T Avatar asked Nov 23 '12 12:11

Saneesh A T


People also ask

How do I change my domain IP address in WAMP?

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 .

How do I change my localhost domain to WAMP?

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.

How can I access my WAMP server from another computer?

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.


1 Answers

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:

  • c:\wamp\Apache2\conf\httpd.conf

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:

  • sudo nano /etc/hosts

on windows 7:

  • open a texteditor as administrator
  • open file and go to: %Systemroot%\System32\Drivers\Etc

(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/)

like image 81
Bananam00n Avatar answered Oct 06 '22 14:10

Bananam00n