MAC OSX: Cannot run multiple local domains
i am trying to add another local domain to my mac osx:
No matter what i do when visiting say 'domainnumber2.dev' it always
displays the first host in my list.
If i swop them around in my httpd-vhosts file then i get the
domainnumber2.dev site. How can i run multiple localhost site on my mac.
I have a simple set up as below:
<VirtualHost *:80>
ServerName mydomain.dev
ServerAlias mydomain.dev
DocumentRoot "/Users/UserName/Sites/mydomain/"
</VirtualHost>
<VirtualHost *:80>
ServerName mydomainTwo.dev
ServerAlias mydomainTwo.dev
DocumentRoot "/Users/UserName/Sites/mydomainTwo/"
</VirtualHost>
I have also had the more details set up adding the below for both
<Directory "/Users/UserName/Sites/mydomain/">
DirectoryIndex index.php
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
</Directory>
In my hosts file i have:
127.0.0.1 localhost
127.0.0.1 mydomain.dev
127.0.0.1 mydomainTwo.dev
which ever VirtualHost is first is the site that is served up, even typing
'localhost' displays the first set up 'mydomain.dev'.
No comments:
Post a Comment