<?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>aBinaryMind &#187; Development</title>
	<atom:link href="http://www.abinarymind.com/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.abinarymind.com</link>
	<description>Some thoughts, some info, some rants</description>
	<lastBuildDate>Wed, 30 Jun 2010 15:36:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Redmine installation guide</title>
		<link>http://www.abinarymind.com/2009/12/redmine-installation-guide-ubuntu/</link>
		<comments>http://www.abinarymind.com/2009/12/redmine-installation-guide-ubuntu/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 09:14:52 +0000</pubDate>
		<dc:creator>lexhung</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[Open source]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[redmine]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.abinarymind.com/?p=131</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>This is a guide to install Redmine (svn trunk) on Ubuntu 9.10.</p>
<p>The assumed location of Redmine is <em>/srv/redmine</em></p>
<h3>Phase 1: Setup Redmine</h3>
<p><strong>Step 1</strong><br />
Install required packages.</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> ruby rake ruby-dev rubygems libmysqlclient-dev libopenssl-ruby</div></div>
<p><strong>Step 2</strong><br />
Check out Redmine trunk.</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>srv<br />
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">svn</span> <span style="color: #c20cb9; font-weight: bold;">co</span> http:<span style="color: #000000; font-weight: bold;">//</span>redmine.rubyforge.org<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>trunk redmine</div></div>
<p><strong>Step 3</strong><br />
Install required ruby gems:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> rails mongrel mongrel_cluster daemons mysql actionmailer</div></div>
<p>Note 1: We may need to update Rails RAILS_GEM_VERSION in file <em>[redmine]/config/environment.rb</em> to reflect actual version of Rails gems installed.</p>
<p>Note 2: We may need to create soft link for rails &amp; mongrel executables for convenient</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>gems<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mongrel_rails <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><br />
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>gems<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rails <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><br />
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>gems<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mongrel_cluster_ctl <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span></div></div>
<p><strong>Step 4</strong><br />
Create mysql database</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ mysql <span style="color: #660033;">-u</span> root <span style="color: #660033;">-p</span><br />
<span style="color: #666666; font-style: italic;"># Enter mysql root password when prompted</span></div></div>
<p>Run the following code in mysql, substitute your own database name, password, &#8230;</p>
<div class="codecolorer-container sql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> redmine character <span style="color: #993333; font-weight: bold;">SET</span> utf8;<br />
<span style="color: #993333; font-weight: bold;">CREATE</span> user <span style="color: #ff0000;">'redmine'</span>@<span style="color: #ff0000;">'localhost'</span> <span style="color: #993333; font-weight: bold;">IDENTIFIED</span> <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #ff0000;">'my_password'</span>;<br />
<span style="color: #993333; font-weight: bold;">GRANT</span> <span style="color: #993333; font-weight: bold;">ALL</span> privileges <span style="color: #993333; font-weight: bold;">ON</span> redmine<span style="color: #66cc66;">.*</span> <span style="color: #993333; font-weight: bold;">TO</span> <span style="color: #ff0000;">'redmine'</span>@<span style="color: #ff0000;">'localhost'</span>;</div></div>
<p><strong>Step 5</strong><br />
Create/Update database parameters in <em>[redmine]/config/database.yml</em> accordingly to prior step info.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">production:<br />
adapter: mysql<br />
database: redmine<br />
host: localhost<br />
username: redmine<br />
password: my_password<br />
encoding: utf8</div></div>
<p><strong>Step 6</strong><br />
Initialize the database</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># Initialize session hash</span><br />
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> rake config<span style="color: #000000; font-weight: bold;">/</span>initializers<span style="color: #000000; font-weight: bold;">/</span>session_store.rb</div></div>
<p># Load db schema<br />
$ sudo rake db:migrate RAILS_ENV=&#8221;production&#8221;</p>
<p>$ sudo rake redmine:load_default_data RAILS_ENV=&#8221;production&#8221;</p>
<p><strong>Step 7</strong><br />
Create redmine user &amp; setting up directory permission</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># Context: root:[redmine_dir]</span><br />
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> useradd redmine<br />
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> tmp public<span style="color: #000000; font-weight: bold;">/</span>plugin_assets<br />
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> redmine:redmine &nbsp;files log tmp<br />
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #660033;">-R</span> <span style="color: #000000;">755</span> files log tmp public</div></div>
<p><strong>Step 8</strong><br />
Testing the application server</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> ruby script<span style="color: #000000; font-weight: bold;">/</span>server <span style="color: #660033;">-e</span> production</div></div>
<p>The server is listening on [http://localhost:3000].</p>
<h3>Phase 2: Setup Apache &amp; Mongrel Cluster</h3>
<p><strong>Step 1</strong><br />
Create mongrel cluster configuration files for Redmine.</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> mongrel_rails cluster::configure <span style="color: #660033;">-e</span> production <span style="color: #660033;">-p</span> <span style="color: #000000;">3000</span> <span style="color: #660033;">-N</span> <span style="color: #000000;">3</span> <span style="color: #660033;">-c</span> <span style="color: #000000; font-weight: bold;">/</span>srv<span style="color: #000000; font-weight: bold;">/</span>redmine <span style="color: #660033;">-a</span> 127.0.0.1 <span style="color: #660033;">--user</span> redmine <span style="color: #660033;">--group</span> redmine</div></div>
<p># Test mongrel_installation<br />
$ sudo mongrel_rails cluster::start</p>
<p><strong>Step 2</strong><br />
Create apache virtual host file at <strong>/etc/apache/sites-available/</strong></p>
<div class="codecolorer-container apache default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="apache codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #00007f;">ServerName</span> your.virtual-host.com<br />
<span style="color: #00007f;">DocumentRoot</span> /srv/redmine</div></div>
<p>AllowOverride FileInfo Indexes</p>
<p>RewriteEngine On</p>
<p># Redirect all non-static requests to Mongrel<br />
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f<br />
RewriteRule ^/(.*)$ balancer://redmine_cluster%{REQUEST_URI} [P,QSA,L]</p>
<p>ProxyPassReverse / balancer://redmine_cluster<br />
ProxyPreserveHost on<br />
BalancerMember http://localhost:3000<br />
BalancerMember http://localhost:3001<br />
BalancerMember http://localhost:3002<br />
Order deny,allow<br />
Allow from all</p>
<p># Block access to .svn directories</p>
<p>ErrorDocument 403 /404.html<br />
Order allow,deny<br />
Deny from all<br />
Satisfy All</p>
<p><strong>Step 3</strong><br />
Turn on the virtual host and required modules</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> a2enmod proxy<br />
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> a2enmod proxy_http<br />
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> a2enmod proxy_balancer<br />
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> a2ensite</div></div>
<p># Restart web server<br />
$ sudo /etc/init.d/apache2 restart</p>
<h3>Phase 3: Surviving the reboot &amp; G!Mail SMTP</h3>
<h3><strong>Step 1</strong><br />
Create global mongrel_cluster configuration</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mongrel_cluster<br />
$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mongrel_cluster<br />
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>srv<span style="color: #000000; font-weight: bold;">/</span>redmine<span style="color: #000000; font-weight: bold;">/</span>config<span style="color: #000000; font-weight: bold;">/</span>mongrel_cluster.yml <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mongrel_cluster<span style="color: #000000; font-weight: bold;">/</span>redmine.yml</div></div>
<p><strong>Step 2</strong><br />
Update the services</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<br />
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>gems<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>gems<span style="color: #000000; font-weight: bold;">/</span>mongrel_cluster-1.0.5<span style="color: #000000; font-weight: bold;">/</span>resources<span style="color: #000000; font-weight: bold;">/</span>mongrel_cluster <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span><br />
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> +x <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>mongrel_cluster<br />
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>update-rc.d <span style="color: #660033;">-f</span> mongrel_cluster defaults</div></div>
<p>Step 3<br />
Configure G!Mail</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> ruby script<span style="color: #000000; font-weight: bold;">/</span>plugin <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #c20cb9; font-weight: bold;">git</span>:<span style="color: #000000; font-weight: bold;">//</span>github.com<span style="color: #000000; font-weight: bold;">/</span>collectiveidea<span style="color: #000000; font-weight: bold;">/</span>action_mailer_optional_tls.git</div></div>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># File: config/email.yml<br />
production:<br />
delivery_method: :smtp<br />
smtp_settings:<br />
tls: true<br />
address: &quot;smtp.gmail.com&quot;<br />
port: '587'<br />
domain: &quot;smtp.gmail.com&quot;<br />
authentication: :plain<br />
user_name: &quot;your_email@gmail.com&quot;<br />
password: &quot;your_password&quot;</div></div>
</h3>
<h3>References</h3>
<ol>
<li>http://www.redmine.org/wiki/redmine/RedmineInstall</li>
<li>http://ubuntuforums.org/showthread.php?t=674598</li>
<li>http://azureusonrails.rubyforge.org/wiki/wiki.pl?Install/Mongrel_Cluster_With_Apache_2.2</li>
<li>http://redmineblog.com/articles/setup-redmine-to-send-email-using-gmail/</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.abinarymind.com/2009/12/redmine-installation-guide-ubuntu/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
