0

I have 3 Wamp servers for my 3 different websites.How can i fix the problem if i turn on my first Wamp server

(c:/folder1/wamp)

instead the third wamp server is run

(c:/folder1/folder2/wamp)

how can i fix this?

i tried to uninstall the third one but sadly all my Wamp server did not work

Aljon Ngo
  • 251
  • 1
  • 3
  • 17

1 Answers1

1

The best way to run multiple local sites with the root url instead of full path is this:

hosts

First, you need to edit your hosts file on the server. This will map the virtual host name to an IP address. To keep this simple, we'll map 127.0.0.1 to mysite. Here's how:

  1. Open Notepad as the administrator.
  2. Open the file C:\Windows\system32\drivers\etc\hosts.
  3. Add the line: 127.0.0.1 mysite1.dev
  4. Add the line: 127.0.0.1 mysite2.dev
  5. Add the line: 127.0.0.1 mysite3.dev
  6. Save the host file (making sure to not save it as a .txt file).

vhosts

Then, in your httpd-vhosts.conf file:

<VirtualHost *:80>
    ServerAdmin emailaddress@domain.com
    DocumentRoot "c:\MYSITE1"
    ServerName mysite1.dev
    ErrorLog "logs/mysite1.log"
    CustomLog "logs/mysite1-access.log" common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin emailaddress@domain.com
    DocumentRoot "c:\MYSITE2"
    ServerName mysite2.dev
    ErrorLog "logs/mysite2.log"
    CustomLog "logs/mysite2-access.log" common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin emailaddress@domain.com
    DocumentRoot "c:\MYSITE3"
    ServerName mysite3.dev
    ErrorLog "logs/mysite3.log"
    CustomLog "logs/mysite3-access.log" common
</VirtualHost>

Here is a link with very clear instructions - Link to Create Virtual Hosts

tylerlindell
  • 1,545
  • 2
  • 17
  • 20
  • i think this is a different solution, my problem here is that im not planning to run multiple server at once.. i just want it to be like my uniserver that when i run it, it just run all the content and the files within that uniserver file.. ,my main problem here is how can i run my second wamp server since it display color red only when i run it – Aljon Ngo Jun 05 '15 at 15:43
  • what do you mean by, "it display color red only when i run it" when you run your second sever? – tylerlindell Jun 05 '15 at 16:01
  • 1
    You should define 3 virtual hosts, 1 for each site. This allows you to run multiple sites from ONE VERSION OF WAMPSERVER [see this post for help setting up Virtual Hosts](http://stackoverflow.com/questions/23665064/project-links-do-not-work-on-wamp-server/23990618#23990618) – RiggsFolly Jun 05 '15 at 18:54