<?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>phxis.net</title>
	<atom:link href="http://www.phxis.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.phxis.net</link>
	<description></description>
	<lastBuildDate>Thu, 03 Jun 2010 17:53:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>In The Works</title>
		<link>http://www.phxis.net/2010/06/03/in-the-works/</link>
		<comments>http://www.phxis.net/2010/06/03/in-the-works/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 17:52:24 +0000</pubDate>
		<dc:creator>phxis</dc:creator>
				<category><![CDATA[news]]></category>

		<guid isPermaLink="false">http://www.phxis.net/?p=43</guid>
		<description><![CDATA[Hey everyone, I know it&#8217;s been quite a while since I&#8217;ve posted anything. Between a new full-time job, late night development sessions, and now back in school, things have been extremely B-U-S-Y. However, I&#8217;ve got some things in the works right now that I feel are going to be HUGE!!! For starters there&#8217;s a new [...]]]></description>
			<content:encoded><![CDATA[<p>Hey everyone,<br />
I know it&#8217;s been quite a while since I&#8217;ve posted anything. Between a new full-time job, late night development sessions, and now back in school, things have been extremely B-U-S-Y. However, I&#8217;ve got some things in the works right now that I feel are going to be <em>HUGE</em>!!! For starters there&#8217;s a new event management framework soon to be released along with many new Android apps. I&#8217;m also working on changing the theme for this blog to something that I feel will fit better with the direction of the company. Check back soon to keep up on all these new changes!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phxis.net/2010/06/03/in-the-works/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To: Setting Up Trac on a Shared Server</title>
		<link>http://www.phxis.net/2008/12/25/how-to-setting-up-trac-on-a-shared-server/</link>
		<comments>http://www.phxis.net/2008/12/25/how-to-setting-up-trac-on-a-shared-server/#comments</comments>
		<pubDate>Thu, 25 Dec 2008 23:50:16 +0000</pubDate>
		<dc:creator>phxis</dc:creator>
				<category><![CDATA[how to]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[trac]]></category>
		<category><![CDATA[walkthrough]]></category>

		<guid isPermaLink="false">http://www.phxis.net/?p=9</guid>
		<description><![CDATA[I&#8217;ve spent countless days scouring the web on a simple way to install Trac 0.10.4 on a host that allowed ssh access. Now, throughout my research, the two hosts that have the best chance of successful install are Hostmonster and Bluehost. Both offer extremely low priced options, and with the features they provide, you can&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve spent <em>countless</em> days scouring the web on a simple way to install <a title="The Trac Project" href="http://trac.edgewall.org/" target="_blank">Trac 0.10.4</a> on a host that allowed ssh access. Now, throughout my research, the two hosts that have the best chance of successful install are <a title="Hostmonster Web Hosting" href="http://www.hostmonster.com" target="_blank">Hostmonster</a> and <a title="Bluehost Web Hosting" href="http://www.bluehost.com/" target="_blank">Bluehost</a>. Both offer <span style="text-decoration: underline;">extremely</span> low priced options, and with the features they provide, you can&#8217;t go wrong either way. Now, I&#8217;m running on <a title="Hostmonster Web Hosting" href="http://www.hostmonster.com" target="_blank">Hostmonster</a> and haven&#8217;t been able to test this with <a title="Bluehost Web Hosting" href="http://www.bluehost.com/" target="_blank">Bluehost</a>, but I&#8217;ve kept the steps pretty simple and generic so they should work without a problem. If anyone does have any issues or come across any differences, let me know so I can update this <strong>How To</strong>.</p>
<p>Anyway, I&#8217;ve compiled this <strong>How To</strong> together for others that may be having difficulties. These are the <span style="text-decoration: underline;">exact</span> steps and commands that I ran in my ssh session to get everything up and running. All the code snippets are ready to run, so just copy &amp; paste them into your terminal. After you&#8217;re done you should <em>hopefully</em> have a working Trac site, with the bonus of a working <a title="Subversion" href="http://subversion.tigris.org/" target="_blank">subversion</a>.</p>
<p>The following are a list of sites that I managed to pull my information from:</p>
<ul>
<li> <a href="http://heidisoft.com/blog/installing-trac-hostmonster-or-bluehost" target="_blank">http://heidisoft.com/blog/installing-trac-hostmonster-or-bluehost</a></li>
<li><a href="http://fitri.manzanisimo.net/2008/05/23/hostmonster-python-25-subversion-14-django-svn-mysqldb-fcgid/" target="_blank">http://fitri.manzanisimo.net/2008/05/23/hostmonster-python-25-subversion-14-django-svn-mysqldb-fcgid/</a></li>
</ul>
<h2>The Requirements</h2>
<p><em>These are mainly pulled from the Trac requirements</em></p>
<ul>
<li>Linux</li>
<li>Apache</li>
<li>SSH access</li>
</ul>
<p>Everything else that is required will be installed and setup in the following steps.</p>
<h2>The Goods</h2>
<p>First setup the three directories that we&#8217;ll be using throughout this <strong>How To</strong>. It&#8217;s best to create these directories in your <em>~/home</em> directory.</p>
<p><code>mkdir install_files<br />
mkdir svn<br />
mkdir trac_sites<br />
mkdir packages</code></p>
<p>Pretty self-explanatory, <em>install_files</em> will be a location where you&#8217;ll download all the needed files to, <em>svn</em> will be where you will house all your projects under version control, <em>trac_sites</em> is the location where the <strong>Trac</strong> projects will be stored, and finally <em>packages</em> will be where we are going to install and run all the needed scripts.</p>
<h3>Setting Your Environment</h3>
<p>There are a couple files that you will need to modify. The first is to add a few variables to your <em>~/.bash_profile</em>.</p>
<p><code>export PYTHONPATH="$HOME/packages/lib/python2.5/site-packages"<br />
export LD_LIBRARY_PATH="$HOME/packages/lib"<br />
export PATH="$HOME/packages/bin:$PATH"</code></p>
<p>Save the file and then run.</p>
<p><code>source ~/.bash_profile</code></p>
<p>Next is your <em>~/.bashrc</em> file, just add the following line to the end.</p>
<p><code>PATH=~/packages/bin:$PATH</code></p>
<p>Save the file and then run.</p>
<p><code>source ~/.bashrc</code></p>
<p>These will setup all the needed references for the following steps.</p>
<h3>Installing Python</h3>
<p>Trac requires python in order to run, so I decided to install version <em>2.5.2</em>. I chose this version because it already includes the <strong>SQLite</strong> database, which is another requirement of Trac. First, make sure you&#8217;re in the <strong>install_files</strong> directory then run:</p>
<p><code>wget http://www.python.org/ftp/python/2.5.2/Python-2.5.2.tar.bz2<br />
tar xjf Python-2.5.2.tar.bz2<br />
cd Python-2.5.2<br />
make clean<br />
./configure --prefix=$HOME/packages<br />
make &amp;&amp; make install<br />
cd ..</code></p>
<h3>Installing Clearsilver</h3>
<p>You should be back in the <em>~/install_files</em> directory. If you&#8217;re not, navigate yourself back so you are for the next step. <strong>Clearsilver</strong> is part of the templating system that <strong>Trac</strong> uses. Because I went with version<em> 2.5.2</em> of <strong>Python</strong> you need to make sure that you install version <em>10.4+</em> of <strong>Clearsilver</strong>.</p>
<p><code>wget http://www.clearsilver.net/downloads/clearsilver-0.10.4.tar.gz<br />
tar zxf clearsilver-0.10.4.tar.gz<br />
cd clearsilver-0.10.4<br />
make clean<br />
sed -i "s@/usr/local/bin/python@/usr/bin/env python@g" \<br />
scripts/document.py<br />
PYTHON_SITE=`$HOME/packages/bin/python -c \<br />
"import sys; print [path for path in sys.path if \<br />
path.find('site-packages') != -1][0]"` \<br />
./configure --with-python=$HOME/packages/bin/python \<br />
--prefix=$HOME/packages \<br />
--disable-ruby --disable-java --disable-apache --disable-csharp --disable-perl<br />
make &amp;&amp; make install<br />
cd ..</code></p>
<h3>Installing easy_install</h3>
<p>This will setup and install the <strong>Python</strong> module <strong>easy_install</strong>. Trac uses this command frequently to install additional plugins and addons. Again, make sure you&#8217;re in the <em>~/install_files</em> directory.</p>
<p><code>wget http://peak.telecommunity.com/dist/ez_setup.py<br />
python ez_setup.py --prefix=$HOME/packages</code></p>
<h3>Installing SWIG</h3>
<p><strong>SWIG</strong> are the bindings that <strong>Trac</strong> uses to work and communicate with <strong>Subversion</strong>.</p>
<p><code>wget http://dl.sourceforge.net/sourceforge/swig/swig-1.3.31.tar.gz<br />
tar zxf swig-1.3.31.tar.gz<br />
cd swig-1.3.31<br />
make clean<br />
./configure --prefix=$HOME/packages<br />
make &amp;&amp; make install<br />
cd ..</code></p>
<h3>Installing Subversion</h3>
<p>Setting up <strong>Subversion</strong> is a little more difficult than the other packages.  I had a difficult time getting everything to work properly with <strong>Trac</strong>. First, I needed to make sure that I had the <em>dep</em> package for <strong>Subversion</strong> as well. These included the tools to communicate with <strong>Apache</strong> (<em>apr, apr-util, and neon)</em>. However, even after configuring the package with the <em>dep</em> tools, I was still getting an error when trying to use <strong>Subversion</strong>. The solution turned out that I needed to compile the tools separately prior to compiling <strong>Subversion</strong>. I&#8217;ve already taken the liberty of breaking out those steps for you here. But first, let&#8217;s get the <strong>Subversion</strong> files&#8230; you are again in the <em>~/installed_files</em> directory, right?</p>
<p><code>wget http://subversion.tigris.org/downloads/subversion-1.4.6.tar.bz2<br />
wget http://subversion.tigris.org/downloads/subversion-deps-1.4.6.tar.bz2<br />
tar xjf subversion-1.4.6.tar.bz2<br />
tar xjf subversion-deps-1.4.6.tar.bz2<br />
cd subversion-1.4.6</code></p>
<h4>apr</h4>
<p><code>cd apr<br />
make clean<br />
./configure --enable-shared --prefix=$HOME/packages<br />
make &amp;&amp; make install</code></p>
<h4>apr-util</h4>
<p><code>cd ../apr-util<br />
make clean<br />
./configure --enable-shared --prefix=$HOME/packages \<br />
--with-expat=builtin --with-apr=$HOME/packages \<br />
--without-berkeley-db<br />
make &amp;&amp; make install</code></p>
<h4>neon</h4>
<p><code>cd ../neon<br />
make clean<br />
./configure --enable-shared --prefix=$HOME/packages \<br />
--with-libs=$HOME/packages --with-ssl<br />
make &amp;&amp; make install</code></p>
<h4>and finally, subversion</h4>
<p><code>cd ..<br />
make clean<br />
./configure --prefix=$HOME/packages --without-berkeley-db \<br />
--with-editor=/usr/bin/vim --with-apr=$HOME/packages \<br />
--with-apr-util=$HOME/packages --with-neon=$HOME/packages \<br />
--with-swig=$HOME/packages/bin/swig \<br />
--with-ssl --with-zlib --with-expat=builtin<br />
make &amp;&amp; make install<br />
make swig-py &amp;&amp; make install-swig-py<br />
cd ~/packages/lib/python2.5/site-packages<br />
echo $HOME/packages/lib/svn-python &gt; subversion.pth<br />
ln -s ~/packages/lib/svn-python/libsvn<br />
ln -s ~/packages/lib/svn-python/svn<br />
python -c "from svn import client"<br />
cd ~/install_files</code></p>
<p><strong>Note:</strong> At times I would get errors when compiling these packages. I&#8217;m not sure why, but if I ran the <em>make</em> and <em>make install</em> on separate lines, it seemed to fix the issue.</p>
<h4>Create your first repository</h4>
<p>Just run the following command to create a new repository. <em>Replace the {rep_name} with whatever you&#8217;d like to call your project.</em></p>
<p><code>svnadmin create $HOME/svn/{rep_name}</code></p>
<h3>Installing Trac</h3>
<p>For this <strong>How To</strong> I decided to go with version 0.<em>10.4</em> of <strong>Trac</strong>. I attempted to try for version <em>0.11</em> but I had difficulty logging in to administer the site and never found a solution to the problem.</p>
<p><code>wget http://ftp.edgewall.com/pub/trac/trac-0.10.4.tar.gz<br />
tar zxf trac-0.10.4.tar.gz<br />
cd trac-0.10.4<br />
python setup.py install --prefix=$HOME/packages<br />
cd ..</code></p>
<h4>Creating your first environment</h4>
<p>The next few commands will help you setup your first environment, including setting up permissions. For this, I&#8217;ve gone with a pretty strict set of permissions. I only want users that I give access to, to be able to view my source code and edit the wiki pages. You can, of course, set it up however you would like. <em>Replace {trac_env} with whatever environment name you would like.</em></p>
<p><code>trac-admin $HOME/trac_sites/{trac_env} initenv</code></p>
<h4>Permissions</h4>
<p><code>trac-admin $HOME/trac_sites/{trac_env} permission remove anonymous '*'<br />
trac-admin $HOME/trac_sites/{trac_env} permission remove authenticated '*'<br />
trac-admin $HOME/trac_sites/{trac_env} permission add admin TRAC_ADMIN<br />
trac-admin $HOME/trac_sites/{trac_env} permission add {admin_username} admin<br />
trac-admin $HOME/trac_sites/{trac_env} permission add anonymous WIKI_VIEW<br />
trac-admin $HOME/trac_sites/{trac_env} permission add authenticated ROADMAP_VIEW WIKI_MODIFY<br />
trac-admin $HOME/trac_sites/{trac_env} permission add authenticated TICKET_VIEW TICKET_CREATE<br />
trac-admin $HOME/trac_sites/{trac_env} permission add authenticated REPORT_VIEW MILESTONE_VIEW<br />
trac-admin $HOME/trac_sites/{trac_env} permission add {authenticate_username} authenticated</code></p>
<h3>Installing Trac Modules</h3>
<p>There are a lot of modules out there that expand <strong>Trac</strong> to do quite a bit beyond it&#8217;s initial setup. I&#8217;ve only needed three additional modules, <em>WebManager, AccountManager</em> and <em>Pygments</em>.</p>
<h4>WebManager</h4>
<p>This is a <strong>MUST!</strong> Allows you to manage the <strong>Trac</strong> environment and settings directly from the web.</p>
<p><code>svn co http://svn.edgewall.com/repos/trac/sandbox/webadmin/<br />
cd webadmin<br />
python setup.py egg_info<br />
python setup.py bdist_egg<br />
cd dist<br />
easy_install --prefix=$HOME/packages *.egg<br />
cd ~/install_files</code></p>
<h4>AccountManager</h4>
<p>Better handles the login and users of the <strong>Trac</strong> environment to the web.</p>
<p><code>svn co http://trac-hacks.org/svn/accountmanagerplugin/0.10 accountmanagerplugin<br />
cd accountmanagerplugin<br />
python setup.py bdist_egg<br />
cd dist<br />
easy_install --prefix=$HOME/packages *.egg<br />
cd ~/install_files</code></p>
<h4>Pygments</h4>
<p>Pygments is a plugin that will color the syntax of your code when you&#8217;re browsing the source. I chose this plugin because I do a lot of <strong>PHP</strong> programming, and <strong>Trac</strong> did not display <strong>PHP</strong> scripts at all without it.</p>
<p><code>easy_install --prefix=$HOME/packages Pygments</code></p>
<p>Once you&#8217;ve installed all the plugins, they now need to be configured in the <em>trac.ini</em> file. This file is located within your trac environment. If you&#8217;ve been following these steps, it should be located at <em>~/trac_sites/{trac_env}/conf/trac.ini</em>. Use your editor of choice to modify this file and add the following to the end of it. But before you do that, let&#8217;s add an initial user. <em>These must be the same usernames that you created when setting up the permissions for the trac environment.</em></p>
<p><code>htpasswd -c ~/trac_sites/trac.htpasswd {username}</code></p>
<p>Append this to the <em>trac.ini</em> file.</p>
<p><code>[account-manager]<br />
password_format = htpasswd<br />
password_file = /home/{your username}/trac_sites/trac.htpasswd</code></p>
<p><code>[components]<br />
acct_mgr.* = enabled<br />
trac.mimeview.api.plaintextrenderer = disabled<br />
trac.mimeview.enscript.enscriptrenderer = enabled<br />
trac.mimeview.php.phprenderer = disabled<br />
trac.mimeview.silvercity.silvercityrenderer = disabled<br />
trac.web.auth.loginmodule = disabled<br />
tracpygments.* = enabled<br />
webadmin.* = enabled</code></p>
<h2>Finalize</h2>
<p>Well, you&#8217;ve made it this far. Only a few more steps and you should be good to go!</p>
<h3>Making Trac Web Accessible</h3>
<p>These next few steps will allow you to access <strong>Trac</strong> from the web. Now, I&#8217;ve set it up so that <strong>Trac</strong> is a subdomain of my site. So it&#8217;s something like <em>trac.your-domain.com</em>. Within the root of my site I&#8217;ve created a <em>trac</em> directory for the subdomain to point to. Again, this is preference, and you can have it however you&#8217;d like. But the first step is to navigate to whatever directory that you&#8217;d like to view <strong>Trac</strong> from. Once there you&#8217;re going to create a new file <em>index.cgi</em>. Since it&#8217;s a <em>.cgi</em> file, you <strong>must</strong> make sure that it has execute permissions. Then open your favorite editor and drop this in.</p>
<p><code>#!/bin/bash<br />
export HOME="/home/{username}"<br />
export TRAC_ENV="$HOME/trac_sites/{your trac project id}"<br />
export PYTHONPATH="$HOME/packages/lib/python2.5/site-packages"<br />
export PATH="$HOME/packages/bin:$PATH"<br />
export LD_LIBRARY_PATH="$HOME/packages/lib"<br />
exec $HOME/packages/share/trac/cgi-bin/trac.cgi</code></p>
<p>Next we&#8217;re going to make a link to the common files that <strong>Trac</strong> uses to help speed up the display of the page. Things like the stylesheets, images, and javascript that help the site function. Again, make sure you&#8217;ve navigated to the directory where you are viewing <strong>Trac</strong> from.</p>
<p><code>mkdir chrome<br />
ln -s $HOME/packages/share/trac/htdocs ./chrome/common</code></p>
<p>Finally, we need to modify the <em>.htaccess</em> file so that the site knows that <em>index.cgi</em> is the default page of the directory and we must make sure that <em>mod_rewrite</em> is on. So open <em>.htaccess</em> with your editor and drop this in.</p>
<p><code>Setup Rewrite Rule<br />
Edit .htaccess located in the {domain name} directory<br />
DirectoryIndex index.cgi<br />
Options ExecCGI FollowSymLinks</code></p>
<p><code>RewriteEngine On<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteRule ^(.*)$ /index.cgi/$1 [L]</code></p>
<p>And with that, you&#8217;re done! Ok, not quite&#8230; this final snippet is to replace and clean up the links within the <strong>Trac</strong> environment.  Since every link will pass through <em>index.cgi</em> the addressbar will always show it in the link. Like so: <em>http://trac.your-domain.com/index.cgi/wiki</em>. You can fix this like so, first navigate to this directory.</p>
<p><code>cd $HOME/packages/lib/python2.5/site-packages/trac/web</code></p>
<p>Then make a backup of the <em>api.py</em> file</p>
<p><code>cp api.py api.py.backup</code></p>
<p>Now open <em>api.py</em> in your editor and find this line.</p>
<p><code>base_path = property(fget=lambda self: self.environ.get('SCRIPT_NAME', ''), doc='The root path of the application')</code></p>
<p>and change it to</p>
<p><code>base_path = property(fget=lambda self: os.path.dirname(self.environ.get('SCRIPT_NAME', '')), doc='The root path of the application')</code></p>
<p>NOW, you&#8217;re done! Please feel free to leave a comment. Remember, results may vary, I tried to keep this as generic as possible, but sometimes things don&#8217;t always work the way you expect them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phxis.net/2008/12/25/how-to-setting-up-trac-on-a-shared-server/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
