First issue I had was enabling mod_rewrite on openSUSE. To do that, edit the file: "/etc/sysconfig/apache2" (Assuming Apache2.2)
- Go to the line that starts with "APACHE_MODULES" and add "rewrite" at the end just before the closing quote.
- Save the file then run "sudo SuSEconfig" to update Apache's configuration files.
mj@linux-mlvm:~$ ls -l /srv/www/htdocs drwxr-xr-x 5 mj users 4096 2010-01-23 02:28 blogSo I access the blog through: http://localhost/blog/
After configuring the database and the connection settings for CakePHP as instructed in the tutorial, I had to set permissions for the tmp directory: "/srv/www/htdocs/blog/app/tmp"
sudo chown wwwrun /srv/www/htdocs/blog/app/tmpThis will set ownership of the directory to the user running Apache. In my case, it's wwwrun. On a shared web host, it's often nobody. You can find out which username Apache uses by making a small PHP script:
<?php echo `whoami`; ?>Visit the script in a web browser and voila!
Second issue: when reaching the step to create the posts view, I created the directory:
mkdir app/views/postsBut I got an error message in the browser when visiting the link: http://localhost/blog/posts:
Error: The view for PostsController::index() was not found.
Error: Confirm you have created the file: /srv/www/htdocs/blog/app/views/posts/index.ctp
Notice: If you want to customize this error message, create app/views/errors/missing_view.ctp
After verifying that everything is properly spelled and whatnot, turns out it was a dumb mistake of not checking directory permissions:
mj@linux-mlvm:/srv/www/htdocs/blog/app$ ls -la drwxr-xr-x 12 mj users 4096 2010-01-23 02:03 . drwxr-xr-x 5 mj users 4096 2010-01-23 02:28 .. drwxr-xr-x 3 mj users 4096 2010-01-12 05:58 config drwxr-xr-x 3 mj users 4096 2010-01-21 22:32 controllers -rw------- 1 mj users 67 2010-01-23 02:03 .directory -rw-r--r-- 1 mj users 169 2010-01-23 02:08 .htaccess -rw-r--r-- 1 mj users 859 2010-01-12 01:47 index.php drwxr-xr-x 3 mj users 4096 2010-01-12 01:47 locale drwxr-xr-x 4 mj users 4096 2010-01-19 06:54 models drwxr-xr-x 2 mj users 4096 2010-01-12 01:47 plugins drwxr-xr-x 5 mj users 4096 2010-01-12 01:47 tests drwxr-xr-x 6 wwwrun www 4096 2010-01-12 01:47 tmp drwxr-xr-x 3 mj users 4096 2010-01-12 01:47 vendors drwxr--r-- 8 mj users 4096 2010-01-19 07:00 views drwxr-xr-x 5 mj users 4096 2010-01-19 07:36 webroot
Never mind the fact that I'm using my own username for the directories. It's just for quick editing.
Focus on the bold line which has "views" -- since I didn't assign the user wwwrun for that directory, the permissions prevented Apache from accessing the directory resulting in the above Missing error message.
You can either change directory ownership as done for tmp, or change permissions:
chmod 755 views
Note: If a directory is not executable, you can't change to it.