<?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>blog.khax.net</title>
	<atom:link href="http://blog.khax.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.khax.net</link>
	<description>Webdev &#38; Devops Blog</description>
	<lastBuildDate>Thu, 22 Sep 2011 05:24:35 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Setup notes: nginx + wordpress multi site</title>
		<link>http://blog.khax.net/2011/09/22/setup-notes-nginx-wordpress-multi-site/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=setup-notes-nginx-wordpress-multi-site</link>
		<comments>http://blog.khax.net/2011/09/22/setup-notes-nginx-wordpress-multi-site/#comments</comments>
		<pubDate>Thu, 22 Sep 2011 05:24:35 +0000</pubDate>
		<dc:creator>karl</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://kh4x.com/?p=37</guid>
		<description><![CDATA[Substitute domain_name1.com: Your domain name extra_domain_name.com: Extra domains if your also using extra domain mapping in wordpress file_root: Path to your wordpress install Files /etc/nginx/sites-available/domain_name1.com # WordPress Multi Site Domain server { listen 80 ; server_name .domain_name1.com .extra_domain_name.com; root /file_root/wordpress; index index.php index.html index.htm; # Rewrite for multi site files rewrite /files/(.+)$ /wp-includes/ms-files.php?file=$1 last; # [...]]]></description>
			<content:encoded><![CDATA[<h3>Substitute</h3>
<ul>
<li>domain_name1.com: Your domain name</li>
<li>extra_domain_name.com: Extra domains if your also using extra domain mapping in wordpress</li>
<li>file_root: Path to your wordpress install</li>
</ul>
<p><span id="more-37"></span></p>
<h3>Files</h3>
<h4>/etc/nginx/sites-available/domain_name1.com</h4>
<pre>
# WordPress Multi Site Domain
server {
    listen 80 ;
    server_name .domain_name1.com .extra_domain_name.com;

    root /file_root/wordpress;
    index index.php index.html index.htm;

    # Rewrite for multi site files
    rewrite /files/(.+)$ /wp-includes/ms-files.php?file=$1 last;

    # Rewrite for wordpress
    if (!-e $request_filename) {
        rewrite ^(.+)$ /index.php?q=$1 last;
    }

    location ~ .php$ {
        fastcgi_pass    unix:/tmp/php-fastcgi.socket; # or port like 127.0.0.1:9000
        fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include         fastcgi_params;
    }
}
</pre>
<h3>Finish</h3>
<pre>
sudo ln -s /etc/nginx/sites-available/domain_name.com /etc/nginx/sites-enabled/domain_name.com
sudo service nginx restart
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.khax.net/2011/09/22/setup-notes-nginx-wordpress-multi-site/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Setup notes [ubuntu]: nginx + upstart php-cgi</title>
		<link>http://blog.khax.net/2011/09/19/setup-notes-ubuntu-nginx-upstart-php-cgi/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=setup-notes-ubuntu-nginx-upstart-php-cgi</link>
		<comments>http://blog.khax.net/2011/09/19/setup-notes-ubuntu-nginx-upstart-php-cgi/#comments</comments>
		<pubDate>Mon, 19 Sep 2011 07:36:01 +0000</pubDate>
		<dc:creator>karl</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[phpmyadmin]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://kh4x.com/?p=39</guid>
		<description><![CDATA[Quick setup guide for serving php pages with nginx on Ubuntu Goal: serve phpmyadmin from the local machine from /opt/phpmyadmin answering to the domain http://phpmyadmin.local/ Used in this guide: Ubuntu 11.04 nginx 0.8.54 php5-cgi 5.3.5 phpmyadmin 3.4.5 Packages: [shell] sudo apt-get install nginx php5-cgi [/shell] Extras: [shell] sudo apt-get install php5-gd php5-mcrypt php5-mysql [/shell] Files: [...]]]></description>
			<content:encoded><![CDATA[<h1>Quick setup guide for serving php pages with nginx on Ubuntu</h1>
<p><strong>Goal:</strong> serve phpmyadmin from the local machine from /opt/phpmyadmin answering to the domain http://phpmyadmin.local/</p>
<h2>Used in this guide:</h2>
<ul>
<li>Ubuntu 11.04</li>
<li>nginx 0.8.54</li>
<li>php5-cgi 5.3.5</li>
<li>phpmyadmin 3.4.5</li>
</ul>
<p><span id="more-39"></span></p>
<h2>Packages:</h2>
<div>[shell]<br />
sudo apt-get install nginx php5-cgi<br />
[/shell]</div>
<h3>Extras:</h3>
<div>[shell]<br />
sudo apt-get install php5-gd php5-mcrypt php5-mysql<br />
[/shell]</div>
<h2>Files:</h2>
<p><strong>Append to: /etc/hosts</strong></p>
<div>[shell]<br />
127.0.1.1    phpmyadmin.local<br />
[/shell]</div>
<p><strong>/etc/init/php-fastcgi.conf</strong></p>
<div>[shell]<br />
# /etc/init/php-fastcgi.conf<br />
# php-fastcgi &#8211; starts php-cgi as an external FASTCGI process</p>
<p>description &#8220;php-fastcgi &#8211; keep up php-fastcgi&#8221;</p>
<p>start on runlevel [2345]<br />
stop on runlevel [!2345]<br />
respawn<br />
exec /usr/bin/sudo -u www-data PHP_FCGI_CHILDREN=5 PHP_FCGI_MAX_REQUESTS=125 /usr/bin/php-cgi -q -b /tmp/php-fastcgi.socket<br />
[/shell]</p></div>
<p><strong>/etc/nginx/sites-available/phpmyadmin.local</strong></p>
<div>[shell]<br />
server {<br />
        listen  80;<br />
        server_name phpmyadmin.local;</p>
<p>        root /opt/phpmyadmin;<br />
        index index.php;</p>
<p>        location ~ .php$ {<br />
                fastcgi_pass    unix:/tmp/php-fastcgi.socket;<br />
                fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;<br />
                include         fastcgi_params;<br />
        }</p>
<p>}<br />
[/shell]</p></div>
<h2>Install phpmyadmin</h2>
<p>Get latest package from: <a title="http://www.phpmyadmin.net/home_page/downloads.php" href="http://www.phpmyadmin.net/home_page/downloads.php" target="_blank">http://www.phpmyadmin.net/home_page/downloads.php</a></p>
<div>[shell]<br />
cd /tmp<br />
wget &#8220;http://sourceforge.net/projects/phpmyadmin/files%2FphpMyAdmin%2F3.4.5%2FphpMyAdmin-3.4.5-english.tar.bz2&#8243;<br />
sudo mkdir /opt/phpmyadmin<br />
cd /opt/phpmyadmin<br />
sudo tar -xvf /tmp/phpMyAdmin-3.4.5-english.tar.bz2 &#8211;strip-components=1<br />
sudo config.sample.inc.php sudo config.inc.php<br />
sudo vim sudo config.inc.php # Configure for local settings<br />
sudo chown www-data:www-data -R /opt/phpmyadmin<br />
[/shell]</div>
<h2>Putting it all together</h2>
<div>[shell]<br />
sudo service php-fastcgi start<br />
sudo ln -s /etc/nginx/sites-available/phpmyadmin /etc/nginx/sites-enabled/phpmyadmin<br />
sudo service nginx restart<br />
[/shell]</div>
<p>You should now be able to navigate to <a href="http://phpmyadmin.local/" target="_blank">http://phpmyadmin.local/</a> to configure and access phpmyadmin</p>
<h2>WARNING:</h2>
<p>I have not proof tested these notes yet. I will remove this warning when tested.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.khax.net/2011/09/19/setup-notes-ubuntu-nginx-upstart-php-cgi/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>CSS Callout Tooltips</title>
		<link>http://blog.khax.net/2010/11/08/css-callout-tooltips/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=css-callout-tooltips</link>
		<comments>http://blog.khax.net/2010/11/08/css-callout-tooltips/#comments</comments>
		<pubDate>Mon, 08 Nov 2010 04:04:09 +0000</pubDate>
		<dc:creator>karl</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[tooltips]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://blog.khax.net/?p=189</guid>
		<description><![CDATA[Feeling inspired by the Chris Coyier article on triangle breadcrumbs (http://css-tricks.com/triangle-breadcrumbs/) I could see lots of potential for the css triangles. I&#8217;ve lately been a sucker for the power of css, and trying to limit the number of images used. So lets get started at building the tooltips without a single image. HTML We&#8217;ll build a [...]]]></description>
			<content:encoded><![CDATA[<p>Feeling inspired by the Chris Coyier article on triangle breadcrumbs (<a href="http://css-tricks.com/triangle-breadcrumbs/">http://css-tricks.com/triangle-breadcrumbs/</a>) I could see lots of potential for the css triangles.</p>
<p>I&#8217;ve lately been a sucker for the power of css, and trying to limit the number of images used. So lets get started at building the tooltips without a single image.</p>
<p style="text-align:center"><img class="aligncenter size-full wp-image-194" src="http://www1.khax.net/wp-content/uploads/2010/11/screenshot-5.jpg" alt="" width="590" height="253" /><br />
<a href="http://dl.dropbox.com/u/173699/css-help-text/index6.html"><img class="size-full wp-image-196 aligncenter" src="http://www1.khax.net/wp-content/uploads/2010/11/demo.png" alt="" width="71" height="31" /></a></p>
<p><span id="more-189"></span></p>
<h1>HTML</h1>
<p>We&#8217;ll build a form with popup help descriptions that appear when you mouse over or focus a field. I have not thought about how else to apply this technique, but I&#8217;d love to hear how you have adopted it.</p>
<p>We will start with a form definition, with a username and password fields. You could use a horizontal menu navigation with tooltip descriptions.</p>
<h2>Step 1: Accessible form</h2>
<pre>
&lt;form&gt;
    &lt;ul&gt;
        &lt;li&gt;
            &lt;label for='#username'&gt;Username&lt;/label&gt;
            &lt;input type='text' id='username' name='username'/&gt;
            &lt;span class='help_text' id='username_help_text'&gt;
                Your username must be unique
            &lt;/span&gt;
        &lt;/li&gt;
        &lt;li&gt;
            &lt;label for='#password'&gt;Password&lt;/label&gt;
            &lt;input type='password' id='password' name='password'/&gt;
            &lt;span class='help_text' id='password_help_text'&gt;
                &lt;h2&gt;Password help&lt;/h4&gt;
                &lt;p&gt;Your password must be at least four characters long.&lt;/p&gt;
                &lt;p&gt;You should not use the same password on multiple sites.&lt;/p&gt;
            &lt;/span&gt;
        &lt;/li&gt;
    &lt;/ul&gt;
&lt;/form&gt;
</pre>
<p><a href="http://dl.dropbox.com/u/173699/css-help-text/index1.html"><img class="alignnone" src="http://www1.khax.net/wp-content/uploads/2010/11/demo.png" alt="" width="71" height="31" /></a></p>
<p>So far we have a plain form. It&#8217;s a perfect start to an accessible form. The help text&#8217;s are wrapped in a class identified span this can be whatever you want as long as it&#8217;s able to be addressed in css. The spans here work well with the Django output I am using. The id&#8217;s on the spans are just there to give us more options with javascript later.</p>
<p>There are two field help texts, the first is a plain text that fits beside the field, the second example being a much more verbose description with heading and paragraphs.</p>
<h1>CSS</h1>
<h2>Step 2: Form styling</h2>
<p>[sourcecode language="css" wraplines="false"]<br />
body {<br />
    font-family: arial, sans;<br />
}<br />
input[type=&quot;text&quot;],<br />
input[type=&quot;password&quot;] {<br />
    border: 1px solid #ccc;<br />
}<br />
ul {<br />
    width: 310px;<br />
    list-style: none;<br />
    margin: 0;<br />
    padding: 10px;<br />
    border: 1px solid #ccc;<br />
    background: #efefef;<br />
}<br />
li {<br />
    padding: 10px 0;<br />
    margin: 0;<br />
}<br />
label, input {<br />
    display: block;<br />
    width: 99%;<br />
}<br />
[/sourcecode]</p>
<p><a href="http://dl.dropbox.com/u/173699/css-help-text/index2.html"><img class="alignnone size-full wp-image-196" src="http://www1.khax.net/wp-content/uploads/2010/11/demo.png" alt="" width="71" height="31" /></a></p>
<h2>Step 3: Help text styling</h2>
<p>[sourcecode language="css"]<br />
.help_text {<br />
    -webkit-border-radius: 5px;<br />
    -moz-border-radius: 5px;<br />
    border-radius: 5px;<br />
    border: 1px solid #ccc;<br />
    background: #ccf;<br />
    padding: 10px;<br />
    display: block;<br />
}<br />
.help_text h2 {<br />
    margin-top: 0;<br />
}<br />
[/sourcecode]</p>
<p><a href="http://dl.dropbox.com/u/173699/css-help-text/index3.html"><img class="alignnone size-full wp-image-196" src="http://www1.khax.net/wp-content/uploads/2010/11/demo.png" alt="" width="71" height="31" /></a></p>
<p>Now comes the more interesting styling. The help text gets rounded borders where supported, plus a little bit of padding and colour.</p>
<h2>Step 4: Callout positioning</h2>
<p>[sourcecode language="css" highlight="2,15,16,17,18,19"]<br />
li {<br />
    position: relative;<br />
    padding: 10px 0;<br />
    margin: 0;<br />
}<br />
.help_text {<br />
    -webkit-border-radius: 5px;<br />
    -moz-border-radius: 5px;<br />
    border-radius: 5px;<br />
    border: 1px solid #ccc;<br />
    background: #ccf;<br />
    padding: 10px;<br />
    display: block;</p>
<p>    position: absolute;<br />
    top: 25px;<br />
    left: 100%;<br />
    width: 310px;<br />
    margin-left: 20px;<br />
}</p>
<p>[/sourcecode]</p>
<p><a href="http://dl.dropbox.com/u/173699/css-help-text/index4.html"><img class="alignnone size-full wp-image-196" src="http://www1.khax.net/wp-content/uploads/2010/11/demo.png" alt="" width="71" height="31" /></a></p>
<p>To position the help text to the right we use absolute positioning. To make the left: 100% work we need to make the parent element (li) relative. Then we just use margins to offset from there. If you create a larger triangle later on then the margin-left can be adjusted here to correct the positioning.</p>
<h2>Step 5: Callout triangles</h2>
<p>[sourcecode language="css"]<br />
.help_text:before,<br />
.help_text:after {<br />
    content: &#8221;;<br />
    position: absolute;<br />
    width: 0;<br />
    height: 0;<br />
    top: 5px;<br />
    border-top: 10px solid transparent;<br />
    border-bottom: 10px solid transparent;<br />
}</p>
<p>.help_text:before {<br />
    left: -10px;<br />
    border-right: 10px solid #ccc;<br />
}</p>
<p>.help_text:after {<br />
    left: -9px;<br />
    border-right: 10px solid #ccf;<br />
}<br />
[/sourcecode]</p>
<p><a href="http://dl.dropbox.com/u/173699/css-help-text/index5.html"><img class="alignnone size-full wp-image-196" src="http://www1.khax.net/wp-content/uploads/2010/11/demo.png" alt="" width="71" height="31" /></a></p>
<p>Two triangles are created, one &#8216;before&#8217; using the background colour and one &#8216;after&#8217; using the foreground colour. This gives us the illusion of an outlined triangle. The triangles are placed offset relative to the parent. So once the triangle size is adjusted the position will need to be tweaked again to look correct.</p>
<h2>Step 6: Hidden until needed</h2>
<p>[sourcecode language="css" highlight="15,17,18,19,20,21,22"]<br />
.help_text {<br />
    -webkit-border-radius: 5px;<br />
    -moz-border-radius: 5px;<br />
    border-radius: 5px;<br />
    border: 1px solid #ccc;<br />
    background: #ccf;<br />
    padding: 10px;<br />
    display: block;</p>
<p>    position: absolute;<br />
    top: 25px;<br />
    left: 100%;<br />
    width: 310px;<br />
    margin-left: 20px;<br />
    display: none;<br />
}<br />
li:hover .help_text {<br />
    display: block;<br />
}<br />
input:focus + .help_text {<br />
    display: block;<br />
}<br />
[/sourcecode]</p>
<p><a href="http://dl.dropbox.com/u/173699/css-help-text/index6.html"><img class="alignnone size-full wp-image-196" src="http://www1.khax.net/wp-content/uploads/2010/11/demo.png" alt="" width="71" height="31" /></a></p>
<p>Ad the final css is for hiding the callouts until needed. The demo includes two examples of how to achieve this and there are boundless more ways of doing it. The li.hover will display the callout when the mouse is over the field section, and the input:focus displays the callout when the field is focused. The input:focus will only work if the .help_text is directly after the input field.</p>
<p><span style="font-size:26px;font-weight:bold">Compatibility</span></p>
<p>Compatibility is left as an exercise to the reader. When this type of progressive enhancement is used in production I&#8217;m happy to accommodate the &#8216;bling&#8217; only for browsers that support it (think rounded corners and triangles using before/after) as the &#8216;bling&#8217; is only for enhancement and the site&#8217;s usability is not reduced without it.</p>
<p><span style="font-size:20px;font-weight:bold">IE6</span></p>
<p>IE6 is about the only consideration that may be needed depending on your audience.</p>
<p>IE6 does not support the hover selector, but that can be handled by using a shim or javascript, and it does not support the before and after selectors. The help is still clearly identifiable without the triangle, but for consistency can be done by either adding more tags for the triangles either on the server side or by javascript and styling the extra tags,</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.khax.net/2010/11/08/css-callout-tooltips/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CSS3 imageless gradient buttons</title>
		<link>http://blog.khax.net/2010/07/08/css3-imageless-gradient-buttons/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=css3-imageless-gradient-buttons</link>
		<comments>http://blog.khax.net/2010/07/08/css3-imageless-gradient-buttons/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 02:00:25 +0000</pubDate>
		<dc:creator>karl</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[buttons]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://blog.khax.net/?p=182</guid>
		<description><![CDATA[Jay posted some great looking buttons over at Anomaly:  http://blog.anomalyinnovations.com/2010/03/creating-a-realistic-looking-button-with-css3/ To follow on from there I have updated (hacked) the example to use CSS3 gradients instead of images. Unsupported browsers fallback to solid colour backgrounds. I am not using these examples in the wild. They need a lot more polish before being released. Image fallback could [...]]]></description>
			<content:encoded><![CDATA[<p>Jay posted some great looking buttons over at Anomaly:  <a href="http://blog.anomalyinnovations.com/2010/03/creating-a-realistic-looking-button-with-css3/">http://blog.anomalyinnovations.com/2010/03/creating-a-realistic-looking-button-with-css3/</a></p>
<p>To follow on from there I have updated (hacked) the example to use CSS3 gradients instead of images. Unsupported browsers fallback to solid colour backgrounds.</p>
<p>I am not using these examples in the wild. They need a lot more polish before being released. Image fallback could be added back in for example. It was just to show examples of how the CSS3 gradient buttons look and function in Firefox and Chrome.</p>
<p>Button code:</p>
<pre>&lt;a class='button'&gt;&lt;b class='o'&gt;&lt;b class='m'&gt;&lt;b&gt;Button&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/a&gt;</pre>
<p>Results in various browsers:</p>
<p><a href="http://www1.khax.net/wp-content/uploads/2010/07/css3-buttons.png"><img class="aligncenter size-full wp-image-183" src="http://www1.khax.net/wp-content/uploads/2010/07/css3-buttons.png" alt="" width="272" height="254" /></a></p>
<p>Check out the example code at: <a href="http://dl.dropbox.com/u/173699/css3-buttons.html">http://dl.dropbox.com/u/173699/css3-buttons.html</a></p>
<p>- Karl</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.khax.net/2010/07/08/css3-imageless-gradient-buttons/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>nginx + mongrel + redmine &#8211; quick setup notes</title>
		<link>http://blog.khax.net/2010/04/01/nginx-mongrel-redmine-quick-setup-notes/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=nginx-mongrel-redmine-quick-setup-notes</link>
		<comments>http://blog.khax.net/2010/04/01/nginx-mongrel-redmine-quick-setup-notes/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 06:12:43 +0000</pubDate>
		<dc:creator>karl</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.khax.net/?p=173</guid>
		<description><![CDATA[My quick setup notes for nginx as a frontend to a mongrel redmine server. This is intended for situations where redmine needs to be served in a subdirectory via a nginx that is also used for other serving needs. Some basic prerequisite knowledge of nginx and redmine will likely be needed. Instructions are tested on [...]]]></description>
			<content:encoded><![CDATA[<p>My quick setup notes for nginx as a frontend to a mongrel redmine server.</p>
<p>This is intended for situations where redmine needs to be served in a subdirectory via a nginx that is also used for other serving needs.</p>
<p>Some basic prerequisite knowledge of nginx and redmine will likely be needed.</p>
<p>Instructions are tested on redmine-svn and Ubuntu-9.10.<br />
<span id="more-173"></span></p>
<ul>
<li class="level1">
<div class="li">Install dependencies</div>
<ul>
<li class="level2">
<div class="li">
<pre>sudo apt-get install subversion libmysql-ruby rake rubygems mongrel nginx</pre>
</div>
</li>
</ul>
</li>
<li class="level1">
<div class="li">Setup directory structure</div>
<ul>
<li class="level2">
<div class="li">
<pre>sudo adduser --system --group redmine
sudo mkdir /opt/redmine
sudo chown redmine:redmine /opt/redmine
sudo -Hu redmine svn checkout http://redmine.rubyforge.org/svn/trunk /opt/redmine</pre>
</div>
</li>
</ul>
</li>
<li class="level1">
<div class="li">Create the MySQL database for redmine</div>
<ul>
<li class="level2">
<div class="li">Example for mysql-server on localhost:</p>
<pre>sudo apt-get install mysql-server
mysql -u root -p
create user 'redmine'@'localhost' identified by 'password';
grant all privileges on  `redmine_%` . * to  'redmine'@'localhost';
create database redmine_production character set utf8;
quit;</pre>
</div>
</li>
<li class="level2">
<div class="li">(or use phpmyadmin)</div>
</li>
</ul>
</li>
<li class="level1">
<div class="li">Copy config/database.yml.example to config/database.yml and edit the database configuration</div>
<ul>
<li class="level2">
<div class="li">
<pre>sudo -Hu redmine cp /opt/redmine/config/database.yml.example /opt/redmine/config/database.yml
sudo -Hu redmine vim /opt/redmine/config/database.yml</pre>
</div>
</li>
<li class="level2">
<div class="li">Example database <acronym title="specification">spec</acronym>:</div>
<ul>
<li class="level3">
<div class="li">
<pre>production:
  adapter: mysql
  database: redmine_production
  host: localhost
  username: redmine
  password: password
  encoding: utf8</pre>
</div>
</li>
</ul>
</li>
</ul>
</li>
<li class="level1">
<div class="li">Generate redmine session store secret</div>
<ul>
<li class="level2">
<div class="li">
<pre>cd /opt/redmine
sudo -Hu redmine gem install -v=2.3.5 rails
sudo -Hu redmine rake generate_session_store</pre>
</div>
</li>
</ul>
</li>
<li class="level1">
<div class="li">Create the database structure and insert the default data</div>
<ul>
<li class="level2">
<div class="li">
<pre>sudo -Hu redmine RAILS_ENV=production rake db:migrate
sudo -Hu redmine RAILS_ENV=production rake redmine:load_default_data</pre>
</div>
</li>
</ul>
</li>
<li class="level1">
<div class="li">Setup redmine to be served from /redmine/</div>
<ul>
<li class="level2">
<div class="li">
<pre>cd /opt/redmine/config
sudo -Hu redmine cp additional_environment.rb.example additional_environment.rb
echo 'config.action_controller.relative_url_root = "/redmine"' | sudo -Hu redmine tee -a additional_environment.rb</pre>
</div>
</li>
</ul>
</li>
<li class="level1">
<div class="li">Setup email delivery as desired</div>
<ul>
<li class="level2">
<div class="li">
<pre>cd /opt/redmine/config
sudo -Hu redmine cp email.yml.example email.yml</pre>
</div>
<ul>
<li class="level3">
<div class="li">Example smtp <acronym title="specification">spec</acronym></div>
<ul>
<li class="level4">
<div class="li">
<pre>sudo -Hu redmine vim email.yml</pre>
<pre>production:
  delivery_method: :smtp
  smtp_settings:
    address: smtp.example.com
    port: 25
    domain: example.com</pre>
</div>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="level1">
<div class="li">Start the mongrel server</div>
<ul>
<li class="level2">
<div class="li">
<pre>cd /opt/redmine; sudo -Hu redmine mongrel_rails start -e production -p 9001 -d</pre>
</div>
</li>
</ul>
</li>
<li class="level1">
<div class="li">Edit /etc/nginx/sites-enabled/default</div>
<ul>
<li class="level2">
<div class="li">
<pre>sudo vim /etc/nginx/sites-enabled/default</pre>
</div>
</li>
<li class="level2">
<div class="li">Add to the active server section:</div>
<ul>
<li class="level3">
<div class="li">
<pre>        location /redmine {
                alias /opt/redmine/public/;
                try_files  $uri/index.html $uri.html $uri @mongrel;
        }
        location @mongrel {
                proxy_set_header  X-Real-IP        $remote_addr;
                proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;
                proxy_set_header  Host             $http_host;
                proxy_redirect    off;
                proxy_pass        http://127.0.0.1:9001;
        }</pre>
</div>
</li>
</ul>
</li>
</ul>
</li>
<li class="level1">
<div class="li">Restart nginx:</p>
<pre>sudo service nginx restart</pre>
</div>
</li>
<li class="level1">
<div class="li">Test the website. eg: <a class="urlextern" title="http://localhost/redmine/" rel="nofollow" href="http://localhost/redmine/">http://localhost/redmine/</a></div>
</li>
<li class="level1">
<div class="li">If successful, set mongrel to start on boot</div>
<ul>
<li class="level2">
<div class="li">
<pre>sudo vim /etc/rc.local</pre>
</div>
<ul>
<li class="level3">
<div class="li">
<pre>cd /opt/redmine; sudo -Hu redmine mongrel_rails start -e production -p 9001 -d</pre>
</div>
</li>
</ul>
</li>
</ul>
</li>
<li class="level1">
<div class="li">Retest site after a reboot</div>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.khax.net/2010/04/01/nginx-mongrel-redmine-quick-setup-notes/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
