How to install Trac on Ubuntu

Prerequisites

  • Apache with SSL
  • SVN

Installation

  1. Install Package
    • $ sudo apt-get install trac
  2. Create the Trac Environments Directory
    • $ sudo mkdir /home/trac
    • $ sudo chown www-data:www-data /home/trac
  3. Setup Apache2
    <VirtualHost servername:443>
        ServerName servername
        ServerAdmin admin@servername
    
        SSLEngine On
        SSLCertificateFile /etc/apache2/ssl/apache.pem
    
        DocumentRoot /var/www/trac
        <Directory />
            Options None
            AllowOverride None
            allow from all
        </Directory>
    
        # Trac settings
        <Directory "/var/www/trac">
            Options +FollowSymLinks
            AllowOverride None
            Order allow,deny
            Allow from all
        </Directory>
    
        <Directory "/var/www/trac/projects">
            AllowOverride None
            Options ExecCGI -MultiViews +FollowSymLinks
            AddHandler cgi-script .cgi
            Order allow,deny
            Allow from all
        </Directory>
    
        # for multiple projects
        RewriteEngine on
        RewriteRule ^/projects/+$            /projects/index.html [L]
        RewriteCond /home/trac/$1            -d
        RewriteRule ^/projects/([[:alnum:]_]+)(/?.*)    /projects/trac.c
    gi$2 [S=1,E=TRAC_ENV:/home/trac/$1]
        RewriteRule ^/projects/(.*)          /projects/index.html
    
        # You need this to allow users to authenticate
        # trac.htpasswd can be created with
        # cmd 'htpasswd -c trac.htpasswd' (UNIX)
        # do 'man htpasswd' to see all the options
        <LocationMatch "/projects/[[:alnum:]_]+/login">
            AuthType Basic
            AuthName "trac"
            require group dev
        </locationMatch>
    
        ErrorLog /var/log/apache2/trac_error.log
    
        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn
    
        CustomLog /var/log/apache2/trac_access.log combined
        ServerSignature On
    </VirtualHost>
  4. Setup Trac web home directory (/var/www/trac)
    • index.html
    • projects/
      • trac.cgi -> /usr/share/trac/cgi-bin/trac.cgi
    • trac -> /usr/share/trac/htdocs
  5. Restart Apache
    • $ sudo chown -R www-data /usr/share/trac
    • $ sudo apache2 -k restart
  6. Creating Environments
    • $ sudo mkdir /home/trac
    • $ sudo trac-admin /home/trac/YourProjectNameHere initenv
    • $ sudo chown -R www-data /home/trac/YourProjectNameHere
    • The “trac-admin" command shown above prompted me to enter:
      • the project name (YourProjectNameHere)
      • the path to svn repository (/home/svn/YourProjectNameHere)
      • the path to the Trac templates directory (/usr/share/trac/templates)
  7. Access your project

Reference Link:

TracOnUbuntu – The Trac Project – Trac

13 則迴響 »

  1. Thommy said

    The line under point 3 should be:

    RewriteRule ^/projects/([[:alnum:]_]+)(/?.*) /projects/trac.c
    gi$2 [S=1,E=TRAC_ENV:/home/trac/$1]

    (the letter T was missing)

  2. Philip said

    Fix.
    Thank you.

  3. hscbaj said

    what’s going on with step 4? The rest seems a good step by step guide but part 4 is a bit… lacking instructions!
    thanks anyway🙂

  4. […] Phillip@swarchy: https://philipatswarchy.wordpress.com/2006/12/17/how-to-install-trac-on-ubuntu/ […]

  5. […] How to install Trac on Ubuntu « Philip@Swarchy […]

  6. […] How to install Trac on Ubuntu « Philip@Swarchy […]

  7. […] Link […]

  8. […] Phillip@swarchy: https://philipatswarchy.wordpress.com/2006/12/17/how-to-install-trac-on-ubuntu/ […]

  9. Have you ever thought about including a little bit more than
    just your articles? I mean, what you say is important and everything.

    However just imagine if you added some great graphics or video
    clips to give your posts more, “pop"! Your content is excellent but with pics and videos, this site could
    definitely be one of the best in its niche. Superb blog!

  10. Winona said

    Attractive area of content. I simply found your website then in accession capital to assert that we get in reality loved account your weblog posts.

    Anyway I’ll be subscribing in your augment and also I achievement you get admission to consistently quickly.

  11. It’s actually a nice and useful amount of
    info. I’m glad that you just shared this useful info together with us.
    Please stay us informed along wrinkles. Thanks for sharing.

  12. Cecila said

    Thanks to the auspicious writeup. It in reality was once a leisure
    account it. Glance advanced to far brought agreeable by you!
    However, how can we keep up a correspondence?

  13. I have been surfing online more than 2 hours today, yet I never found any interesting
    article like yours. It’s pretty worth enough for me.
    In my view, if all website owners and bloggers made good content as you did, the internet will be a
    lot more useful than ever before.

RSS feed for comments on this post · TrackBack URI

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

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

Twitter picture

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

Facebook照片

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

Google+ photo

You are commenting using your Google+ account. Log Out / 變更 )

連結到 %s

%d 位部落客按了讚: