Agar bisa menngunakan CakePHP melalui http://localhost/~nama_user , kita harus mengaktifkan module userdir dan module rewrite di apache2. Berikut langkah-langkahnya :
Mengaktifkan apache userdir
$ sudo -i
# a2enmod userdir
# /etc/init.d/apache2 force-reload
sekarang kita bisa membuat folder public_html di home directory kita, disini kita akan menempatkan aplikasi web kita. misal /home/iwan/public_html maka kita dapat mengaksesnya melalui http://localhost/~iwan/
Mengaktifkan apache rewrite
# a2enmod rewrite
edit /etc/apache2/mods-enabled/userdir.conf dengan text editor vim / gedit / mousepad ubah AllowOveride menjadi All, seperti berikut :
# mousepad /etc/apache2/mods-enabled/userdir.conf
<IfModule mod_userdir.c> UserDir public_html UserDir disabled root <Directory /home/*/public_html> AllowOverride All # yang di ubah Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec </Directory> </IfModule>
simpan kemudian restart apache
# /etc/init.d/apache2 force-reload
download CakePHP disini http://cakeforge.org/projects/cakephp/ simpan di public_html kemudian di ekstrak. Rename folder hasil ekstrak menjadi cakephp biar mudah diingat dan di bisa diakses di http://localhost/~username/cakephp/
edit file .htaccess yang ada di
cakephp/.htaccess cakephp/app/.htaccess cakephp/app/webroot/.htaccess
tambahkan baris
RewriteBase /~username/cakephp/
setelah baris
RewriteEngine on
jangan lupa ubah “RewriteBase /~username/cakephp/” dengan username anda
Sekarang kita bisa melanjutkan tutorial membuat blog sederhana dengan CakePHP disini -> http://book.cakephp.org/id/view/219/Blog