Edgewall Software

Changes between Version 4 and Version 5 of TracApacheRecipe


Ignore:
Timestamp:
Feb 22, 2015, 12:22:56 PM (9 years ago)
Author:
figaro
Comment:

Cosmetic changes

Legend:

Unmodified
Added
Removed
Modified
  • TracApacheRecipe

    v4 v5  
    1 == Recipe - Configuring Apache 2 on CentOS-4.2 to serve trac ==
     1= Recipe: Configuring Apache2 on CentOS-4.2 to serve Trac
    22 
    3 HOWTO:
    4 Set up Apache 2 to access a trac environment on CentOS-4.2
     3Getting Trac to work with Apache is not difficult, but there are a number of caveats. We will start with the [http://httpd.apache.org/docs/2.2/dso.html DSO modules for Apache]. `mod_python` is provided for by the default Apache2 configuration on CentOS-4.2. The configuration file is found at `/etc/httpd/conf.d/python.conf` and, as the settings in the default seem to serve, you can forget about modifying your `conf/httpd.conf` file for now.
    54
    6 Although there are many discussions of seting up trac with Apache of course none of them covered my exact situation.  So I am providing YAATX (Yet Another Apache-Trac eXample) for your viewing enjoyment.
     5Next, there is the issue of permissions on both the Trac environment and the Subversion repository. I came to the conclusion that it would be best to create separate users and groups forTtrac and Subversion called `trac:trac` and `svn:svn` respectively. I then set the ownerships on the Trac environment and subversion repositories to `trac:trac` and `svn:svn`. I next added the Apache user as a member to both the Trac and svn groups. This allows Apache to read the files in both these directory structures.
    76
    8 Getting trac to work with Apache is not terribly difficult, but there are a number of fiddley bits to deal with. We will start with the DSO modules for Apache.  Happily, mod_python is provided for by the default Apache 2 configuration on CentOS-4.2.  The configuration file is found at /etc/httpd/conf.d/python.conf and, as the settings in the default seem to serve, you can forget about modifying your conf/httpd.conf file for now.
    9 
    10 Next, there is the issue of permissions on both the trac environment and the subversion repository.  Afer several takes on this I came to the conclusion that it would be best to create separate users and groups for trac and subversion called, originally enough, trac:trac and svn:svn.  I then set the ownerships on the trac environment and subversion repositories to trac:trac and svn:svn respectively.  I next added the apache user as a member to both the trac and svn groups.  This allows apache to read the files in both these directory structures.
    11 
    12 The final bit is to create a file called something like '/etc/httpd/conf.d/trac.conf' and place your httpd directives for trac and python in it.  In my case I set up a virtual server called trac.mydomain.tld and put the following lines in a file called '/etc/httpd/conf.d/trac.mydomain.tld.conf'. Note that the trac environment is located at '/var/data/trac' and that instead of htpasswd I use htdigest and lock down the entire tac environment from anonymous access.
    13 
     7The final bit is to create a file called something like '/etc/httpd/conf.d/trac.conf' and place the httpd directives for Trac and Python in it. In my case I set up a virtual server called `trac.mydomain.tld` and put the following lines in a file called '/etc/httpd/conf.d/trac.mydomain.tld.conf':
    148
    159{{{
     
    4236}}}
    4337
    44 I had to create the egg.cache inside the trac enviroment to avoid permission problems in the /var/www/htdocs directory.   The '!TracUriRoot /' is required so that trac can find its support files like stylesheets and plugins, '/' in this case equates to '/var/data/trac'.
     38Note that the Trac environment is located at '/var/data/trac' and that instead of htpasswd I use htdigest and lock down the entire Trac environment from anonymous access.
    4539
    46 The !AuthName directive refers to the realm used when creating the htdigest file for user authentication. the !AuthDigestDomain sets the uri covered by controlled access, '/' means the entire site is closed to public view. The user password file is created in '/var/data/trac/conf/trac.htdigest' with the htdigest(1) program.
     40I had to create the egg.cache inside the Trac environment to avoid permission problems in the /var/www/htdocs directory. The '!TracUriRoot /' is required so that Trac can find its support files like stylesheets and plugins, '/' in this case equates to '/var/data/trac'.
    4741
    48 This set up does not yet employ cgi or fastcgi so it will be slow.  When I get to the point of using mod_fcgid then "I'll be back" with the details.
     42The !AuthName directive refers to the realm used when creating the htdigest file for user authentication. The !AuthDigestDomain sets the uri covered by controlled access, '/' means the entire site is closed to public viewing. The user password file is created in '/var/data/trac/conf/trac.htdigest' with the htdigest program.
    4943
     44This setup does not yet employ cgi or fastcgi, so it will be slow.