aej1973
asked on
Setting up virtual hosts in apache ver 2.4.9 (WAMP, Windows 2012)
Hello, I have a wamp server running and my conf/extra/httpd-vhosts.co nf configuration is as follows;
On my httpd.conf
# Virtual hosts
Include conf/extra/httpd-vhosts.co nf
On my c:\xampp\apache\conf\extra \httpd-vho st.conf
my hosts file is:
The issue I am having is that when is use stage1.re-web.com (or any of the other virtual sites ) the site that always comes up is my localhost content and not the folder that I have pointed my virtual site to (folder 01 / folder 02). How can I correct this issue?
Thanks,
A
On my httpd.conf
# Virtual hosts
Include conf/extra/httpd-vhosts.co
On my c:\xampp\apache\conf\extra
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# Use name-based virtual hosting.
#
##NameVirtualHost *:80
# for localhost to work properly
<VirtualHost *:80>
DocumentRoot "c:\wamp\www"
ServerName localhost
ServerAlias localhost
ErrorLog "logs/localhost-error.log"
CustomLog "logs/localhost-access.log" common
<Directory "c:/wamp/www">
AllowOverride All
Options Indexes FollowSymLinks
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "c:\wamp\www\folder01"
ServerName demo.re-web.com
ServerAlias demo.re-web.com
ErrorLog "logs/mysite-error.log"
CustomLog "logs/mysite-access.log" common
<Directory "c:\wamp\www\dds">
AllowOverride All
Options Indexes FollowSymLinks
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "c:\wamp\www\folder02"
ServerName stage1.re-web.com
ServerAlias stage1.re-web.com
ErrorLog "logs/mysite-error.log"
CustomLog "logs/mysite-access.log" common
<Directory "c:\wamp\www\dds">
AllowOverride All
Options Indexes FollowSymLinks
Require local
</Directory>
</VirtualHost>
my hosts file is:
127.0.0.1 localhost
127.0.0.1 demo.re-web.com
127.0.0.1 stage.re-web.com
127.0.0.1 stage1.re-web.com
::1 localhost
::1 stage.re-web.com
::1 demo.re-web.com
::1 stage1.re-web.com
The issue I am having is that when is use stage1.re-web.com (or any of the other virtual sites ) the site that always comes up is my localhost content and not the folder that I have pointed my virtual site to (folder 01 / folder 02). How can I correct this issue?
Thanks,
A
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
That could be it. You can check for sure by opening a command prompt, changing directories into your apache2\bin, and running:
Also, make sure you have a "NameVirtualHost *:80" somewhere in your config.
httpd -S
The output of that command will list all the defined virtual hosts and their files, though not necessarily in order. You can go through each of those to discover in what order they are being included, and modify that order if necessary.Also, make sure you have a "NameVirtualHost *:80" somewhere in your config.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you all...
ASKER
Open in new window