I've got a home windows XP machine, installed apache at C:Program FilesApache Software FoundationApache2.2

I set the document root as DocumentRoot "C:/projects" in httpd.conf and my projects are proj1 and proj2 in c:projects

<VirtualHost *:80>
 DocumentRoot "C:/projects/proj1"

 ServerName  proj1

</VirtualHost>

<VirtualHost *:80>

 DocumentRoot "C:/projects/proj2"

 ServerName  proj2

</VirtualHost>

both proj1 and proj2 have index.php files. I added

127...1 proj1

127...1 proj2

within the hosts file too.

still, after i type http://proj1, I only begin to see the files listing, the virtual directory is not working. what shall we be held missing?

Apart from restarting / reloading Apache there is a couple of other activities to check on:

First, listed here are good examples of valid vhost designs:

<VirtualHost *:80>
    ServerName proj1
    DocumentRoot "c:/www/proj1"
    <Directory "c:/www/proj1" >
    	AllowOverride All
    	Order allow,deny
    	Allow from all
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName proj2
    DocumentRoot "c:/www/proj2"
    <Directory "c:/www/proj2" >
    	AllowOverride All
    	Order allow,deny
    	Allow from all
    </Directory>
</VirtualHost>

Note how proj1 and proj2 have their very own VirtualHost directive.

Next, make certain the vhosts terms are now being loaded by Apache. To be able to get mine to operate, I needed to uncomment this line in httpd.conf:

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

Less than enough info without seeing all of your config files, but listed here are a few items to check:

  • Any hints within the apache error log when you begin up?
  • Make certain you've NameVirtualHost *:80 somewhere inside your config files which statement is loaded before your vhosts.
  • If you're able to begin to see the directory report on the proj1 dir, then vhosts will work and you will tweak directory permissions and qualities (index files, dir entries permitted, etc).