Hi,
I need to get my WAMP server to behave in terms of the root just as it would when hosted on a public site... For testing purposes. I have Windows 7 Home Premium for OS.
I found this post telling how to set up vhost, [
forum.wampserver.com] which sounds like exactly what I need. After following all instructions contained in it I continue to get 403 Forbidden.
Wamp icon is green and online.
I have this in my httpd.conf file:
# Virtual hosts
# Bill uncommented out this line on 5-2-12
Include conf/extra/httpd-vhosts.conf
This is the contents of my httpd-vhosts.conf file located in the conf\extra folder
#
# 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:[
httpd.apache.org];
# 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
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
ServerAdmin webmaster@.localhost
DocumentRoot "c:/wamp/www"
ServerName localhost
ServerAlias localhost
# ErrorLog "logs/dummy-host.example.com-error.log"
# CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin
webmaster@stp.localserverDocumentRoot "c:/web_sites/www/stp"
ServerName stp.localserver
ServerAlias stp.localserver
# ErrorLog "logs/dummy-host2.example.com-error.log"
# CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
#<VirtualHost *:80>
# ServerAdmin
webmaster@dummy-host.example.com# DocumentRoot "c:/Apache2/docs/dummy-host.example.com"
# ServerName dummy-host.example.com
# ServerAlias www.dummy-host.example.com
# ErrorLog "logs/dummy-host.example.com-error.log"
# CustomLog "logs/dummy-host.example.com-access.log" common
#</VirtualHost>
#<VirtualHost *:80>
# ServerAdmin
webmaster@dummy-host2.example.com# DocumentRoot "c:/Apache2/docs/dummy-host2.example.com"
# ServerName dummy-host2.example.com
# ErrorLog "logs/dummy-host2.example.com-error.log"
# CustomLog "logs/dummy-host2.example.com-access.log" common
#</VirtualHost>
This is my windows hosts files:
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
127.0.0.1 localhost
192.168.1.200 stp.localserver
Here is the small index.php file that is the only thing in the c:\web_sites\stp folder:
<html>
<head><title>PHP Test</title></head>
<body><?php echo '<p>Hello World</p>'; ?></body>
</html>
I have stopped all WAMP Services. then I have restarted the DNS-Client service, then restarted WAMP services.
I have read for hours through other posts and tried a myriad of things all to no avail. Any help is greatly appreciated.
Thanks, Bill
Edited 1 time(s). Last edit at 05/03/2012 08:32PM by billtepe.