My vhosts are:
# for localhost to work properly
<VirtualHost *:1983>
ServerAdmin admin@localhost
DocumentRoot "d:/wamp/www"
ServerName localhost
</VirtualHost>
# - See more at: http://yogeshchaugule.com/blog/2014/how-setup-virtual-hosts-wamp#sthash.zVhOHBlJ.dpuf
# - @: http://www.techrepublic.com/blog/smb-technologist/create-virtual-hosts-in-a-wamp-server/
# - @: http://www.kristengrote.com/blog/articles/how-to-set-up-virtual-hosts-using-wamp (maybe out of usable scope)
# afm : Agile Farm Manager
#<VirtualHost *:1983>
# DocumentRoot "D:/projects/afm/Code"
# ServerName dafm.dev
# <Directory "D:/projects/afm/Code">
# Order allow,deny
# Allow from all
# AllowOverride All
# </Directory>
#</VirtualHost>
# mrs : Meeting Request System
<VirtualHost mrs.dev:1983>
DocumentRoot "D:/wamp/www/mrs_site/mrs"
ServerName mrs.dev
ServerAlias mrs.dev
<Directory "D:/wamp/www/mrs_site/mrs">
Order allow,deny
Allow from all
AllowOverride All
</Directory>
</VirtualHost>
# dtk : Kit Designer
<VirtualHost dtk.dev:1983>
DocumentRoot "D:/wamp/www/designertoolkit/"
ServerName dtk.dev
ServerAlias dtk.dev
<Directory "D:/wamp/www/designertoolkit/">
Order allow,deny
Allow from all
AllowOverride All
</Directory>
</VirtualHost>
And my windows' hosts file has the following mappings
#VIRTUAL DOMAINS
127.0.0.1 dafm.dev
127.0.0.1 mrs.dev
127.0.0.1 dtk.dev
My configured port is :1983 so i access wamp like: http://localhost:1983/
or http://mrs.dev:1983/
goes to my current project. but my other projects are not accessible anymore.
like when i go to dtk.dev:1983/
goes to same project http://mrs.dev:1983/
for every valid request to wamp server.
I need to run multiple projects on WAMP simultaneously. What is the problem with the Virtual Hosts?
please help
Thanks to the anonymous @user4311956's answer for pointing out that the
NameVirtualHost
directive is important.But with my own testing I found out that if I mention
NameVirtualHost
directive before each Virtual Host i create it works, fails otherwise.here the code for
httpd-vhosts.conf
file that worked the magic:Thanks again to @user4311956's answer for pointing me in right direction.
You need to use NameVirtualHost. See Apache manual: http://httpd.apache.org/docs/current/vhosts/name-based.html
Like this:
Maybe this is working: