Did you set up your hosts file? On Unix Systems /etc/hosts? And did you restart your server?
Vhosts not working
Question
I have the following vhosts setup:
<VirtualHost *:80>
ServerAdmin admin@localhost.com
DocumentRoot "C:\Apache24\htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost cake-photos.com:80>
ServerAdmin admin@localhost.com
DocumentRoot "C:\Apache24\htdocs\cake-photos"
ServerName cake-photos.com
ServerAlias *.cake-photos.com
<Directory "C:\Apache24\htdocs\cake-photos">
Options Indexes FollowSymLinks
AllowOverride all
Require ip 127.0.0.1
</Directory>
</VirtualHost>
<VirtualHost fangwear.co.uk:80>
ServerAdmin admin@localhost.com
DocumentRoot "C:\Apache24\htdocs\Fangwear 2014"
ServerName fangwear.co.uk
ServerAlias www.fangwear.co.uk
<Directory "C:\Apache24\htdocs\Fangwear 2014">
Options Indexes FollowSymLinks
AllowOverride all
# Require all granted
Require ip 127.0.0.1
</Directory>
</VirtualHost>
<VirtualHost manager.com:80>
ServerAdmin admin@localhost.com
DocumentRoot "C:\Apache24\htdocs\Manager 2014"
ServerName manager.com
ServerAlias www.manager.com
<Directory "C:\Apache24\htdocs\Manager 2014">
Options Indexes FollowSymLinks
AllowOverride all
# Require all granted
Require ip 127.0.0.1
</Directory>
</VirtualHost>
None of it seems to be working and if I try to go to any of these I end up being redirected to the cake-photos.com vhost.
I need to be able to get to other things too such as localhost/phpmyadmin
but that won't work with this configuration.
Where am I going wrong?
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow