CakePHP programming with some other stuff like Hackintosh (OSx86) and, more recently, Coldfusion.
8 Jun 2010
6 May 2010
Getting CakePHP up and running on Ubuntu
To enable mod rewrite, you need to add a symbolic link to the module definition file, which lives in /etc/apache2/mods-available, to the folder: /etc/apache2/mods-enabled. Do this by first changing to the mods-enabled folder then adding the symlink.
In the sites-enabled folder /etc/apache2/sites-enabled, edit 000-default (this is actually a symbolic link to etc/apache2/sites-available/default, which will need to be made editable before making changes). You will need to add the statement:
to the directory blocks for '/' and '/var/www'. If these blocks do not contain the statement:
then add it at the end. Make sure that any occurrence of AllowOverride None within these blocks is changed, commented or deleted.
cd /etc/apache2/mods-enabled
ln -s ../mods-available/rewrite.load
AllowOverride All
Allow from all
3 May 2010
Dual booting Hac & Ubuntu 10.04 LTS
After a night and a day of swearing, it turns out that the key to getting this dual boot working is to install Grub2 in a location other than the default option. I selected the Linux install partition. Now all I have to do is figure out why Xiezhy (the Hac bootloader) thinks Ubuntu is Windows.
And this new Ubuntu is fucking quick!
And this new Ubuntu is fucking quick!
20 Apr 2010
ACL at page level
I've been messing around with CakePHP's built in ACL functionality. I tried it a while back (2007), but just couldn't make sense of it. Now, following Mark Story's tutorial in the Cake Book (and also his blog: http://mark-story.com/posts/view/auth-and-acl-an-end-to-end-tutorial-pt-1 ) , I have it working. He makes it very easy.
Now I'm tinkering with it to make it work on a page level. Success at this will mean I can use the CMS to create admin pages as well as public pages. When I've sussed it, I'll publish.
Now I'm tinkering with it to make it work on a page level. Success at this will mean I can use the CMS to create admin pages as well as public pages. When I've sussed it, I'll publish.
13 Apr 2010
CakePHP, .htaccess and clean homepage urls
Sometimes we need a clean url for the homepage to appear in the browser address bar, e.g. www.example.com
This problem came up with the CMS system I have built as all the pages have a url/name. For example, the default homepage would show as www.example.com/homepage.
Of course, homepage could be any page name that you want to be the anchor page.
This problem came up with the CMS system I have built as all the pages have a url/name. For example, the default homepage would show as www.example.com/homepage.
Typing www.example.com would redirect to this and change the displayed url. The desired behaviour is to redirect
www.example.com -> www.example.com/homepage but only display www.example.com.
On the other hand, if you were to type www.example.com/homepage the display should stay as www.example.com/homepage .
The answer means a slight change to the default CakePHP .htaccess file
The answer means a slight change to the default CakePHP .htaccess file
RewriteRule ^$ app/webroot/ [L]becomes
RewriteRule ^$ homepage [L]Of course, homepage could be any page name that you want to be the anchor page.
Subscribe to:
Posts (Atom)