Edgewall Software

Changes between Version 23 and Version 24 of TracOnGentoo


Ignore:
Timestamp:
Mar 21, 2005, 10:37:42 AM (19 years ago)
Author:
lycos42@…
Comment:

structure layout

Legend:

Unmodified
Added
Removed
Modified
  • TracOnGentoo

    v23 v24  
    3636I wanted to use Trac for each development project I had, and configure the Apache 2 webserver on my Gentoo Linux box to create a (name-based) virtual host that would hold every Trac instance (more information on virtual hosts can be found here). The following is what I did, as root, to make the whole thing work.
    3737
    38 Say the development vhost is known as dev.domain.tld. Basically I wanted to access to each project website via http://dev.domain.tld/projectX/.
    39 1. Emerging Trac
     38Say the development vhost is known as dev.domain.tld. Basically I wanted to access to each project website via http://dev.domain.tld/projectX/.
     39
     40=== 1. Emerging Trac ===
    4041
    4142Since mod_python support is a new feature of 0.7.1 and is still experimental, I'm not going to use it and I'll stick with a simple CGI installation. You'll see that using a CGI installation together with webapp-config on a single vhost causes a restriction: the version of every Trac instance has to be unique. Using mod_python may throw away this restriction, I'll update this document as soon as I test it.
    42 
     43{{{
    4344emerge trac
    44 
     45}}}
    4546Obviously, I had to edit /etc/portage/package.keywords to make stuff available to Portage, because I'm running a stable (x86) version of Gentoo.
    4647
     48{{{
    4749app-text/silvercity             ~x86
    4850dev-libs/clearsilver            ~x86
    4951www-apps/trac                   ~x86
    50 
    51 2. Installing each instance of Trac
     52}}}
     53
     54=== 2. Installing each instance of Trac ===
    5255
    5356Say I have now a bunch of projects, known as project1, project2, ... I use the webapp-config tool to install each instance of Trac 0.7.1:
    54 
     57{{{
    5558webapp-config -I -h dev.domain.tld -d project1/trac trac 0.7.1
    5659webapp-config -I -h dev.domain.tld -d project2/trac trac 0.7.1
    5760...
     61}}}
    5862
    5963Don't forget the /trac part for the directory path.
     
    6266
    6367Furthermore, a symlink (or hardlink) to trac.cgi is created each time in /var/www/dev.domain.tld/cgi-bin/, regardless of the instance. This webapp-config issue can be restricting if you want to install different versions of Trac on the same vhost, because this way you get only one trac.cgi per vhost. As a result, you need to install the same version of Trac everywhere on your vhost.
    64 3. Setting up Subversion repositories and Trac environments
     68
     69=== 3. Setting up Subversion repositories and Trac environments ===
    6570
    6671Now, let's create Subversion repositories, one for each project we have.
    67 3.1. Creating Subversion repositories
     72==== 3.1. Creating Subversion repositories ====
    6873
    6974Let's say we want our repositories to live under /var/svn/. Issue the following commands to create a repository for project1:
     
    7984}}}
    8085Repeat these steps for each project you have.
    81 3.2. Creating Trac environments
     86
     87==== 3.2. Creating Trac environments ====
    8288
    8389Each project needs a Trac environment too, and we want them to live under /var/lib/trac/. If it doesn't already exist, we create the directory:
     
    94100}}}
    95101Repeat the above steps for each project you have.
    96 4. Configuring Apache
     102
     103=== 4. Configuring Apache ===
    97104
    98105Here is my configuration for the name-based vhost.
    99 4.1. Vhost configuration
     106==== 4.1. Vhost configuration ====
    100107
    101108The first part of the configuration is relative to the vhost itself:
     
    123130}}}
    124131Here I set the name-based vhost and the access policies. Note that +Indexes on htdocs/ isn't needed; however, in case webapp-config created symlinks, +FollowSymLinks is necessary, both on htdocs/ and cgi-bin/.
    125 4.2. Per-project configuration
     132
     133==== 4.2. Per-project configuration ====
    126134
    127135Next, there are per-project specific directives that define a project. This example has to be repeated for each project.
     
    168176}}}
    169177As you can see, I make a big use of Locations and Aliases. Now, some comments.
    170 4.2.1. Trac stuff
     178
     179===== 4.2.1. Trac stuff =====
    171180
    172181We need several directives to make Trac work. The first thing is to set the TRAC_ENV environment variable. This variable indicates to trac.cgi the location of the Trac environment corresponding to project1 in the filesystem. Actually, I'm storing every Trac environment under /var/lib/trac/, so the projectX Trac environment can be found under /var/lib/trac/projectX/.
     
    208217}}}
    209218Ok, that should be enough to use Trac. Point a browser to http://dev.domain.tld/project1 and voila.
    210 4.2.2. External components to Trac
     219
     220===== 4.2.2. External components to Trac =====
    211221
    212222Then I felt the need to add external pages to Trac, like a Doxygen component that would contain the generated documentation from the code source of project1. I wanted to find this documentation under /project1/dox.
     
    241251
    242252Instructions for limiting the write access to the repository can be found on the SVN Book. I'm using the same authentication scheme than the previous one, to be consistent between Trac users and SVN users.
    243 4.2.3. Integrating these external components inside Trac
     253
     254===== 4.2.3. Integrating these external components inside Trac =====
    244255
    245256We can use the per-project templates of Trac to integrate, for example, the Doxygen documentation inside Trac. They are located under /var/lib/trac/project1/templates/. We may want to insert a link to /project1/dox in the header, and have the following site_header.cs:
     
    262273}}}
    263274This way, we can create a /var/www/dev.domain.tld/htdocs/project1/trac/css/project1.css file (among with symlinks), and personalize the Trac layout. These per-projects file won't be deleted by webapp-config, so it's a good thing.
    264 5. Conclusion
     275
     276=== 5. Conclusion ===
    265277
    266278By copy/pasting the configuration for one project, we can set up as many projects as we want, each with their own web space, Subversion access, authentication scheme (users referential and authentication method) and layout.