2

Through VirtualBox, I need to access the host's (Mac OS X 10.6) virtual hosts through guest OSs (Windows XP and 7).

I am able to access the localhost URL and can see the directory structure of the ~/Username/Sites folder from the guest OSs via the local URL of the host, my Mac, in the guest's browser but get a 403 error when I try to go deeper into the file structure, for example, mymacsname.lcoal/~Username/Sites is accessible, but I get a 403 when I browse to ymacsname.lcoal/~Username/Sites/somewebsite/.

NB: I also get the 403 when I try to access ymacsname.lcoal/~Username/Sites/somewebsite/ from my Mac's (host's) browser.

Edit:

I've checked the access logs on the host OS (the Mac) and strangely, if I browse to a directory without a .htaccess file I receive a "HTTP/1.1" 200 1935 response and am able to either browser that directory's index or am served it's default Web page. If there is a .htaccess file in the directory I receive a "HTTP/1.1 403 247" response!

This narrows a lot of the problem down to the .htaccess file, so I'll continue to research on this, I'm really grateful for your help!

Re-Edit

Going further, it would seem to be an issue with my .htaccess's mod_rewrite rules. I've included my .htaccess code below, it would seem, like it should, that it's redirecting the browser to /Users/Jay/Sites/chassis/library/bootstrap.php but it would seem I don't have privileges to access that file (bootstrap.php).

Options +FollowSymLinks

RewriteEngine On

RewriteCond %{DOCUMENT_ROOT}/public/index.html !-f
RewriteRule ^$ library/bootstrap.php [L]

RewriteRule ^$ public/index.html [L]

RewriteRule ^([a-z0-9/-]+)$ library/bootstrap.php?url=$1 [L,QSA]

Getting so close! Please help me solve this!

Re-Re-Edit

In case this helps, here is a clip from my main Apache configuration file (/private/etc/apache2/httpd.conf):

<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
Cristian Ciupitu
  • 6,226
  • 2
  • 41
  • 55

2 Answers2

1

You might want to start by checking the access logs of the web server to see what is actually being passed onto it - both successes vs. failures.

user48838
  • 7,393
  • 2
  • 17
  • 14
1

It was definitely a permissions problem.

Solved by adding:

<Directory />
    Options +FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

to /private/etc/apache2/extra/httpd-vhosts.conf.

I also needed to edit the hosts file on the guest OSs (Windows XP and 7) like so:

192.168.123.123 somevhost
192.168.123.123 someothervhost.dev

Where the IP address stated is that of the host OS and somevhost… is the name of the virtual host on the host OS.

I needed to set the host OS to use a static IP, as if it were assigned by DHCP, you'd have to edit the host file on the guest OS each time your host OS's IP changed.

These Web sites really helped:

http://support.microsoft.com/kb/972034#LetMeFixItMyselfAlways

http://mark-kirby.co.uk/2008/setting-up-virtual-hosts-on-os-x-leopard/

http://adactio.com/journal/1395