<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>phoenixheart - portfolio &#38; more &#187; kohana</title> <atom:link href="http://www.phoenixheart.net/tag/kohana/feed/" rel="self" type="application/rss+xml" /><link>http://www.phoenixheart.net</link> <description>phoenixheart - portfolio &#38; more</description> <lastBuildDate>Wed, 25 Aug 2010 03:02:03 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0.1</generator> <script type="text/javascript">/*<![CDATA[*/if(typeof Meebo=="undefined"){Meebo=function(){(Meebo._=Meebo._||[]).push(arguments)};(function(q){var args=arguments;if(!document.body){return setTimeout(function(){args.callee.apply(this,args)},100);}var d=document,b=d.body,m=b.insertBefore(d.createElement('div'),b.firstChild);s=d.createElement('script');m.id='meebo';m.style.display='none';m.innerHTML='<iframe id="meebo-iframe"></iframe>';s.src='http'+(q.https?'s':'')+'://'+(q.stage?'stage-':'')+'cim.meebo.com/cim/cim.php?network='+q.network;b.insertBefore(s,b.firstChild);})({network:'phoenixheartnet_bo16we'});}/*]]>*/</script> <item><title>How to configure nginx to run Kohana on Ubuntu</title><link>http://www.phoenixheart.net/2010/03/how-to-configure-nginx-to-run-kohana-on-ubuntu/</link> <comments>http://www.phoenixheart.net/2010/03/how-to-configure-nginx-to-run-kohana-on-ubuntu/#comments</comments> <pubDate>Mon, 01 Mar 2010 07:20:23 +0000</pubDate> <dc:creator>phoenix.heart</dc:creator> <category><![CDATA[Featured]]></category> <category><![CDATA[Server stuffs]]></category> <category><![CDATA[configure]]></category> <category><![CDATA[kohana]]></category> <category><![CDATA[nginx]]></category> <category><![CDATA[virtual host]]></category><guid
isPermaLink="false">http://www.phoenixheart.net/?p=440</guid> <description><![CDATA[As a web developer I&#8217;ve been using Apache for a long long time. Recently though, I&#8217;ve started to move away from Apache in favor of nginx (pronounced &#8220;engine-X&#8221;). It&#8217;s not that I really need its strength, it&#8217;s just that I wanted to learn something new to break my box. It&#8217;s fairly simple to set up [...]]]></description> <content:encoded><![CDATA[<p>As a web developer I&#8217;ve been using Apache for a long long time. Recently though, I&#8217;ve started to move away from Apache in favor of <a
title="nginx's homepage" href="http://nginx.org/">nginx</a> (pronounced &#8220;engine-X&#8221;). It&#8217;s not that I really need <a
title="nginx compared to Apache" href="http://www.joeandmotorboat.com/2008/02/28/apache-vs-nginx-web-server-performance-deathmatch/">its strength</a>, it&#8217;s just that I wanted to learn something new to break my box.</p><p>It&#8217;s fairly simple to set up and get nginx running with FastCGI and MySQL on Ubuntu &#8211; a very well-written tutorial can be read <a
href="http://www.howtoforge.com/installing-nginx-with-php5-and-mysql-support-on-ubuntu-8.10">on HowtoForge</a>, which should take you less than 15 minutes for everything. In this article therefore I will only write about how to configure nginx to actually run a <a
href="http://www.kohanaphp.com/">Kohana</a>-powered site, with virtual host and rewriting and such. If you&#8217;re not familiar with Kohana, take a look at <a
href="http://www.phoenixheart.net/2009/01/kohana-php-framework/">my article here</a>.</p><h3>The prerequisites</h3><ul><li>I have my Kohana-power site located under <code>/home/phoenixheart/www/my-kohana/</code> directory with proper permission set (owner being www-data, that is).</li><li>nginx has been set up properly and listening on port 80, with the configuration directory being <code>/etc/nginx/</code></li><li>I want my site to be locally accessible via my-kohana.dev. Any requests to www.my-kohana.dev should be permanently redirected to my-kohana.dev &#8211; which is also called &#8220;force non-www&#8221;.</li><li>I want to have neat URL rewriting without &#8220;index.php&#8221;, for example <code>index.php?controller=product&amp;function=get&amp;id=1</code> should be rewritten into <code>/product/get/1</code></li><li>I also want that all existing files and directories under the root directory are accessible, except Kohana&#8217;s system directories <code>system</code>, <code>application</code>, and <code>modules</code>. Any attempt to access system files and directories(beginning with dots, like .htaccess or .settings) should be disallowed also.</li></ul><p>All clear. So let&#8217;s do it!<br
/> <span
id="more-440"></span></p><h3>Set up the virtual host</h3><p>The way nginx handles virtual hosts is totally different from Apache, as we can expect. Instead of using .conf files to declare and configure the hosts, nginx, when started, additionally scans through the configuration folder (<code>/etc/nginx</code> in our case) to find (if any) configuration files under 2 directories: sites-available and sites-enabled. So under /etc/nginx/sites-available, create a file called my-kohana.dev with the following content:</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td
class="code"><pre class="php" style="font-family:monospace;">server <span style="color: #009900;">&#123;</span>
    listen   <span style="color: #cc66cc;">80</span><span style="color: #339933;">;</span>
    server_name my<span style="color: #339933;">-</span>kohana<span style="color: #339933;">.</span>dev<span style="color: #339933;">;</span>
&nbsp;
    access_log <span style="color: #339933;">/</span>home<span style="color: #339933;">/</span>phoenixheart<span style="color: #339933;">/</span>www<span style="color: #339933;">/</span><span style="color: #990000;">log</span><span style="color: #339933;">/</span>my<span style="color: #339933;">-</span>kohana<span style="color: #339933;">/</span>access<span style="color: #339933;">.</span><span style="color: #990000;">log</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;"># remember to create this file
</span>    <span style="color: #990000;">error_log</span> <span style="color: #339933;">/</span>home<span style="color: #339933;">/</span>phoenixheart<span style="color: #339933;">/</span>www<span style="color: #339933;">/</span><span style="color: #990000;">log</span><span style="color: #339933;">/</span>my<span style="color: #339933;">-</span>kohana<span style="color: #339933;">/</span>error<span style="color: #339933;">.</span><span style="color: #990000;">log</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;"># and this file
</span>
    location <span style="color: #339933;">/</span> <span style="color: #009900;">&#123;</span>
	root   <span style="color: #339933;">/</span>home<span style="color: #339933;">/</span>phoenixheart<span style="color: #339933;">/</span>www<span style="color: #339933;">/</span>my<span style="color: #339933;">-</span>kohana<span style="color: #339933;">;</span>
	index  index<span style="color: #339933;">.</span>php<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    location ~ \<span style="color: #339933;">.</span>php$ <span style="color: #009900;">&#123;</span>
	fastcgi_pass   127<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>1<span style="color: #339933;">:</span><span style="color: #cc66cc;">9000</span><span style="color: #339933;">;</span>
	fastcgi_index  index<span style="color: #339933;">.</span>php<span style="color: #339933;">;</span>
	fastcgi_param  SCRIPT_FILENAME  <span style="color: #339933;">/</span>home<span style="color: #339933;">/</span>phoenixheart<span style="color: #339933;">/</span>www<span style="color: #339933;">/</span>my<span style="color: #339933;">-</span>kohana<span style="color: #000088;">$fastcgi_script_name</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">include</span>        fastcgi_params<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div><p>Of course, this is just the basis configuration for the site to get up and running. To continue, we must create a host entry. Open /etc/hosts and add this line:</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
</pre></td><td
class="code"><pre class="php" style="font-family:monospace;">127<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>1	my<span style="color: #339933;">-</span>kohana<span style="color: #339933;">.</span>dev www<span style="color: #339933;">.</span>my<span style="color: #339933;">-</span>kohana<span style="color: #339933;">.</span>dev</pre></td></tr></table></div><p>If this was Apache, we would be good enough to restart the webserver to see the result. But like I said, nginx is different. For nginx to properly recognize and serve our site, we must <em>enable</em> the site by creating a symlink of the configuration file under <code>sites-enabled</code>. We do that as follow:</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;">ln <span style="color: #339933;">-</span>s <span style="color: #339933;">/</span>etc<span style="color: #339933;">/</span>nginx<span style="color: #339933;">/</span>sites<span style="color: #339933;">-</span>available<span style="color: #339933;">/</span>my<span style="color: #339933;">-</span>kohana<span style="color: #339933;">.</span>dev <span style="color: #339933;">/</span>etc<span style="color: #339933;">/</span>nginx<span style="color: #339933;">/</span>sites<span style="color: #339933;">-</span>enabled<span style="color: #339933;">/</span>my<span style="color: #339933;">-</span>kohana<span style="color: #339933;">.</span>dev</pre></div></div><p>Now, let&#8217;s restart nginx. Open Terminal and type:</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;">sudo <span style="color: #339933;">/</span>etc<span style="color: #339933;">/</span>init<span style="color: #339933;">.</span>d<span style="color: #339933;">/</span>nginx restart</pre></div></div><p>The result should be as followed:</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;">Restarting nginx<span style="color: #339933;">:</span> the configuration <span style="color: #990000;">file</span> <span style="color: #339933;">/</span>etc<span style="color: #339933;">/</span>nginx<span style="color: #339933;">/</span>nginx<span style="color: #339933;">.</span>conf syntax is ok
configuration <span style="color: #990000;">file</span> <span style="color: #339933;">/</span>etc<span style="color: #339933;">/</span>nginx<span style="color: #339933;">/</span>nginx<span style="color: #339933;">.</span>conf test is successful
nginx<span style="color: #339933;">.</span></pre></div></div><p>If you receive any &#8220;failure&#8221; response, chance is some typos in the configuration.</p><p>Now, http://my-kohana.dev should be accessible via the browser (Note that, if Kohana complains about the logs folder inaccessible, try properly setting its owner to www-data). Next step is tweaking the configuration a bit to serve our needs.</p><h3>Tweak it up</h3><h4>Force non-www</h4><p>To force non-www, open sites-available/my-kohana.dev and add these lines at the top:</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
</pre></td><td
class="code"><pre class="php" style="font-family:monospace;">server <span style="color: #009900;">&#123;</span>
    listen <span style="color: #cc66cc;">80</span><span style="color: #339933;">;</span>
    server_name www<span style="color: #339933;">.</span>my<span style="color: #339933;">-</span>kohana<span style="color: #339933;">.</span>dev<span style="color: #339933;">;</span>
    rewrite  ^<span style="color: #339933;">/</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">.*</span><span style="color: #009900;">&#41;</span>$  http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//my-kohana.dev/$1  permanent;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div><p>This kind of configuration is very similar to that of Apache, so I would assume there&#8217;s no need to explain. After a nginx restart, all request to http://www.my-kohana.dev should be silently redirected to http://my-kohana.dev.</p><h4>Neat URL rewriting</h4><p>Again, in sites-available/my-kohana.dev, modify the first <code>location</code> block to the following</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td
class="code"><pre class="php" style="font-family:monospace;">location <span style="color: #339933;">/</span> <span style="color: #009900;">&#123;</span>
    root   <span style="color: #339933;">/</span>home<span style="color: #339933;">/</span>phoenixheart<span style="color: #339933;">/</span>www<span style="color: #339933;">/</span>my<span style="color: #339933;">-</span>kohana<span style="color: #339933;">;</span>
    index  index<span style="color: #339933;">.</span>php<span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;"># this is where the rewriting gets done.
</span>    <span style="color: #666666; font-style: italic;"># refer to http://forum.kohanaphp.com/comments.php?DiscussionID=1505 for more info
</span>    rewrite ^<span style="color: #009900;">&#40;</span><span style="color: #339933;">.+</span><span style="color: #009900;">&#41;</span>$ <span style="color: #339933;">/</span>index<span style="color: #339933;">.</span>php?kohana_uri<span style="color: #339933;">=</span>$<span style="color: #cc66cc;">1</span> last<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div><p>But wait! We don&#8217;t want EVERY requests to be re-written. For example, a request to my-kohana.dev/css/style.css should be kept as-is. Same goes with javascripts and images. In short, if the request is for an existing file or folder, we keep it as-is; else, we route it to index.php using rewriting. To achieve that, modify the configuration above to this:</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td
class="code"><pre class="php" style="font-family:monospace;">location <span style="color: #339933;">/</span> <span style="color: #009900;">&#123;</span>
    root   <span style="color: #339933;">/</span>home<span style="color: #339933;">/</span>phoenixheart<span style="color: #339933;">/</span>www<span style="color: #339933;">/</span>my<span style="color: #339933;">-</span>kohana<span style="color: #339933;">;</span>
    index  index<span style="color: #339933;">.</span>php<span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span>f <span style="color: #000088;">$request_filename</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;"># translated into &quot;if the request is an existing file, break (do nothing)&quot;
</span>        <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span>d <span style="color: #000088;">$request_filename</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;"># translated into &quot;if the request is an existing directory, break (do nothing)&quot;
</span>        <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;"># the request is not an existing file or directory
</span>    <span style="color: #666666; font-style: italic;"># this is where the rewriting gets done.
</span>    <span style="color: #666666; font-style: italic;"># refer to http://forum.kohanaphp.com/comments.php?DiscussionID=1505 for more info
</span>    rewrite ^<span style="color: #009900;">&#40;</span><span style="color: #339933;">.+</span><span style="color: #009900;">&#41;</span>$ <span style="color: #339933;">/</span>index<span style="color: #339933;">.</span>php?kohana_uri<span style="color: #339933;">=</span>$<span style="color: #cc66cc;">1</span> last<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div><h4>Set files and folder accessibilities</h4><p>Now, we prohibit access to the sensitive stuffs, including kohana system folders, dot files and directories etc. It&#8217;s fairly simple with nginx. All we need to do is adding two more location blocks, specific for this purpose:</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td
class="code"><pre class="php" style="font-family:monospace;">location ~ <span style="color: #339933;">/</span>\<span style="color: #339933;">.</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">404</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;"># or, if you prefer
</span>    <span style="color: #666666; font-style: italic;">#return 403;
</span>    <span style="color: #666666; font-style: italic;"># or even
</span>    <span style="color: #666666; font-style: italic;">#deny all;
</span><span style="color: #009900;">&#125;</span>
location ~<span style="color: #339933;">*</span> ^<span style="color: #339933;">/</span><span style="color: #009900;">&#40;</span>modules<span style="color: #339933;">|</span>application<span style="color: #339933;">|</span>system<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">404</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;"># or, if you prefer
</span>    <span style="color: #666666; font-style: italic;">#return 403;
</span>    <span style="color: #666666; font-style: italic;"># or even
</span>    <span style="color: #666666; font-style: italic;">#deny all;
</span><span style="color: #009900;">&#125;</span></pre></td></tr></table></div><p>The final configuration file should look like this:</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
</pre></td><td
class="code"><pre class="php" style="font-family:monospace;">server <span style="color: #009900;">&#123;</span>
    listen <span style="color: #cc66cc;">80</span><span style="color: #339933;">;</span>
    server_name www<span style="color: #339933;">.</span>my<span style="color: #339933;">-</span>kohana<span style="color: #339933;">.</span>dev<span style="color: #339933;">;</span>
    rewrite  ^<span style="color: #339933;">/</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">.*</span><span style="color: #009900;">&#41;</span>$  http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//my-kohana.dev/$1  permanent;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
server <span style="color: #009900;">&#123;</span>
    listen   <span style="color: #cc66cc;">80</span><span style="color: #339933;">;</span>
    server_name my<span style="color: #339933;">-</span>kohana<span style="color: #339933;">.</span>dev<span style="color: #339933;">;</span>
&nbsp;
    access_log <span style="color: #339933;">/</span>home<span style="color: #339933;">/</span>phoenixheart<span style="color: #339933;">/</span>www<span style="color: #339933;">/</span><span style="color: #990000;">log</span><span style="color: #339933;">/</span>my<span style="color: #339933;">-</span>kohana<span style="color: #339933;">.</span>dev<span style="color: #339933;">.</span>access<span style="color: #339933;">.</span><span style="color: #990000;">log</span><span style="color: #339933;">;</span>
    <span style="color: #990000;">error_log</span> <span style="color: #339933;">/</span>home<span style="color: #339933;">/</span>phoenixheart<span style="color: #339933;">/</span>www<span style="color: #339933;">/</span><span style="color: #990000;">log</span><span style="color: #339933;">/</span>my<span style="color: #339933;">-</span>kohana<span style="color: #339933;">.</span>dev<span style="color: #339933;">.</span>error<span style="color: #339933;">.</span><span style="color: #990000;">log</span><span style="color: #339933;">;</span>
&nbsp;
    location ~ <span style="color: #339933;">/</span>\<span style="color: #339933;">.</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">404</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    location <span style="color: #339933;">/</span> <span style="color: #009900;">&#123;</span>
        root   <span style="color: #339933;">/</span>home<span style="color: #339933;">/</span>phoenixheart<span style="color: #339933;">/</span>www<span style="color: #339933;">/</span>my<span style="color: #339933;">-</span>kohana<span style="color: #339933;">;</span>
        index  index<span style="color: #339933;">.</span>php<span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span>f <span style="color: #000088;">$request_filename</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #666666; font-style: italic;"># translated into &quot;if the request is an existing file, break (do nothing)&quot;
</span>            <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span>d <span style="color: #000088;">$request_filename</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #666666; font-style: italic;"># translated into &quot;if the request is an existing directory, break (do nothing)&quot;
</span>            <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;"># the request is not an existing file or directory
</span>        <span style="color: #666666; font-style: italic;"># this is where the rewriting gets done.
</span>        <span style="color: #666666; font-style: italic;"># refer to http://forum.kohanaphp.com/comments.php?DiscussionID=1505 for more info
</span>        rewrite ^<span style="color: #009900;">&#40;</span><span style="color: #339933;">.+</span><span style="color: #009900;">&#41;</span>$ <span style="color: #339933;">/</span>index<span style="color: #339933;">.</span>php?kohana_uri<span style="color: #339933;">=</span>$<span style="color: #cc66cc;">1</span> last<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    location ~ \<span style="color: #339933;">.</span>php$ <span style="color: #009900;">&#123;</span>
        fastcgi_pass   127<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>1<span style="color: #339933;">:</span><span style="color: #cc66cc;">9000</span><span style="color: #339933;">;</span>
        fastcgi_index  index<span style="color: #339933;">.</span>php<span style="color: #339933;">;</span>
        fastcgi_param  SCRIPT_FILENAME  <span style="color: #339933;">/</span>home<span style="color: #339933;">/</span>phoenixheart<span style="color: #339933;">/</span>www<span style="color: #339933;">/</span>my<span style="color: #339933;">-</span>kohana<span style="color: #000088;">$fastcgi_script_name</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">include</span>        fastcgi_params<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    location ~<span style="color: #339933;">*</span> ^<span style="color: #339933;">/</span><span style="color: #009900;">&#40;</span>modules<span style="color: #339933;">|</span>application<span style="color: #339933;">|</span>system<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">403</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div><p>After another nginx restart, our Kohana instance should run without any hassles.</p><p>Typos? Mistakes? Errors? Let&#8217;s hear it in your comment.</p> <img
style='display:none' id="post-440-blankimage" onload="Meebo('discoverSharable', {element: ((this.parentNode.className.match('post')) ? this.parentNode : this.parentNode.parentNode) ,url:'http://www.phoenixheart.net/2010/03/how-to-configure-nginx-to-run-kohana-on-ubuntu/',title:'How to configure nginx to run Kohana on Ubuntu',tweet:'As a web developer I&#8217;ve been using Apache for a long long time. Recently though, I&#8217;ve st',description:'As a web developer I&#8217;ve been using Apache for a long long time. Recently though, I&#8217;ve st'})"><script type='text/javascript'>document.getElementById("post-440-blankimage").onload();</script>]]></content:encoded> <wfw:commentRss>http://www.phoenixheart.net/2010/03/how-to-configure-nginx-to-run-kohana-on-ubuntu/feed/</wfw:commentRss> <slash:comments>6</slash:comments> </item> <item><title>Kohana PHP framework</title><link>http://www.phoenixheart.net/2009/01/kohana-php-framework/</link> <comments>http://www.phoenixheart.net/2009/01/kohana-php-framework/#comments</comments> <pubDate>Tue, 13 Jan 2009 04:24:06 +0000</pubDate> <dc:creator>phoenix.heart</dc:creator> <category><![CDATA[Featured]]></category> <category><![CDATA[Freebies]]></category> <category><![CDATA[Server stuffs]]></category> <category><![CDATA[CodeIgniter]]></category> <category><![CDATA[framework]]></category> <category><![CDATA[kohana]]></category> <category><![CDATA[php]]></category><guid
isPermaLink="false">http://www.phoenixheart.net/?p=210</guid> <description><![CDATA[You know, I&#8217;m a die-hard fan of CodeIgniter. Among a lot of PHP frameworks out there, I prefer CI over Zend, Cake, Symfony etc. because of its speed, efficiency, and most importantly, simplicity. Just download it, unzip into a folder, and call it done. To me, a framework that costs me more than 10 minutes [...]]]></description> <content:encoded><![CDATA[<p><span
class="drop-cap">Y</span>ou know, I&#8217;m a die-hard fan of <a
href="http://www.codeigniter.com">CodeIgniter</a>. Among a lot of PHP frameworks out there, I prefer CI over Zend, Cake, Symfony etc. because of its speed, efficiency, and most importantly, simplicity. Just download it, unzip into a folder, and call it done. To me, a framework that costs me more than 10 minutes to install is considered failure &#8211; Symfony is one.</p><p>With simplicity and efficiency being the priority in mind, several days ago, I discovered <a
href="http://www.kohanaphp.com">Kohana</a> and was impressed. As clearly specified on its homepage, Kohana was originally based on CodeIgniter, so CI users should find no difficulties migrating. Then, along its (community-driven) development way, Kohana has grown quite a bit, and now looks like a very promising PHP framework. Among its features:</p><ul><li>Highly secure</li><li>Extremely lightweight</li><li>Short learning curve</li><li>Uses the MVC pattern</li><li>100% UTF-8 compatible</li><li>Loosely coupled architecture</li><li>Extremely easy to extend</li></ul><p><span
id="more-210"></span><br
/> And the things make it stand out from the crowd:</p><ol><li>Community, not company, driven. Kohana development is driven by a team of dedicated people that need a framework for fast, powerful solutions.</li><li>Strict PHP 5 OOP. Offers many benefits: visibility protection, automatic class loading, overloading, interfaces, abstracts, and singletons.</li><li>Extremely lightweight. Kohana has no dependencies on PECL extensions or PEAR libraries. Large, monolithic libraries are avoided in favor of optimized solutions.</li><li>GET, POST, COOKIE, and SESSION arrays all work as expected. Kohana does not limit your access to global data, but offers filtering and XSS protection.</li><li>True auto-loading of classes. True on-demand loading of classes, as they are requested in your application.</li><li>No namespace conflicts. All classes are suffixed to allow similar names between components, for a more coherent API.</li><li>Cascading resources offer unparalleled extensibility. Almost every part of Kohana can be overloaded or extended without editing core system files. Modules allow multi-file plugins to be added to your application, transparently.</li><li>Library drivers and API consistency. Libraries can use different &#8220;drivers&#8221; to handle different external APIs transparently. For example, multiple session storage options are available (database, cookie, and native), but the same interface is used for all of them. This allows new drivers to be developed for existing libraries, which keeps the API consistent and transparent.</li><li>Powerful event handler. Observer-style event handlers allow for extreme levels of customization potential.</li><li>Rapid development cycle. Rapid development results in faster response to user bugs and requests.</li></ol><p>You can tell that, originally a fork from CodeIgniter, Kohana should inherit the best from CI when having many improvements. Yes, it&#8217;s true. First, it&#8217;s PHP 5, so you can take full advantages of the new features available in this version. Second, it doesn&#8217;t limit your data in POST and SESSION as CI does (by default, CI disables GET, and it was a nightmare for me trying to integrate Google Custom Search into my CI-based website). Third, it has cool libraries, with the most powerful being <abbr
title="Object Relational Mapping">ORM</abbr>, which is a must-have for serious enterprise application.</p><p>With this being said, I&#8217;ll not dust away CodeIgniter anytime soon. Nevertheless, CI is already mature, with a good userbase, when Kohana is still in its beginning phase and thus has true support limitations. Both have their own pros and cons, so while sticking with CI, I will start playing around with Kohana.</p><p>To my readers: please spread the words! Kohana is definitely a very promising PHP framework. By featuring it on your own blog, you&#8217;re helping an free, useful, open-source, community-driven application grow. That also is contribution <img
src='http://www.phoenixheart.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p> <img
style='display:none' id="post-210-blankimage" onload="Meebo('discoverSharable', {element: ((this.parentNode.className.match('post')) ? this.parentNode : this.parentNode.parentNode) ,url:'http://www.phoenixheart.net/2009/01/kohana-php-framework/',title:'Kohana PHP framework',tweet:'You know, I&#8217;m a die-hard fan of CodeIgniter. Among a lot of PHP frameworks out there, I prefer',description:'You know, I&#8217;m a die-hard fan of CodeIgniter. Among a lot of PHP frameworks out there, I prefer'})"><script type='text/javascript'>document.getElementById("post-210-blankimage").onload();</script>]]></content:encoded> <wfw:commentRss>http://www.phoenixheart.net/2009/01/kohana-php-framework/feed/</wfw:commentRss> <slash:comments>8</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)
Database Caching 3/11 queries in 0.071 seconds using disk

Served from: www.phoenixheart.net @ 2010-09-09 07:52:24 -->