Page 1 of 1

Virtual hosts?

PostPosted: 28. November 2006 15:22
by frankie2000
Hi!

I need to run my webappz in virtual hosts...so i added the following lines in the httpd.conf file:
<VirtualHost *:80>
DocumentRoot C:\dev
ServerName phptest
DirectoryIndex indexa.php
<Directory "C:\dev">
options Indexes FollowSymLinks
</Directory>
</VirtualHost>

I was hoping to see the directory list up all files and dirs but i got a 403 error. Why?

How can i fix it?

PostPosted: 28. November 2006 21:59
by Izzy
Change this part and it may rid you of the 403 error because the defaults in the httpd.conf are restricting directory access and you have to change that behaviour in every Directory directive:
<Directory "C:\dev">
options Indexes FollowSymLinks
</Directory>


to this:
<Directory "C:\dev">
Options Indexes FollowSymLinks Includes ExecCGI
Order allow,deny
Allow from all
</Directory>


Also add quotes to this because Apache likes the slash going the other way (/):
DocumentRoot C:\dev

to this:
DocumentRoot "C:\dev"

Also when ever you get a server error check the server logs xampp\apache\logs\error.log as they may give you a better clue.
Note the date and time the error appeared and look for the corresponding date and time in the error log.

Just to add if you get errors with the xampp\apache\conf\extra\httpd-vhosts.conf file then issue this command at a prompt in a command console in xampp\apache\bin
apache -S

Issue this command in the same way if you suspect that the xampp\apache\conf\httpd.conf file may have a syntax error preventing Apache from starting:
apache -t
Both of these commands may give you some clues to work with.

PostPosted: 29. November 2006 16:38
by frankie2000
Woaw...excellent support. It worked like a charm.

Thanx a bunch!