TRAC on Fedora with 5 steps

Você pode ler este post em português também.

Hello!

This month I’ll show you how to perform a clean installation of the TRAC on Fedora.

TRAC is the best open source SCM tool that I’ve listened. The Fedora distribution is a widely used GNU/Linux.

At the end of this article I’ll also show how to use it with the GIT, making it a version control system too.

 

Let’s do it!

  1. Packages installation:
    • su -
    • yum update
    • yum install wget python python-devel python-setuptools python-genshi python-docutils python-pygments policycoreutils-python
    • yum install httpd httpd-tools mod_python
    • yum install python-offtrac trac trac-accountmanager-plugin trac-customfieldadmin-plugin trac-doxygen-plugin trac-iniadmin-plugin trac-privateticketsplugin trac-ticketdelete-plugin trac-tracnav-plugin trac-xmlrpc-plugin
  2. Creation of the TRAC environment on filesystem. We’ll call the base directory of your project of BASE_DIR (that’d be, for instance, /var/www/html/nome_projeto/scm). The commands semanage and restorecon give to the TRAC files the same context of Apache to the SeLinux. Obviously, you can ignore them if your SeLinux is disabled:
    • trac-admin BASE_DIR initenv
    • chown -R apache.apache BASE_DIR
    • semanage fcontext -at httpd_sys_content_t "BASE_DIR(/.*)?"
    • semanage fcontext -at httpd_sys_content_rw_t "BASE_DIR/attachments(/.*)?"
    • semanage fcontext -at httpd_sys_content_rw_t "BASE_DIR/conf(/.*)?"
    • semanage fcontext -at httpd_sys_content_rw_t "BASE_DIR/db(/.*)?"
    • semanage fcontext -at httpd_sys_content_rw_t "BASE_DIR/log(/.*)?"
    • chown -R apache:apache BASE_DIR
    • restorecon -R BASE_DIR
  3. Creation of the user which will does the administration of the TRAC environment for the project. We’ll call this user ADMIN_USER:
    • htpasswd -c BASE_DIR/conf/trac.htpasswd ADMIN_USER
    • trac-admin BASE_DIR
    • permission add ADMIN_USER TRAC_ADMIN
  4. To modify the Apache configuration. First, we’ll add an alias and a directory tag pointing to the base directory of TRAC (ScriptAlias e Directory). After, we’ll configure the specific directives for the environment (Location). Just to remind you, these directives could be, if necessary, inside a VirtualHost container:
    • ScriptAlias /trac/ "BASE_DIR/"
      <Directory "BASE_DIR">
      AllowOverride None
      Options None
      Order allow,deny
      Allow from all
      </Directory>
      
      <Location /trac>
      SetHandler mod_python
      PythonHandler trac.web.modpython_frontend
      PythonOption TracEnv BASE_DIR
      PythonOption TracUriRoot /trac
      SetEnv PYTHON_EGG_CACHE /tmp
      PythonInterpreter trac
      </Location>
      
      <Location /trac/login>
      AuthType Basic
      AuthName "Name of the project"
      AuthUserFile BASE_DIR/conf/trac.htpasswd
      Require valid-user
      </Location>
  5. The last step is to restart the Apache:
    • service httpd restart

Everything is done! Point your browser to access the TRAC environment (maybe the famous http://localhost/trac/) e have fun!

 

Git

If you want use GIT as a plugin of TRAC, do the steps below, additionaly:

  • Install GIT and the git plugin of the TRAC:
    • yum install git GitPython
    • yum install trac-git-plugin
  • Modify the file BASE_DIR/conf/trac.ini as follow:
    • The line repository_dir should point to same directory of the HEAD file of your repository (normally REPO_DIR/.git);
    • Add the lines below to the end of file:
      • [components]
      • tracext.git.* = enabled
  • The source directory must have its read and write permissions assigned to Apache.

The five steps above will give you a TRAC environment ready for use. To improve it and adapt it to your needs, visit the website TracHacks where there are many plugins for download.

See you 😉

Você pode ler este post em português também.

About Adriano Laranjeira

Software engineer & developer See more at http://about.me/arglbr
This entry was posted in English and tagged . Bookmark the permalink.

1 Response to TRAC on Fedora with 5 steps

  1. Pingback: Adriano Laranjeira » Blog Archive » TRAC no Fedora em 5 passos

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s