OK, I have my wamp installed and simply can\'t setup my virtual hosts properly.
Here\'s what I have:
Wamp install dir: F:\\wamp
Projects
Try this as your conf/extra/httpd-vhosts.conf
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
## must be first so the the wamp menu page loads
## and leave as Allow from 127.0.0.1 as outside access should not be required to the wamp homepage
<VirtualHost *:80>
ServerAdmin webmaster@homemail.net
DocumentRoot "F:/wamp/www"
ServerName localhost
ServerAlias localhost
<Directory "F:/wamp/www">
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>
</VirtualHost>
# Yes, it's a symfony2 project
<VirtualHost *:80>
DocumentRoot "F:\www\my_project\web"
ServerName myproject.dev
ServerAlias myproject.dev www.myproject.dev
Options Indexes FollowSymLinks
<Directory "F:\www\my_project\web">
AllowOverride All
Order Deny,Allow
Allow from 127.0.0.1
Allow from 192.168.2
## change to Allow from all when it works
</Directory>
</VirtualHost>
Now you need to add the site name(s) to your hosts file like this.
127.0.0.1 myproject.dev
::1 myproject.dev
EDIT:
For your browser to find your site domain names you must tell windows that the domain name you are using for testing exists and which ip address it lives on. You do this by adding your testing domain names to a file called hosts
. This is read when windows loaded its networking component and cached by a service called DNS Client
To add new local domain names you must edit the windows hosts file
c:\windows\system32\drivers\etc\hosts
And add one line for each of your virtual hosts like this
127.0.0.1 myproject.dev
127.0.0.1 myproject2.dev
127.0.0.1 myproject3.dev
::1 myproject.dev
::1 myproject2.dev
::1 myproject3.dev
Once this is saved, launch a command prompt using Run as Administrator
(right click + shift over the Windows command processor icon to show a menu containing the Run as Administrator
menu line) and issue these 2 commands to restart the 'DNS Client' service so it picks up your changes. Alternatively just reboot.
net stop dnscache
when that completes
net start dnscache
PS. The double quotes are required as there is a space in the service name!
HOW TO EDIT THE HOSTS FILE
The hosts file is protected by windows, in order to save it you must have Administrator privilages. On Vista/W7/W8 you may think you are an Administrator BUT YOU ARE NOT.
To successfully save the hosts file do this to launch your editor with Admin Privilages.
Locate your editors icon on the desktop or from the Start menus ( notepad will do if you have nothing else ) right click + shift over your chosen editor icon - will show a menu. select "Run As Administrator" from the menu.
Using file -> open
Navigate your editor to the c:\windows\system32\drivers\etc\hosts
file.
When you have made changes you will now be allowed to save them.