Aljon Ngo
Aljon Ngo

Reputation: 251

How to fix wamp server running different wamp server folder

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

Upvotes: 0

Views: 124

Answers (1)

tylerlindell
tylerlindell

Reputation: 1563

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 [email protected]
    DocumentRoot "c:\MYSITE1"
    ServerName mysite1.dev
    ErrorLog "logs/mysite1.log"
    CustomLog "logs/mysite1-access.log" common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "c:\MYSITE2"
    ServerName mysite2.dev
    ErrorLog "logs/mysite2.log"
    CustomLog "logs/mysite2-access.log" common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin [email protected]
    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

Upvotes: 1

Related Questions