views:

375

answers:

3

First time cake user and I'm having real apache problems. For some reason the .htaccess is trying to find

File does not exist: /Library/WebServer/Documents/Users

but there is no such directory as Users. I have tried setting up the following also:

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

<VirtualHost *:80 >
DocumentRoot "/Users/username/Sites/mysite/app/webroot"
ServerName mysite.dev
ServerAlias www.mysite.dev mysite.dev *.mysite.dev
<Directory "/Users/username/Sites/mysite/app/webroot">
    Options Indexes FollowSymLinks
    AllowOverride All
</Directory>
</VirtualHost>

/etc/hosts

127.0.0.1   mysite.dev

/etc/apache2/users/username.conf

<Directory "/Users/username/Sites/">
    Options Indexes MultiViews FollowSymlinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

That also hasn't worked, but with a different error Failed opening required 'cake/libs/cache/file.php'

Although I'd rather not use virtual hosts, and just run it off localhost

+2  A: 

Looks like Apache is trying to find your webroot in a different location--the default location, if memory serves. If you want to use virtual hosts (which would be my recommendation, for whatever it's worth), ensure that the NameVirtualHost directive is uncommented. By default, it's commented out:

NameVirtualHost *:80

If you'd prefer not to use virtual hosts for whatever reason, ensure that the NameVirtualHost is commented out (your <VirtualHost> blocks will be ignored) and change the DocumentRoot value to the proper directory:

DocumentRoot "/Users/username/Sites/mysite/app/webroot"

That should tell Apache to look in the right place.

Rob Wilkerson
A: 

Seems like the solution that worked for me was to edit /etc/apache2/users/username.conf and add this at the top:

DocumentRoot "/Users/username/Sites"

And the default cakePHP download now runs ok.

ed209
A: 

I was on the bakery earlier, and noticed this article, which would fit this question perfectly.

http://bakery.cakephp.org/articles/view/installing-cakephp-on-macos-x

DavidYell