Installing Trac on the Hostmonster or Bluehost

25
Nov

This guide was made primarily to help Hostmonster customers setup Trac. However, the setup is generic enough, that with only little modification, this guide can be applied to any shared-hosting setup running the Apache webserver (or if you want to use cgi for some reason). To work, you will need access to shell, and have basic understanding of text editing in shell. Hostmonster provides python2.3, and easy subversion repository setup - so these are assumed to already be in place.

Also, because I do not like the login hack described on the Hostmonster Trac Wiki, I have assumed that you will install one of the login plugins. However, if you have access to the Apache setup file and do not wish to use a login manager, you can use the account setup method outlined in the Trac wiki.

My installed Trac

http://trac.heidisoft.com

Requirements
Please use fresh copy of the shared host, NUKE process will do that, ask it from support.

Warning:
When you copy a string from here make sure the correct syntax is there (Eg: ",` ... ).
In the "wget" some of them should have "" in the URL string make sure to put those too.

Python
I found installing a local copy of python to be unnecessary, as the extra modules can be installed in the trac's lib path. To assure access to these libs, the PYTHONPATH environment variable must reference the aforementioned path.

Environmental Variables


Add this to ~/.bash_profile:
export PYTHONPATH="$HOME/packages/lib/python2.3/site-packages"
export LD_LIBRARY_PATH="$HOME/packages/lib"
export PATH="$HOME/packages/bin:$PATH"
source ~/.bash_profile

Installation

Setup

I recommend making a special directory for the install files and packages; this makes it easier to manage, and you can delete the entire directory of install files at the end. I used ~/packages and ~/install_files personally, and will be using them throughout these instructions - so if you want to use another directory, just replace all references.


* cd
* mkdir install_files
* mkdir packages
* mkdir trac_sites

Install Trac (0.10.3)


* cd ~/install_files
* wget http://ftp.edgewall.com/pub/trac/trac-0.10.3.tar.gz
* tar zxf trac-0.10.3.tar.gz
* cd trac-0.10.3
* python setup.py install --prefix=$HOME/packages


Install Clearsilver (0.10.4)


* cd ~/install_files
* wget http://www.clearsilver.net/downloads/clearsilver-0.10.4.tar.gz
* tar zxf clearsilver-0.10.4.tar.gz
* cd clearsilver-0.10.4
sed -i "s@/usr/local/bin/python@/usr/bin/env python@g" \
scripts/document.py
PYTHON_SITE=`/home/{username}/packages/bin/python -c \
"import sys; print [path for path in sys.path if \
path.find('site-packages') != -1][0]"` \
./configure --with-python=/home/{username}/packages/bin/python \
--prefix=$HOME/packages \
--disable-ruby --disable-java --disable-apache --disable-csharp --disable-perl
* make
* make install


Install SQLite (3.3.13)


* cd ~/install_files
* wget http://www.sqlite.org/sqlite-3.3.13.tar.gz
* tar zxf sqlite-3.3.13.tar.gz
* cd sqlite-3.3.13
* ./configure --prefix=$HOME/packages
* make
* make install
* ln -s $HOME/packages/bin/sqlite3 $HOME/packages/bin/sqlite


Install PySQLite (2.3.3)


* cd ~/install_files
* wget http://initd.org/pub/software/pysqlite/releases/2.3/2.3.3/pysqlite-2.3.3...
* tar zxf pysqlite-2.3.3.tar.gz
* cd pysqlite-2.3.3
* In setup.py, change
include_dirs = [] to include_dirs = ['$HOME/packages/include']
and
library_dirs = [] to library_dirs = ['$HOME/packages/lib']
* python setup.py build
* python setup.py install --prefix=$HOME/packages


Install SWIG (1.3.31)


* cd ~/install_files
* wget http://dl.sourceforge.net/sourceforge/swig/swig-1.3.31.tar.gz
* tar zxf swig-1.3.31.tar.gz
* cd swig-1.3.31
* ./configure --prefix=$HOME/packages --with-python=/usr/bin/python
* make
* make install


Install Subversion (1.4.3)


* cd ~/install_files
* wget http://subversion.tigris.org/downloads/subversion-1.4.3.tar.gz
* tar zxf subversion-1.4.3.tar.gz
* cd subversion-1.4.3
* ./configure PYTHON=/usr/bin/python --prefix=$HOME/packages \
--with-swig=$HOME/packages/bin/swig --without-berkeley-db \
--with-ssl --with-zlib
* make
* make install
* make swig-py
* make install-swig-py
* cd ~/packages/lib/python2.3/site-packages
* echo $HOME/packages/lib/svn-python > subversion.pth
* ln -s ~/packages/lib/svn-python/libsvn
* ln -s ~/packages/lib/svn-python/svn
* Test it with python -c "from svn import client" (No errors should result.)


Setup Trac Environment


* trac-admin $HOME/trac_sites/{your trac project id} initenv
("{your trac project id}" can be anything you like. Putting all your Trac environments in your trac_sites directory allows for simpler backup!)
You will be asked for
o Project Name: {Whatever you want}
o Database connection string: {Accept the default (just hit return)}
o Type of version control: {Accept the default (just hit return)}
o Path to repository: /home/{yourusername}/svn/{your svn project id}
o Templates directory: {Accept the default (just hit return)}
* trac-admin $HOME/trac_sites/{your trac project id} will put you into interactive mode. You can issue a simple help at the prompt to see what you can do. There are lots of administrative actions in interactive mode that can make your life a little easier than it would be if you always had to go through the WebAdmin interface.
You should add at least one user with admin powers. To do this, in interactive mode:
o permission add admins TRAC_ADMIN
o permission add {username} admins
o exit (to quit interactive mode)
During interactive mode, permission list should show the new users on the list.


Make Trac Web Accessible


* cd ~/{my.domain.name}
* Make index.cgi (make sure to set the permissions so the webserver can read it - 775):
#!/bin/bash
export HOME="/home/{username}"
export TRAC_ENV="$HOME/trac_sites/{your trac project id}"
export PYTHONPATH="$HOME/packages/lib/python2.3/site-packages"
export PATH="$HOME/packages/bin:$PATH"
export LD_LIBRARY_PATH="$HOME/packages/lib"
exec $HOME/packages/share/trac/cgi-bin/trac.cgi
Then set the default by editing .htaccess:
DirectoryIndex index.cgi

Now direct your browser in to the {my.domain.name} you must see the Trac project page,if not go to the CPanel and PHP Config, and install PHP.ini Master file. That's all. :).
For any question contact me : heshanmw (at) gmail.com

Prettiness

Pretty URLs


Setup static mapping

This allows the common static files (images, CSS, javascript, etc) to be accessed directly, rather than mapping through the cgi script. (This makes Trac faster, while providing compatibility with the prettiness.)


* cd ~/{domain name}
* mkdir chrome
* ln -s $HOME/packages/share/trac/htdocs ./chrome/common
Setup Rewrite Rule
Edit .htaccess located in the {domain name} directory
DirectoryIndex index.cgi
Options ExecCGI FollowSymLinks

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.cgi/$1 [L]

This will prefix any failed request with index.cgi (to run it through Trac).

Hack the Trac base_url

This sets any links Trac generates to ignore the file generated from, and just start from the directory, rather than the file that processed the generation. (/blarg/foobar, instead of /blarg/index.cgi/foobar)


* cd $HOME/packages/lib/python2.3/site-packages/trac/web
* Backup the original api.py in case you want to revert.
cp api.py api.py.backup
* Edit api.py, change
base_path = property(fget=lambda self: self.environ.get('SCRIPT_NAME', ''),
doc='The root path of the application')
to base_path = property(fget=lambda self: os.path.dirname(self.environ.get('SCRIPT_NAME', '')),
doc='The root path of the application')

Plugins

Setup Tools

We'll be using this to install the other plugins; so it is necessary to install this to follow my steps.


* cd ~/install_files
* wget http://peak.telecommunity.com/dist/ez_setup.py
* python ez_setup.py --prefix=$HOME/packages


WebAdmin Plugin


* cd ~/install_files
* svn co http://svn.edgewall.com/repos/trac/sandbox/webadmin/
* cd webadmin
* python setup.py egg_info
* python setup.py bdist_egg
* cd dist
* easy_install --prefix=$HOME/packages *.egg
* Now tell trac to load the plugin by editing $HOME/trac_sites/{your trac project id}/conf/trac.ini and adding to the components section:
[components]
webadmin.* = enabled


AccountManager Plugin

NOT COMPATIBLE WITH DbAuth

This will make the htpasswd login method much more pleasing. New users can register on their own using the site, and they can change their passwords if necessary. This also allows login via form, rather than the HTTP authentication.


* cd ~/install_files
* svn co http://trac-hacks.org/svn/accountmanagerplugin/0.10 accountmanagerplugin
* cd accountmanagerplugin
* python setup.py bdist_egg
* cd dist
* easy_install --prefix=$HOME/packages *.egg
* You must add an initial user, to create the initial trac.htpasswd file:
htpasswd -c ~/trac_sites/trac.htpasswd {username}
You'll then enter the password twice.
* Now tell trac to load the plugin by editing $HOME/trac_sites/{your trac project id}/conf/trac.ini and adding to the components section:
[components]
trac.web.auth.LoginModule = disabled
acct_mgr.* = enabled
[account-manager]
password_format = htpasswd
password_file = /home/{your username}/trac_sites/trac.htpasswd


DbAuth Plugin

NOT COMPATIBLE WITH AccountManager

Makes more sense than the normal login method. However it does not support new user registration like AccountManager, rather, you are required to enter all users in manually using sqlite. Because of this, I use AccountManager instead.


* cd ~/install_files
* svn co http://trac-hacks.org/svn/dbauthplugin/0.10 dbauthplugin
* cd dbauthplugin
* python setup.py bdist_egg
* cd dist
* easy_install --prefix=$HOME/packages *.egg
* cd ../install
* cp dbauth.db ~/trac_sites
* chmod 775 ~/trac_sites/dbauth.db
* Now you need to add some users; you'll have to do this manually. You'll probably want to add the same username(s) as you setup earlier.
o sqlite ~/trac_sites/dbauth.db
o INSERT INTO trac_users VALUES ('all', 'username', 'passwd', 'email@email.com');
INSERT INTO trac_permissions VALUES ('all', 'username', 'admins');
o .quit
* Now tell trac to load the plugin by editing $HOME/trac_sites/{your trac project id}/conf/trac.ini and adding to the components section:
[components]
trac.web.auth.* = disabled
dbauth.* = enabled
#trac.userdir.* = enabled # only if you want to use this
[central]
database = /home/{your username}/trac_sites/dbauth.db
envroot = /home/{your username}/trac_sites/{your trac project id}


IniAdmin Plugin

Adds the ability to configure trac.ini via a web interface.


* cd ~/install_files
* svn co http://trac-hacks.org/svn/iniadminplugin/trunk/ iniadmin
* cd iniadmin
* python setup.py bdist_egg
* cd dist
* easy_install --prefix=$HOME/packages *.egg
* Now tell trac to load the plugin by editing $HOME/trac_sites/{your trac project id}/conf/trac.ini and adding to the components section:
[components]
iniadmin.* = enabled


TracNav Plugin

Adds ability to add navigation elements to wiki pages.


* cd ~/install_files
* svn co http://svn.ipd.uni-karlsruhe.de/repos/javaparty/JP/trac/plugins/tracnav/
* cd tracnav
* python setup.py bdist_egg
* cd dist
* easy_install --prefix=$HOME/packages *.egg
* Now tell trac to load the plugin by editing $HOME/trac_sites/{your trac project id}/conf/trac.ini and adding to the components section:
[components]
tracnav.* = enabled


Cleanup

Now that you have everything setup the way you want, you can go ahead and delete all those setup files, and switch to fast_cgi

Delete setup files

Since you won't be using those setup files after you're done, if you don't want all those setup files to take up hard drive space, you can delete them.


* cd
* rm -rf install_files

Reference : http://natmaster.com/articles/installing_trac_0.10.php

Share this
9.08333
Average: 9.1 (12 votes)
Your rating: None

35 comments

16
Feb

Hello I have followed all the

Hello

I have followed all the details from this page and managed to start Trac. However I am not able to see any plugins on my website after installing them. I first installed the plugins in the ~/install_files directory as mentioned in this email, I beleive this installs the plugins globally and requires adding the component details to trac.ini which I have done.

As this did not change anything in the front end of my trac site, I also installed the plugins in the local project's plugin directory as well the same way mentioned in the above post but no luck. I do not know what I am missing, maybe something I am very sure of. Here are the version details I am working on.

Hosted on HostMonster Shared server:
OS: CentOS release 4.7 (Final)
Python: Python 2.3.4
clearsilver-0.10.5
pysqlite-2.3.3
sqlite-amalgamation-3.6.10
subversion-1.4.3
swig-1.3.38
trac-0.10.5

Please help.

30
Aug

`` Women in summer would like

``
Women in summer would like to become beautiful. Everything can grab other's eyes is their best friends.Products make them beauty and confident is their favourite. Look in the street,you can see many different types of make up to show women's personality.
Welcome to the shop, the following is our products, free shipping.
Soccer Shoes Cheap Soccer Shoes Nike Soccer Shoes Adidas Soccer Shoes Nike Soccer Shoes sale Adidas Soccer Shoes sale UGG UGGs UGG Boot UGG Boots UGG Boots Sale Cheap UGG Boots UGG Boots Cheap Women UGG boots ugg boots cardy ugg cardy boots Timberland Timberland sale Timberland boots Timberland boots online Timberland on sale New timberland boots UGG UGG boots UGG boots sale UGG boots short Short ugg Short ugg boots Ugg boots tall Nike Air Nike Air Max Nike Air Max Shoes Nike SB Nike Dunk Nike Dunk SB Nike Dunk SB Shoes Nike Shox Nike Shox Shoes Women Bags Women Bags Sale Women Handbags Women Handbags Sale Women New Bags Cheap Bags Cheap Bags On Sale New women bags New women bags sale New women bags sale online Louis Vuitton Handbags Gucci bags Nike Nike Shoes Nike Shoes Sale Nike running Nike running shoes Nike trainers Nike trainers shoes Timberland Timberland boots Timberland boots sale Timberland boot Timberland boot sale Timberland boots cheap Men timberlands MBT MBT Shoes MBT Chapa GTX MBT Men Shoes MBT Women Shoes Discount MBT Shoes LV Handbags Gucci Handbags Chanel Handbags Chloe Handbags D&G Handbags Dior Handbags Fendi Handbags Hermes Handbags Jimmy Choo Bags Marc Jacobs Bags Miu Miu Handbags Mulberry Bags Prada Handbags Versace Handbags Yves Saint Laurent Balenciaga Bags Burberry Handbags LV Handbags Gucci Handbags Chanel Handbags Chloe Handbags D&G Handbags Dior Handbags Fendi Handbags Hermes Handbags Jimmy Choo Bags Marc Jacobs Bags Miu Miu Handbags Mulberry Bags Prada Handbags Versace Handbags Yves Saint Laurent Balenciaga Bags Burberry Handbags
Those who want to become most beautiful in the world should try them. Just ones can make you different. Girls who want to grab your boyfriends's heart is necessary to use them.

30
Apr

Are you running on a Shared

Are you running on a Shared Host?

4
Jul

Good walkthrough, thanks. I

Good walkthrough, thanks. I don't see anyplace in Hostmonster cPanel that has to do with Subversion, so i'm curious how one is supposed to tell Apache about the repos. This typically done with a VirtualHost definition. Without this, repo browsing through Trac will work but ci/co won't. Cheers

14
Feb

Hi,I just went through all

Hi,I just went through all the steps of this guide with an updated version of TRAC.However, at the Make Trac Web Accessible step, I have no trace of an existing$HOME/packages/share/trac/cgi-bin/trac.cgi file.My trac version is:Trac-0.11.6Is there any one who managed to overcome such an issue ?Cheers.

25
Feb

Very Useful information ,

Very Useful information , this is both good reading for, have quite a few good key points, and I learn some new stuff from it too, thanks for sharing your information. regards,<a href="http://www.superchinawholesale.com">handbags</a>

25
Feb

I am not able to see any

I am not able to see any plugins on my website after installing them. I
first installed the plugins in the ~/install_files directory as
mentioned in this email, I beleive this installs the plugins globally
and requires adding the component details to trac.ini which I have done.
regards,
handbags

1
Jun
8
Jul

very good, look forward to

very good, look forward to view your other articles.<a href="http://www.prombtshoes.com/" title="mbt shoes">mbt shoes</a><a href="http://www.prombtshoes.com/" title="cheap mbt shoes">cheap mbt shoes</a> <a href="http://www.prombtshoes.com/" title="mbt shoes sale">mbt shoes sale</a>

8
Jul

Welcome to our website for

Welcome to our website for your [URL=http://www.topcoachoutlet.com/]coach purses[/URL]. Coach sunglasses here are made with high quality and stylish design.What is more, there are promotion activities here [URL=http://www.CoachPursesCheap.com]coach handbags[/URL]. That means you can buy low price coach sunglasses. Just have a look at our websites [URL=http://www.topcoachoutlet.com/coach-sunglasses-c-2334_2341.html]Coach Sunglasses[/URL], I am sure you would find your ideal coach sunglasses.

Post new comment

 
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

Donate to Us


Activity Stream

Who's online

There are currently 0 users and 16 guests online.
Theme designed by Donny Carette - Powered by Drupal - copyright © 2010