Virtual host on different drive - Forbiden error?
Posted by: elvendil (---.plus.com)
Date: December 21, 2007 10:51PM

Hi there,

I've managed to set up a couple of virtual hosts seemingly without problem - except that I get a



Forbidden

You don't have permission to access / on this server.



error when trying to access them ( /localhost still works fine ). These virtual hosts are on a second partition, and I do not want to move them into the WAMP www directory (they are part of a project and it'd be silly to duplicate them).

I took a look at the permissions by right-clicking the root folder of each vh, but could not spot anything wrong (or different to the settings on the default c:/wamp/www )

Help?

[edit] - I'm running Vista Home Premium (i know, i know. It came with the laptop, and Ubuntu won't install)

[edit again] - I get the following record in the error.log for the virtual host domain:

[Fri Dec 21 22:20:12 2007] [error] [client 127.0.0.1] client denied by server configuration: D:/USERNAME/Web Development/WEBSITES/mwnet_5-admin/



Edited 3 time(s). Last edit at 12/21/2007 11:22PM by elvendil.

Options: ReplyQuote
Re: Virtual host on different drive - Forbiden error?
Posted by: ashebrian (---.bas501.cwt.esat.net)
Date: December 21, 2007 11:23PM

if you find out how to solve this error please post it ere as i've a similar problem. Even tho i'm on windows xp.....it could still come in my advantage.

Options: ReplyQuote
Re: Virtual host on different drive - Forbiden error?
Posted by: yfastud (Moderator)
Date: December 21, 2007 11:57PM

Theory, you can put any where you want, but practically you should now put them in www so they can be parsed by apache until the time you're more comfortable using this wamp

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: Virtual host on different drive - Forbiden error?
Posted by: elvendil (---.plus.com)
Date: December 22, 2007 12:07PM

I've used Apache/PHP/MySQL before as stand-alone applications, with no problem getting Apache to use other partitions as the document root for virtual hosts - why is it any different for WAMP?

Like I said, I do not and never will store document/project files on the boot drive - it's a liability, so punting into the /www/ directory is not an option.

Options: ReplyQuote
Re: Virtual host on different drive - Forbiden error?
Posted by: yfastud (Moderator)
Date: December 22, 2007 07:29PM

Quote

why is it any different for WAMP?
There is no different since I have no problem to use vh on my 10 different hard drives on 3 different servers and and 4 NAS drives

Since you're experience, not quite sure why you've got that problem; hope you found out and post the solution here

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: Virtual host on different drive - Forbiden error?
Posted by: elvendil (---.ukonline.co.uk)
Date: December 22, 2007 08:38PM

OK, solution found.

Firstly, the http-vhosts.conf examples can never work. Each instance of a vhost also needs <directory> set correctly (they aren't even included in the examples)

The following changes the error recorded in the error.log from a "client denied by server configuration" to a "Directory index forbidden by Options directive"

<VirtualHost *:80>
ServerAdmin webmaster@mwnet5
DocumentRoot "D:/USERNAME/Web Development/WEBSITES/mwnet_5/website"
ServerName mwnet5
ServerAlias mwnet5
ErrorLog "D:/USERNAME/Web Development/WEBSITES/mwnet_5/website/logs/error.log"
<directory "D:/USERNAME/Web Development/WEBSITES/mwnet_5/website">
allow from all
</directory>
</VirtualHost>

To get rid of the new error you need to specify the directory index (it appears that WAMP doesn't load a .htaccess file placed in the vhosts root directory?)

<VirtualHost *:80>
ServerAdmin webmaster@mwnet5
DocumentRoot "D:/USERNAME/Web Development/WEBSITES/mwnet_5/website"
ServerName mwnet5
ServerAlias mwnet5
ErrorLog "D:/USERNAME/Web Development/WEBSITES/mwnet_5/website/logs/error.log"
<directory "D:/USERNAME/Web Development/WEBSITES/mwnet_5/website">
allow from all
</directory>
DirectoryIndex index.php
</VirtualHost>

Going to have a look and see why it isn't loading .htaccess ...



Edited 1 time(s). Last edit at 12/22/2007 08:40PM by elvendil.

Options: ReplyQuote
Re: Virtual host on different drive - Forbiden error?
Posted by: elvendil (---.ukonline.co.uk)
Date: December 22, 2007 08:48PM

OK, it wasn't loading .htaccess, but by using the following it does (For my site to work, I also had to enable the mod_rewrite rule through the task-manager menu)

<VirtualHost *:80>
ServerAdmin webmaster@mwnet5
DocumentRoot "D:/USERNAME/Web Development/WEBSITES/mwnet_5/website"
ServerName mwnet5
ServerAlias mwnet5
ErrorLog "D:/USERNAME/Web Development/WEBSITES/mwnet_5/website/logs/error.log"
<directory "D:/USERNAME/Web Development/WEBSITES/mwnet_5/website">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
allow from all
</directory>
</VirtualHost>

Options: ReplyQuote
Re: Virtual host on different drive - Forbiden error?
Posted by: yfastud (Moderator)
Date: December 23, 2007 12:54AM

Quote

Firstly, the http-vhosts.conf examples can never work.
Even I don't have any part in developing this wamp package, but I know for sure that those 2 dummy example vh are always come w/ apache, not from developers, so even you use different wamp package or original apache, you always see those 2 dummy vh, and of course you MUST replace them w/ your real vh

Quote

For my site to work, I also had to enable the mod_rewrite rule
If you have rewrite rules in .htaccess, of course you MUST enable mod_rewrite

Anyway, glad that you found the solution finally

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: Virtual host on different drive - Forbiden error?
Posted by: elvendil (---.ukonline.co.uk)
Date: December 23, 2007 01:30AM

Quote

you MUST replace them w/ your real vh

Of course - but I would have thought that the format would be correct. It isn't, so even as a template they are useless. You must add the <directory> which isn't there. So they are incomplete examples whereby even if you changed the variables to your servers correct paths etc - they still don't work.

An Apache oversight rather than anything else, not a problem as long as you know to look out for it; but confusing for newbies.

Options: ReplyQuote
Re: Virtual host on different drive - Forbiden error?
Posted by: yfastud (Moderator)
Date: December 23, 2007 01:42AM

He he... he he... ;-)

As already mentioned, they are just dummy examples to give the users the idea what vh might look like but for sure they won't work at all since different users have different ways to implement their document roots

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: Virtual host on different drive - Forbiden error?
Posted by: jw_k (---.net-you.de)
Date: December 23, 2007 12:34PM

a bad example is worse than no example at all (IMHO).

Options: ReplyQuote


Sorry, only registered users may post in this forum.