<?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>P0L0&#039;s Blog &#187; trac</title>
	<atom:link href="http://p0l0.binware.org/index.php/tag/trac/feed/" rel="self" type="application/rss+xml" />
	<link>http://p0l0.binware.org</link>
	<description>Opensource Projects and IT experiences</description>
	<lastBuildDate>Sun, 30 Oct 2011 08:39:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>ChiliProject 1.4.0 + Ruby Enterprise + Passenger + Apache2</title>
		<link>http://p0l0.binware.org/index.php/2011/05/30/redmine-1-2-ruby-enterprise-passenger-apache2/</link>
		<comments>http://p0l0.binware.org/index.php/2011/05/30/redmine-1-2-ruby-enterprise-passenger-apache2/#comments</comments>
		<pubDate>Mon, 30 May 2011 18:29:43 +0000</pubDate>
		<dc:creator>P0L0</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[IT Security]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[chiliproject]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[redmine]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[trac]]></category>

		<guid isPermaLink="false">http://p0l0.binware.org/?p=732</guid>
		<description><![CDATA[I was a happy Trac user, but after seeing Redmine, I realized that Trac has many missing features and that you must do a lot of things with plugins, Redmine has this features out-of-box. After working a bit with Redmine I discovered ChiliProject, which is a fork of Redmine, and its actually compatible with Redmine [...]]]></description>
			<content:encoded><![CDATA[<p>I was a happy <a href="http://trac.edgewall.org/" target="_blank">Trac</a> user, but after seeing <a href="http://www.redmine.org/" target="_blank">Redmine</a>, I realized that Trac has many missing features and that you must do a lot of things with plugins, Redmine has this features out-of-box. After working a bit with Redmine I discovered <a href="https://www.chiliproject.org/" target="_blank">ChiliProject</a>, which is a <a href="https://www.chiliproject.org/projects/chiliproject/wiki/Why_Fork" target="_blank">fork</a> of Redmine, and its actually compatible with Redmine <a href="http://www.redmine.org/projects/redmine/wiki/Theme_List" target="_blank">Themes</a> and <a href="http://www.redmine.org/plugins" target="_blank">Plugins</a>.</p>
<p>Here is a comparison of Redmine/ChiliProject and Trac features:<br />
<span id="more-732"></span></p>
<p><div style="margin-left: -20px; margin-top: 20px; margin-bottom: 20px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-5682258244719056";
/* Inline Post */
google_ad_slot = "6946080416";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div></p>
<table>
<tr>
<th>Feature</th>
<th>Redmine/ChiliProject</th>
<th>Trac</th>
</tr>
<tr>
<td>Multiple projects support</td>
<td style="color: green;">Yes</td>
<td style="color: orange;">No (with plugin, planned 0.14)</td>
</tr>
<tr>
<td>Flexible role based access control</td>
<td style="color: green;">Yes</td>
<td style="color: red;">No</td>
</tr>
<tr>
<td>Flexible issue tracking system</td>
<td style="color: green;">Yes</td>
<td style="color: orange;">Yes (no bulk ticket changes and ticket dependencies)</td>
</tr>
<tr>
<td>Gantt chart and calendar</td>
<td style="color: green;">Yes</td>
<td style="color: red;">No (<a href="http://trac-hacks.org/wiki/GanttCalendarPlugin" target="_blank" style="color: red;">GanttCalendarPlugin</a>)</td>
</tr>
<tr>
<td>Feeds &#038; email notifications</td>
<td style="color: green;">Yes</td>
<td style="color: red;">Yes</td>
</tr>
<tr>
<td>Per project wiki</td>
<td style="color: green;">Yes</td>
<td style="color: red;">Yes</td>
</tr>
<tr>
<td>Per project forums</td>
<td style="color: green;">Yes</td>
<td style="color: red;">No (<a href="http://trac-hacks.org/wiki/DiscussionPlugin" target="_blank" style="color: red;">DiscussionPlugin</a>)</td>
</tr>
<tr>
<td>Time tracking</td>
<td style="color: green;">Yes</td>
<td style="color: orange;">No (<a href="http://trac.edgewall.org/wiki/TimeTracking" target="_blank" style="color: orange;">Plugins or custom field</a>)</td>
</tr>
<tr>
<td>Custom fields for issues, time-entries, projects and users</td>
<td style="color: green;">Yes</td>
<td style="color: green;">Yes (<a href="http://trac.edgewall.org/wiki/TracTicketsCustomFields" target="_blank" style="color: green;">editing trac.ini</a>)</td>
</tr>
<tr>
<td>SCM integration</td>
<td style="color: green;">SVN, CVS, Git, Mercurial, Bazaar and Darcs</td>
<td style="color: orange;">SVN in core, others with Plugins</td>
</tr>
<tr>
<td>Issue creation via email</td>
<td style="color: green;">Yes</td>
<td style="color: orange;">No (<a href="http://trac-hacks.org/wiki/MailToTracPlugin" target="_blank" style="color: orange;">MailToTracPlugin</a>)</td>
</tr>
<tr>
<td>Multiple LDAP authentication support</td>
<td style="color: green;">Yes</td>
<td style="color: orange;">No (<a href="http://trac-hacks.org/wiki/LdapPlugin" target="_blank" style="color: orange;">LDAPPlugin</a>)</td>
</tr>
<tr>
<td>User self-registration support</td>
<td style="color: green;">Yes</td>
<td style="color: orange;">No (<a href="http://trac-hacks.org/wiki/AccountManagerPlugin" target="_blank" style="color: orange;">AccountManagerPlugin</a>)</td>
</tr>
<tr>
<td>Multilanguage support</td>
<td style="color: green;">Yes</td>
<td style="color: green;">Yes</td>
</tr>
<tr>
<td>Multiple databases support</td>
<td style="color: green;">MySQL, PostgreSQL, SQLite</td>
<td style="color: orange;">MySQL (unstable), PostgreSQL, SQLite</td>
</tr>
<tr>
<td>iPhone/Android Apps</td>
<td style="color: green;">Yes</td>
<td style="color: red;">No</td>
</tr>
</table>
<p>The first thing that made me not to test Redmine/ChiliProject immediately was that it is RoR and the complexity to make it run stable under apache, but after searching a bit, I found <a href="http://www.modrails.com/" target="_blank">Phusion Passenger</a> and <a href="http://www.rubyenterpriseedition.com/" target="_blank">Ruby Enterprise</a>, which is a very good solution to run RoR products stable under Apache, and you have the ability to run Ruby with custom user, usefull for shared environments.</p>
<h3>Installation</h3>
<ol>
<li>
<p>Ruby Enterprise</p>
<p>I downloaded and installer from source code, so that it&#8217;s compiled for my server and I can store it in a specific location. So, the first we have to do is download latest version from <a href="http://www.rubyenterpriseedition.com/download.html" target="_blank">Ruby Enterprise Download page</a></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>rubyenterpriseedition.googlecode.com<span style="color: #000000; font-weight: bold;">/</span>files<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.7-<span style="color: #000000;">2011.03</span>.tar.gz
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf ruby-enterprise-1.8.7-<span style="color: #000000;">2011.03</span>.tar.gz
<span style="color: #7a0874; font-weight: bold;">cd</span> ruby-enterprise-1.8.7-<span style="color: #000000;">2011.03</span>
.<span style="color: #000000; font-weight: bold;">/</span>installer</pre></div></div>

<p>Follow installer instructions, and install dependencies if needed (the installer tells us which packages we need for our Linux distro)</p>
</li>
<li>
<p>Phusion Passenger</p>
<p>Next thing to do, is install the Passanger module for apache, this can be done with the <em>passenger-install-apache2-module</em> script available at Ruby Enterprise installation</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.7-<span style="color: #000000;">2011.03</span><span style="color: #000000; font-weight: bold;">/</span>bin
.<span style="color: #000000; font-weight: bold;">/</span>passenger-install-apache2-module</pre></div></div>

<p>This script also checks the dependencies and says what packages you need for your Linux distro</p>
</li>
<li>
<p>Apache</p>
<p>Now we need to configure apache, first we need to activate and configure the passenger module</p>
<p><strong>/etc/apache2/mods-enabled/passenger.load</strong></p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">LoadModule</span> passenger_module /opt/ruby-enterprise-1.8.7-<span style="color: #ff0000;">2011.03</span>/lib/ruby/gems/<span style="color: #ff0000;">1.8</span>/gems/passenger-3.0.7/ext/apache2/mod_passenger.so</pre></div></div>

<p><strong>/etc/apache2/mods-enabled/passenger.conf</strong></p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;">&lt;<span style="color: #000000; font-weight:bold;">ifmodule</span> mod_passenger.c&gt;
  PassengerRoot /opt/ruby-enterprise-1.8.7-<span style="color: #ff0000;">2011.03</span>/lib/ruby/gems/<span style="color: #ff0000;">1.8</span>/gems/passenger-3.0.7
  PassengerRuby /opt/ruby-enterprise-1.8.7-<span style="color: #ff0000;">2011.03</span>/bin/ruby
&nbsp;
  PassengerFriendlyErrorPages <span style="color: #0000ff;">Off</span>
  PassengerUserSwitching <span style="color: #0000ff;">On</span>
  PassengerDefaultUser www-data
  PassengerDefaultGroup www-data
&lt;/<span style="color: #000000; font-weight:bold;">ifmodule</span>&gt;</pre></div></div>

<p>And the last thing is configure a vhost under which we will run this ChiliProject installation</p>
<p><strong>/etc/apache2/sites-enabled/chiliproject</strong></p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">NameVirtualHost</span> *:<span style="color: #ff0000;">443</span>
&lt;<span style="color: #000000; font-weight:bold;">virtualhost</span> *:<span style="color: #ff0000;">443</span>&gt;
	<span style="color: #00007f;">SSLEngine</span> <span style="color: #0000ff;">on</span>
&nbsp;
	<span style="color: #00007f;">SSLCertificateFile</span>    /etc/apache2/ssl/server.crt
	<span style="color: #00007f;">SSLCertificateKeyFile</span> /etc/apache2/ssl/server.key
&nbsp;
	&lt;<span style="color: #000000; font-weight:bold;">ifmodule</span> mod_passenger.c&gt;
		PassengerUser chiliproject
		PassengerGroup chiliproject
	&lt;/<span style="color: #000000; font-weight:bold;">ifmodule</span>&gt;
&nbsp;
        <span style="color: #00007f;">ServerAdmin</span> webmaster@chiliproject.org
	<span style="color: #00007f;">ServerName</span> chiliproject.org
&nbsp;
	<span style="color: #00007f;">DocumentRoot</span> /home/chiliproject/public
	&lt;<span style="color: #000000; font-weight:bold;">directory</span> /&gt;
		<span style="color: #00007f;">Options</span> -MultiViews
		<span style="color: #00007f;">AllowOverride</span> <span style="color: #0000ff;">All</span>
	&lt; /Directory&gt;
&nbsp;
	<span style="color: #00007f;">ErrorLog</span> /var/log/apache2/chiliproject-error.log
&nbsp;
	<span style="color: #00007f;">CustomLog</span> /var/log/apache2/chiliproject-access.log combined
&lt;/<span style="color: #000000; font-weight:bold;">virtualhost</span>&gt;</pre></div></div>

</li>
<li>
<p>ChiliProject</p>
<p>First install needed gems</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.7-<span style="color: #000000;">2011.03</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gem <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-v</span>=0.4.2 i18n
<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.7-<span style="color: #000000;">2011.03</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gem <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-v</span>=1.0.1 rack
<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.7-<span style="color: #000000;">2011.03</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gem <span style="color: #c20cb9; font-weight: bold;">install</span> mysql</pre></div></div>

<p>Download the last available ChiliProject version from <a href="https://www.chiliproject.org/projects/chiliproject/files" target="_blank">ChiliProject Files Page</a></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> https:<span style="color: #000000; font-weight: bold;">//</span>www.chiliproject.org<span style="color: #000000; font-weight: bold;">/</span>attachments<span style="color: #000000; font-weight: bold;">/</span>download<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">99</span><span style="color: #000000; font-weight: bold;">/</span>chiliproject-1.4.0.tar.gz
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf chiliproject-1.4.0.tar.gz
<span style="color: #c20cb9; font-weight: bold;">mv</span> chiliproject-1.4.0 <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>chiliproject</pre></div></div>

<p>Create the mysql database and user for ChiliProject</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> chiliproject <span style="color: #993333; font-weight: bold;">CHARACTER</span> <span style="color: #993333; font-weight: bold;">SET</span> utf8 <span style="color: #993333; font-weight: bold;">COLLATE</span> utf8_unicode_ci;
<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> chiliproject<span style="color: #66cc66;">.*</span> <span style="color: #993333; font-weight: bold;">TO</span> <span style="color: #ff0000;">'chiliproject'</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>;</pre></div></div>

<p>Configure ChiliProject Database Connection</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mv</span> config<span style="color: #000000; font-weight: bold;">/</span>database.yml.example config<span style="color: #000000; font-weight: bold;">/</span>database.yml</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="yml" style="font-family:monospace;">production:
  adapter: mysql
  database: chiliproject
  host: localhost
  username: chiliproject
  password: my_password</pre></div></div>

<p>Now initialize ChiliProject (session Store, DB Tables, DB Default Data</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.7-<span style="color: #000000;">2011.03</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rake generate_session_store
<span style="color: #007800;">RAILS_ENV</span>=production <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.7-<span style="color: #000000;">2011.03</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rake db:migrate
<span style="color: #007800;">RAILS_ENV</span>=production <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.7-<span style="color: #000000;">2011.03</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rake redmine:load_default_data</pre></div></div>

<p>And the last thing we need to do before we can restart apache and begin to use the new installed ChiliProject, we need to create the <em>chiliproject</em> user</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">adduser <span style="color: #660033;">--home</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>chiliproject <span style="color: #660033;">--shell</span> <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">false</span> <span style="color: #660033;">--no-create-home</span> chiliproject
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> chiliproject:chiliproject <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>chiliproject</pre></div></div>

</li>
<div style="margin-left: -40px;">
<div style="margin-left: -20px; margin-top: 20px; margin-bottom: 20px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-5682258244719056";
/* Inline Post */
google_ad_slot = "6946080416";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
</div>
<li>
<p>(Optinal) Rmagick</p>
<p>If we would like to enable Gantt export to png image we need to install Rmagick (available as gem). First we need to install imagemagick ang graphicsmagick dev packages and then we can install the rmagick gem.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> libmagickcore-dev libgraphicsmagick1-dev libmagickwand-dev
<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.7-<span style="color: #000000;">2011.03</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gem <span style="color: #c20cb9; font-weight: bold;">install</span> rmagick</pre></div></div>

</li>
</ol>
<p>Now we only need to restart Apache and load ChiliProject in our Browser. The default user is <em><strong>admin/admin</strong></em></p>
]]></content:encoded>
			<wfw:commentRss>http://p0l0.binware.org/index.php/2011/05/30/redmine-1-2-ruby-enterprise-passenger-apache2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing TRAC with mod_wsgi using virtualenv</title>
		<link>http://p0l0.binware.org/index.php/2010/05/10/installing-trac-with-mod_wsgi-using-virtualenv/</link>
		<comments>http://p0l0.binware.org/index.php/2010/05/10/installing-trac-with-mod_wsgi-using-virtualenv/#comments</comments>
		<pubDate>Mon, 10 May 2010 19:33:03 +0000</pubDate>
		<dc:creator>P0L0</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[IT Security]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mod_wsgi]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[trac]]></category>
		<category><![CDATA[virtualenv]]></category>

		<guid isPermaLink="false">http://p0l0.binware.org/?p=664</guid>
		<description><![CDATA[This guide is for installing Trac as a user using virtualenv for a isolated Python environment so that the whole installation runs under a specific user. First of all we need to install needed packages apt-get install libapache2-mod-wsgi python-virtualenv python-setuptools Once we have installed the required packages proceed to create the Python environment mkdir /usr/local/trac [...]]]></description>
			<content:encoded><![CDATA[<p>This guide is for installing <a href="http://trac.edgewall.org/" target="_blank">Trac </a> as a user using <a href="http://pypi.python.org/pypi/virtualenv/1.4.8" target="_blank">virtualenv</a> for a isolated Python environment so that the whole installation runs under a specific user.</p>
<p>First of all we need to install needed packages</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> libapache2-mod-wsgi python-virtualenv python-setuptools</pre></div></div>

<p>Once we have installed the required packages proceed to create the Python environment</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <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>trac
<span style="color: #7a0874; font-weight: bold;">cd</span> <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>trac
virtualenv python</pre></div></div>

<p>We now have the isolated Python environment locate under <strong>/usr/local/trac/python</strong>.</p>
<p>To make possible to use <strong>easy_install</strong> with repositories we need to upgrade easy_install. I use this to install Trac plugins directly from SVN.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><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>trac<span style="color: #000000; font-weight: bold;">/</span>python<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>easy_install <span style="color: #660033;">-U</span> trunk</pre></div></div>

<p>We now can install trac 0.12 using the 0.12b1 SVN Tag (<strong>http://svn.edgewall.com/repos/trac/tags/trac-0.12b1</strong> or <strong>Trac==0.12b1</strong>) or directly from SVN Trunk:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><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>trac<span style="color: #000000; font-weight: bold;">/</span>python<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>easy_install http:<span style="color: #000000; font-weight: bold;">//</span>svn.edgewall.org<span style="color: #000000; font-weight: bold;">/</span>repos<span style="color: #000000; font-weight: bold;">/</span>trac<span style="color: #000000; font-weight: bold;">/</span>trunk</pre></div></div>

<p>This will download and install the latest trunk version for Trac.</p>
<p>To have webaccess to the Trac projects, we need a <strong>.wsgi</strong> script, were we define where our local python environment is located:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;"># Not needed if mod_wsgi &gt;= 3.0</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
<span style="color: #dc143c;">sys</span>.<span style="color: black;">stdout</span> = <span style="color: #dc143c;">sys</span>.<span style="color: black;">stderr</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Load Trac</span>
<span style="color: #ff7700;font-weight:bold;">import</span> trac.<span style="color: black;">web</span>.<span style="color: black;">main</span>
application = trac.<span style="color: black;">web</span>.<span style="color: black;">main</span>.<span style="color: black;">dispatch_request</span></pre></div></div>

<p>And finally we need to configure apache. If you want only one Trac project, you should define <strong>trac.env</strong> to the location of your trac, but if you want multiproject support, you must use <strong>trac.env_parent_dir</strong> (this is what I used)</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;">&lt;<span style="color: #000000; font-weight:bold;">virtualhost</span> *:<span style="color: #ff0000;">80</span>&gt;
    <span style="color: #00007f;">ServerName</span> trac.dns.com
&nbsp;
    <span style="color: #00007f;">DocumentRoot</span> /usr/local/trac/htdocs
    <span style="color: #00007f;">ErrorLog</span> /var/log/apache2/trac-error.log
    <span style="color: #00007f;">CustomLog</span> /var/log/apache2/trac-access.log combined
&nbsp;
    <span style="color: #adadad; font-style: italic;"># Trac Auth</span>
    &lt;<span style="color: #000000; font-weight:bold;">location</span> /&gt;
        <span style="color: #00007f;">AuthType</span> Basic
        <span style="color: #00007f;">AuthName</span> <span style="color: #7f007f;">&quot;Trac&quot;</span>
        <span style="color: #00007f;">AuthUserFile</span> /usr/local/trac/.htpasswd
        <span style="color: #00007f;">Require</span> valid-<span style="color: #00007f;">user</span>
    &lt; /location&gt;
&nbsp;
    <span style="color: #adadad; font-style: italic;">#Trac</span>
    <span style="color: #adadad; font-style: italic;">#Define ProcessGroup with user and group under which it should run</span>
    WSGIDaemonProcess trac <span style="color: #00007f;">user</span>=trac <span style="color: #00007f;">group</span>=trac python-path=/usr/local/trac/python/lib/python2.5/site-packages python-eggs=/usr/local/trac/python/cache
    WSGIScriptAlias / /usr/local/trac/htdocs/trac.wsgi
&nbsp;
    &lt;<span style="color: #000000; font-weight:bold;">directory</span> /usr/local/trac/htdocs&gt;
        WSGIProcessGroup trac
        WSGIApplicationGroup %{GLOBAL}
        <span style="color: #00007f;">SetEnv</span> trac.env_parent_dir /usr/local/trac/projects
    &lt;/<span style="color: #000000; font-weight:bold;">directory</span>&gt;
&lt;/<span style="color: #000000; font-weight:bold;">virtualhost</span>&gt;</pre></div></div>

<p>We need to create the user and change the permissions for <strong>/usr/local/trac</strong> for that user <strong>trac</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">adduser <span style="color: #660033;">--home</span> <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>trac <span style="color: #660033;">--shell</span> <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">false</span> <span style="color: #660033;">--no-create-home</span> trac
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> trac:trac <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>trac</pre></div></div>

<p>If you get an error <strong>&#8220;ImportError: No module named simplejson&#8221;</strong> just install it using easy_install</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><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>trac<span style="color: #000000; font-weight: bold;">/</span>python<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>easy_install simplejson</pre></div></div>

<p><div style="margin-left: -20px; margin-top: 20px; margin-bottom: 20px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-5682258244719056";
/* Inline Post */
google_ad_slot = "6946080416";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div></p>
]]></content:encoded>
			<wfw:commentRss>http://p0l0.binware.org/index.php/2010/05/10/installing-trac-with-mod_wsgi-using-virtualenv/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Multiples proyectos con trac y svn usando HTTPS</title>
		<link>http://p0l0.binware.org/index.php/2006/10/03/multiples-proyectos-con-trac-y-svn-usando-https/</link>
		<comments>http://p0l0.binware.org/index.php/2006/10/03/multiples-proyectos-con-trac-y-svn-usando-https/#comments</comments>
		<pubDate>Tue, 03 Oct 2006 17:51:55 +0000</pubDate>
		<dc:creator>P0L0</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[binware]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[trac]]></category>

		<guid isPermaLink="false">http://p0l0.binware.org/index.php/2006/10/03/multiples-proyectos-con-trac-y-svn-usando-https/</guid>
		<description><![CDATA[Voy a explicar como montar el sistema de gestion de proyectos trac y subversion usando https para trabajar con subversion. Yo lo he montado en una debian usando apache2, asi que lo primero que necesitamos es instalar todo lo necesario apt-get install trac subversion apache2 subversion libapache2-svn libapache2-mod-python2.3 Una vez descargado e instalado creamos el [...]]]></description>
			<content:encoded><![CDATA[<p>Voy a explicar como montar el sistema de gestion de proyectos <a target="_blank" title="Trac" href="http://trac.edgewall.com/">trac</a> y <a target="_blank" title="Subversion" href="http://subversion.tigris.org/">subversion</a> usando https para trabajar con subversion. Yo lo he montado en una debian usando apache2, asi que lo primero que necesitamos es instalar todo lo necesario</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> trac subversion apache2 subversion libapache2-svn libapache2-mod-python2.3</pre></div></div>

<p>Una vez descargado e instalado creamos el certificado necesario para usar tanto trac y subversion bajo https. Entra en el directorio <strong>/etc/apache2/ssl</strong> y ejecuta lo siguiente:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">openssl genrsa <span style="color: #660033;">-des3</span> <span style="color: #660033;">-out</span> server.key <span style="color: #000000;">1024</span>
openssl req <span style="color: #660033;">-new</span> <span style="color: #660033;">-key</span> server.key <span style="color: #660033;">-out</span> server.csr
<span style="color: #c20cb9; font-weight: bold;">cp</span> server.key server.key.org
openssl rsa <span style="color: #660033;">-in</span> server.key.org <span style="color: #660033;">-out</span> server.key
openssl x509 <span style="color: #660033;">-req</span> <span style="color: #660033;">-days</span> <span style="color: #000000;">365</span> <span style="color: #660033;">-in</span> server.csr <span style="color: #660033;">-signkey</span> server.key <span style="color: #660033;">-out</span> server.crt</pre></div></div>

<p>Ahora ya tenemos listo los certificados, asi que ahora solo nos queda configurar el apache. Yo he creado un trac.dominio.ext y un svn.dominio.ext para hacer esto, pero esto va a gusto de cada uno. Yo como uso dos subdominios distintos, lo tengo en ficheros separados.</p>
<p>Primero editaremos el trac, asi que creamos el fichero <strong>/etc/apache2/sites-available/trac.domain.ext</strong></p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">NameVirtualHost *:<span style="">443</span>
&lt;VirtualHost *:<span style="">443</span>&gt;
#Activate SSL
SSLEngine on
&nbsp;
SSLCertificateFile    /etc/apache2/ssl/server.crt
SSLCertificateKeyFile /etc/apache2/ssl/server.key
&nbsp;
#VirtualHost Servername
ServerName trac.domain.ext
ServerAdmin trac@domain.ext
&nbsp;
DocumentRoot /opt/projects/trac
&nbsp;
#Authentication
&lt;Location /&gt;
AuthType Basic
AuthName <span style="color: #933;">&quot;Trac&quot;</span>
AuthUserFile /opt/projects/.htpasswd
Require valid-user
&nbsp;
#Trac
SetHandler mod_python
PythonHandler trac.web.modpython_frontend
PythonOption TracEnvParentDir /opt/projects/trac/
PythonOption TracUriRoot /
&nbsp;
&lt;/Location&gt;
&lt;/VirtualHost&gt;</pre></div></div>

<p>El fichero no necesita demasiada explicacion, simplemente le decimos que active el SSL, que pida autentificacion y cargamos el modulo del trac y le especificamos el path de donde estan todos nuestros proyectos.</p>
<p>Ahora vamos con el fichero <strong>/etc/apache2/sites-available/svn.domain.ext</strong></p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">NameVirtualHost *:<span style="">443</span>
&lt;VirtualHost *:<span style="">443</span>&gt;
#Activate SSL
SSLEngine on
&nbsp;
SSLCertificateFile    /etc/apache2/ssl/server.crt
SSLCertificateKeyFile /etc/apache2/ssl/server.key
&nbsp;
#VirtualHost Servername
ServerName svn.domain.ext
ServerAdmin svn@domain.ext
&nbsp;
DocumentRoot /opt/projects/svn
&lt;Location /&gt;
DAV svn
&nbsp;
#Authentication
AuthType Basic
AuthName <span style="color: #933;">&quot;Subversion&quot;</span>
AuthUserFile /opt/projects/.htpasswd
Require valid-user
&nbsp;
#Subversion
SVNParentPath /opt/projects/svn
SVNListParentPath on
SVNAutoVersioning On
&lt;/Location&gt;
&nbsp;
&lt;LocationMatch <span style="color: #933;">&quot;/.+&quot;</span>&gt;
#Subversion permission file
AuthzSVNAccessFile /opt/projects/svn/.htpasswd
&lt;/LocationMatch&gt;
&lt;/VirtualHost&gt;</pre></div></div>

<p>Es importante separar el <strong>AuthzSVNAccessFile</strong> de <strong>&lt;Location /&gt;</strong> ya que sino no listara todos los proyectos en http://svn.domain.ext/ por problemas de permisos.</p>
<p>Ahora que tenemos estos ficheros listos, hay que activar el modulo de ssl en el apache2 y los dos dominios.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>ports.conf</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">&lt;IfModule mod_ssl.c&gt;
Listen <span style="">443</span>
&lt;/IfModule&gt;</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><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>apache2<span style="color: #000000; font-weight: bold;">/</span>mods-enabled
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>mods-available<span style="color: #000000; font-weight: bold;">/</span>dav.load .
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>mods-available<span style="color: #000000; font-weight: bold;">/</span>dav_svn.load .
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>mods-available<span style="color: #000000; font-weight: bold;">/</span>mod_python.load .
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>mods-available<span style="color: #000000; font-weight: bold;">/</span>ssl.conf .
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>mods-available<span style="color: #000000; font-weight: bold;">/</span>ssl.load .
&nbsp;
<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>apache2<span style="color: #000000; font-weight: bold;">/</span>sites-enabled
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>sites-available<span style="color: #000000; font-weight: bold;">/</span>svn.domain.ext 001-svn.domain.ext
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>sites-available<span style="color: #000000; font-weight: bold;">/</span>trac.domain.ext 001-trac.domain.ext</pre></div></div>

<p>Ahora vamos a crear un proyecto de prueba</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>projects<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svn</span>
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>projects<span style="color: #000000; font-weight: bold;">/</span>trac
<span style="color: #c20cb9; font-weight: bold;">svnadmin</span> create <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>projects<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>NewProject
trac-admin <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>projects<span style="color: #000000; font-weight: bold;">/</span>trac<span style="color: #000000; font-weight: bold;">/</span>NewProject initenv</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">Project Name <span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>My Project<span style="">&#93;</span></span>&gt; NewProject
Database connection string <span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>sqlite:db/trac.db<span style="">&#93;</span></span>&gt;
Path to repository <span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>/var/svn/test<span style="">&#93;</span></span>&gt; /opt/projects/svn/NewProject
Templates directory <span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>/usr/share/trac/templates<span style="">&#93;</span></span>&gt;
Creating and Initializing Project
Configuring Project
trac.repository_dir
trac.database
trac.templates_dir
project.name
Installing default wiki pages
..............</pre></div></div>

<pre lang="bash"
chown -R www-data:www-data /opt/projects/
</pre>
<p>Ahora creamos los ficheros de acceso de usuarios.</p>
</pre>
<pre lang="bash>
htpasswd -c /opt/projects/.htpasswd user1
htpasswd /opt/projects/.htpasswd user2
</pre>
<p>Y el archivo de permisos de subversion, que tiene el siguiente formato</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"><span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>Repositorio:/Path<span style="">&#93;</span></span>
<span style="color: #000099;">user</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> <span style="color: #000066; font-weight:bold;"><span style="">&#91;</span> <span style="">&#91;</span>r<span style="">&#91;</span>w<span style="">&#93;</span><span style="">&#93;</span><span style="">&#93;</span></span></span></pre></div></div>

<p>Por ejemplo, queremos que el user1 pueda leer y escribir, el user2 leer, y anonymous nada (no deberia haber anonymous ya que el htpasswd no los deja pasar, pero siempre viene bien protegerse por si acaso), el fichero quedaria asi</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"><span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>NewProject:/<span style="">&#93;</span></span>
<span style="color: #000099;">user1</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> rw</span>
<span style="color: #000099;">user2</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> r</span>
* <span style="color: #000066; font-weight:bold;">=</span></pre></div></div>

<p>Ahora ya tenemos todo listo, podemos instalar el modulo <a target="_blank" title="Trac Web Admin" href="http://trac.edgewall.org/wiki/WebAdmin">TracWebAdmin</a> para que sea mas facil la administracion del trac.</p>
]]></content:encoded>
			<wfw:commentRss>http://p0l0.binware.org/index.php/2006/10/03/multiples-proyectos-con-trac-y-svn-usando-https/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

