php - how to run multiple projects on Apache using Virtual Hosts? -
my vhosts are:
# localhost work <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 # allowoverride # </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 allowoverride </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 allowoverride </directory> </virtualhost>
and windows' hosts file has 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 :1983 access wamp like: http://localhost:1983/
or http://mrs.dev:1983/
goes current project. other projects not accessible anymore.
like when go dtk.dev:1983/
goes same project http://mrs.dev:1983/
every valid request wamp server.
i need run multiple projects on wamp simultaneously. problem virtual hosts?
please help
you need use namevirtualhost. see apache manual: http://httpd.apache.org/docs/current/vhosts/name-based.html
like this:
namevirtualhost *:80 <virtualhost *:80> servername www.domain.tld serveralias domain.tld *.domain.tld documentroot /www/domain </virtualhost> <virtualhost *:80> servername www.otherdomain.tld documentroot /www/otherdomain </virtualhost>
maybe working:
namevirtualhost *:1983 # localhost work <virtualhost *:1983> serveradmin admin@localhost documentroot "d:/wamp/www" servername localhost </virtualhost> # mrs : meeting request system <virtualhost *:1983> documentroot "d:/wamp/www/mrs_site/mrs" servername mrs.dev serveralias mrs.dev </virtualhost> # dtk : kit designer <virtualhost *:1983> documentroot "d:/wamp/www/designertoolkit/" servername dtk.dev serveralias dtk.dev </virtualhost> <directory "d:/wamp/www/designertoolkit/"> order allow,deny allow allowoverride </directory> <directory "d:/wamp/www/mrs_site/mrs"> order allow,deny allow allowoverride </directory>
Comments
Post a Comment