Installing/Setting Up/mod_rewrite Cake PHP


Hi, I have been using and learning CakePHP. I faced some problems while installing it and I some how rectified it. When I googled for solutions, I found there were not many people who are talking abouthte problems I had. But, Im sure there are many out ther who are having the same problems.

My CakePHP version is :cake_1.2.4.8284 and Since, I’m on mac, Im using Mac. The xampp version that I’m using is XAMPP 1.7.2. So basically that is my set up environment.

My Document root directory is : /Applications/XAMPP/xamppfiles/htdocs

My Cake installation directory was : /Applications/XAMPP/xamppfiles/htdocs/cake

App Folder: /Applications/XAMPP/xamppfiles/htdocs/cake/app

Web root folder : /Applications/XAMPP/xamppfiles/htdocs/cake/app/webroot

So, I think Now you can relate to you installation.

Problems that I faced are:

CakePHP CSS not applied to the page.

I solved this by including the AllowOverride All to the webroot folder (i.e /Applications/XAMPP/xamppfiles/htdocs/cake/app/webroot) in httpd.conf.

The code sample is:

Alias /cake /Applications/XAMPP/xamppfiles/htdocs/cake/app/webroot
<Directory “/Applications/XAMPP/xamppfiles/htdocs/cake/app/webroot”>
AllowOverride All
Order allow,deny
Allow from all
</Directory>

Restart the server, to let the changes take effect.

The second problem that I faced was, mod_rewrite not working or Internal Server Error in Cake PHP. The mod_rewrite is extensive and I’m not a pro in it, So it took a while. If you can understand mod_rewrite then it will be easier for you the sort the problem.

Basically, I followed the blog tutorial on the cakePHP site and when I was trying to view the page using http://localhost/cake/post (i.e Nice URL), it was throwing a Internal Server Error.

After, Some googling I found that the problem was with the .htaccess file. There are basically 3 .htaccess files that comes with the cake and they have to be configured correctly, the 3 .htaccess files are located in the following directory,

/Applications/XAMPP/xamppfiles/htdocs/cake,

<IfModule rewrite_module>
Options +FollowSymLinks
RewriteEngine on
RewriteBase /cake
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>

/Applications/XAMPP/xamppfiles/htdocs/cake/app,

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /cake
RewriteRule    ^$    webroot/    [L]
RewriteRule    (.*) webroot/$1    [L]
</IfModule>

/Applications/XAMPP/xamppfiles/htdocs/cake/app/webroot

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

For your convenience I have posted the code here.  The line of code that I added in all three .htaccess file to make it work was the RewriteBase /cake (Line 3). Rest, remains as it came from the installation of Cake PHP.

I have not given much explanation about, how things work here, but, I feel there are people out there who are looking for the same.



Deals Site from Tech Twin


Hi All,.

There has been a Deals site that has been added to Tech Twin. This part of tech twin will work hard to get the best deals available for you online. Don’t spend a lot of money buying from shops. You can get the same products for less price. So here is deals site from Tech Twin http://www.deals.eatoutbuddy.com.



How to use Wiki for Technology/Business projects


Recently, they created a wiki page at my office for the project documentation. Good for the project, But, I think they missed a lot of details that is needed to make the wiki a effective project management tool. I was unaware of what my role could be on the wiki. I thought my job is to just read the wiki, because no one prompted me to contribute to the wiki, which is really important for project documentation.

Here are a few good points to make the wiki a effective project or business management tool. It also talks about how to make the transition from the old Project management tool to wiki a smooth process and how to make people contribute to the project documentation on wiki.

Wiki_effective_Project_Tool

Wiki_effective_Project_Tool



Business Models for Web based StartUps


Business_modelIf you want to start a web based startup, its important to come up with a good business model. Business model is the most important part of any business which answers the question, How you are going to make money? Many companies don’ t answer this question when they venture out or they don’t even understand it (Sad). Here are a few business models that can fit into your business.

It’s not compulsive to fit into any of the above mentioned business models. You can draft your own business model for your startup, But, Make sure you understand it to the core. Most startups fail, because they don’t have a good business model.



What’s Important for StartUps?


Here is a very nice article about what startups should do in their first 90 days to get their venture going. Very clear and precise article. In these days the marketing strategy is equally important as your product that you are trying to sell and today there are numerous channels that a marketing team should concentrate like the social branding, affiliate marketing and its very important too. The article talks about press releases and blogging and fan pages to get the fever on to the consumers. First impression is the best impression. If you can get the users talking about you. You have started off well.

Getting the Fever on! Will be back soon



Installing Grails on Mac


Was thinking about learning some new stuff for the week end , and So came the Idea of Grails. This framework has been creating some buzz around me for quiet some time and here I’m getting my hands on it. Of course, getting dirty. :)

Prerequisites for the Grails Installation are : JDK 1.4 or Higher. I hope you can find millions of web pages talking about the JDK installation and setting the JAVA_HOME environment variables. So lets get into business.

Grails can be downloaded from Grails Download section. I downloaded the Binary zip of the stable version, Grails 1.1.1 . Since we are dealing specically about installation on Mac, I’m going to reference everything related to Installation on Mac.

I moved the Zip file to /Users/my_username/grails1.1.1/. Changed the permissions to 755 on the contents of the bin.

chmod 755  /Users/my_username/grails1.1.1/bin/*

Do the following steps.

pwd /Users/my_username/ (In your case it will be your home directory)

ln -s grails-1.1.1 grails (create a soft link to grails directory)

Set up the environment variables

GRAILS_HOME=/Users/my_username/grails;export GRAILS_HOME

PATH=$GRAILS_HOME/bin:$PATH;export PATH

That’s it. You are done.

Type in Grails on the command line. If you see the following message, then the installation was successful.

 

Welcome to Grails 1.1.1 – http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: /Users/acv/grails
No script name specified. Use ‘grails help’ for more info or ‘grails interactive’ to enter interactive mode

Welcome to Grails 1.1.1 – http://grails.org/

Licensed under Apache Standard License 2.0

Grails home is set to: /Users/acv/grails


No script name specified. Use ‘grails help’ for more info or ‘grails interactive’ to enter interactive mode



Automatically updating your WordPress Site from Delicious Account


One of my friend was updating his Wordpress site with links from his Delicious bookmarks. I was wondering how? In this internet age nothing is hard to find. I googled it and found out some places where they have explained it. But, none of the post where so convincing that I make it work by reading the post. So I decided to help people with a more convincing post of mine.

Requirements:

1. You should have a delicious account. Delicious is a online bookmarking site ( You can save your bookmarks online and your bookmarks follow you where ever you go)

2. A site which supports XML-RPC interface. In our case we are talking about a site that is maintained using a word press. So how to enable support for XML-RPC on a wordpress ?

Read on.

Login to you wordpress admin console. Go to Settings and then click on Writing. In the “Remote publishing” section check the enable XML-RPC .

The settings page will look like this.Enabling_XML_RPC_on_WordpressAfter you are done with this. Login to your delicious account. Click on settings.

Under the blogging section click on the Blog Posting link.

You will see a interface like this.

Enabling_XML_RPC_on_Wordpress

In this interface everything is self explanatory. What would be your out url in your case. Normally in wordpress sites after enabling the xml rpc interface the out url will be “http://yousitename.com/xmlrpc.php”. Set a time when your links has to be published to your wordpress site. It is in Universal time, that is GMT. So choose what would be appropriate for you.

 

After you are done wait for your site to get updated everyday. It’s that simple. Now every day there will be posts on your blog. You can add descriptions to your delicious links which will also be posted.