Trac

From MattWiki
Jump to: navigation, search

Install Trac from Source

Version 0.11

yum install httpd mod_python python python-genshi python-setuptools python-setuptools-devel
rm -rf /var/src/trac
svn checkout http://svn.edgewall.org/repos/trac/branches/0.11-stable/ /var/src/trac
cd /var/src/trac
python ./setup.py install
easy_install http://trac-hacks.org/svn/accountmanagerplugin/0.11
easy_install http://trac-hacks.org/svn/gitplugin/0.11
easy_install http://trac-hacks.org/svn/hackergotchiplugin/0.11/
easy_install http://trac-hacks.org/svn/googlewebmasterverifyplugin/0.11/

Version 0.12

yum install httpd mod_python python python-setuptools python-setuptools-devel
rm -rf /var/src/genshi
svn checkout http://svn.edgewall.org/repos/genshi/branches/stable/0.6.x/ /var/src/genshi
cd /var/src/genshi
python ./setup.py install
rm -rf /var/src/trac
svn checkout http://svn.edgewall.org/repos/trac/branches/0.12-stable/ /var/src/trac
cd /var/src/trac
python ./setup.py install
easy_install http://trac-hacks.org/svn/accountmanagerplugin/trunk/
easy_install http://trac-hacks.org/svn/gitplugin/0.12

Version Trunk/1.0

yum install httpd mod_python python python-genshi python-setuptools python-setuptools-devel
rm -rf /var/src/trac
svn checkout http://svn.edgewall.org/repos/trac/trunk/ /var/src/trac
cd /var/src/trac
python ./setup.py install
easy_install http://trac-hacks.org/svn/accountmanagerplugin/trunk/
easy_install http://trac-hacks.org/svn/gitplugin/0.12
easy_install TracAuthOpenId

Creating a new Trac site

trac-admin /path/to/websites/directory initenv

Adding user permissions

First go to the directory and create a new htpasswd file and add a user. If you already have a htpasswd file, just add the user.

cd /path/to/websites/directory
htpasswd -c .htpasswd mattrude

Then give the user Admin permission if that's the plan.

trac-admin . permission add mattrude TRAC_ADMIN

Account's Management Plugin

Under Admin -> Accounts -> Configuration Set the following changing the realms & filenames to the appropriable values. Trac-accounts-plugin.jpg

Installing Trac on a Fedora system using Nginx

In /etc/rc.local add:

export TRAC_ENV_INDEX_TEMPLATE=/var/www/trac.mattrude.com/projects_list_template.html
tracd -d -p 3050 --auth="*,/var/www/trac.mattrude.com/projects/.htpasswd,trac.mattrude.com" \
  --protocol=http -e /var/www/trac.mattrude.com/projects &

Then, in your nginx.conf file, added:

   # trac.mattrude.com
   upstream trac.mattrude.com {
       server 127.0.0.1:3050;
   }
   
   server {
       listen 80;
       server_name trac.mattrude.com;
       root /var/www/trac.mattrude.com;
       
       location /html/ { 
       	expires 180d;
       }
       
       location /favicon.ico { }
       location /robots.txt { }
       
       location / {
               proxy_pass        http://trac.mattrude.com;
               proxy_set_header  X-Real-IP  $remote_addr;
       }
   }

Installing Trac on a Fedora system using 'TracModPython' on Apache

yum install python-sqlite2 trac subversion

This setup assumes that you already have a Subversion Repo running on this same box.

  • Change to the /var/www directory.
cd /var/www
  • Create a new SVN project if you haven't yet.
mkdir svn
svnadmin create  --fs-type fsfs /var/www/svn
  • Now to setup the Trac Repo and Enverment.
trac-admin /var/www/trac initenv
  • Change the Ownership of some directory's
chown -R apache:apache /var/www/trac
chown -R apache:apache /var/www/svn

Re-syncing a Repository

First go to the trac directory

trac-admin ./ repository resync "(default)"

References