Tuesday, February 23, 2010

Help getting started - getting 500 server error or 404 on tutorial

So I'm about at wits end and am about to give up in frustration after
spending the last couple days messing with this. I just wanted to
learn a bit about this framework and try some stuff out, but I'm not
even able to get the friggin' tutorial working! I keep coming up with
the same suggestions on Google searches and nothing. Hopefully it's
something obvious and someone can help?

I'm on Ubuntu 9.10, with apache2. I'm trying to work with the CakePHP
1.3 beta. My localhost root is at /var/www (http://localhost). I put
all of the cakephp files into /var/www/cakedev (http://localhost/
cakedev).

After I first copied the files over and brought up http://localhost/cakedev,
it looked like everything worked. The cakephp start page came up,
although there weren't any graphics or fancy styles, so maybe
something wasn't right from the start. I worked through the tutorial,
and went to the point where I should be able to see the basic index of
my app (the files are located in /var/www/cakedev/views/recipes, so I
tried http://localhost/cakedev/recipes/index) and got the normal 404
page not found error. It wasn't a Cake error, nothing in those logs,
it was a regular apache 404 error.

Some searches made it sound like my mod_rewrite wasn't working or set
up correctly or something, so I set about doing that. I made changes
to my apache2 config (/etc/apache2/sites-enabled/000-default), but
when I set AllowOverride All, my localhost/cakedev gets a 500 server
error. If I set it back to AllowOverride none, the default page comes
up, but with neither of them does any of my app work. I'll post my
files, what am I doing wrong?

/etc/apache2/sites-enabled/000-default:
<VirtualHost *:80>
ServerAdmin webmaster@localhost

DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride none
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride none
Order allow,deny
allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

</VirtualHost>

/var/www/.htaccess:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>

/var/www/cakedev/app/.htaccess:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>

/var/www/cakedev/app/webroot/.htaccess:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>

What am I missing? Thanks for any help!

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: