Setting up SVN with Trac on a web server

June 21st, 2007 by Leons Petrazickis

Trac is an excellent web-based wrapper for SVN that adds bug tracking, a wiki, and several handy project management features. I keep setting up new repositories up for all the little projects we cook up in DB2 Technical Marketing, so I thought I’d write up a guide.

Installing Trac, SVN, and dav_svn for Apache2 is left as an exercise for the reader.

Create a new SVN repository:

svnadmin create /var/svn/Project
 

Create a new Trac environment:

trac-admin /var/trac/Project initenv
 

Change the owner to Apache so that it can read and write:

cd /var/svn
chown -R www-data Project
cd ../trac
chown -R www-data Project
 

Navigate to Apache site settings:

cd /etc/apache2/sites-enabled
 

If you want Trac to support multiple repositories, edit the trac file to look like this:

<VirtualHost *>
        ServerAdmin me@somewhere.com
        ServerName mysite.com
        DocumentRoot /usr/share/trac/cgi-bin/
        <Directory /usr/share/trac/cgi-bin/>
                Options Indexes FollowSymLinks MultiViews ExecCGI
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>
        Alias /var/trac/chrome/common /usr/share/trac/htdocs
        <Directory "/usr/share/trac/htdocs">
                Order allow,deny
                Allow from all
        </Directory>
        Alias /trac "/usr/share/trac/htdocs"

        <Location /trac.cgi>
                SetEnv TRAC_ENV_PARENT_DIR "/var/trac"
        </Location>
        <LocationMatch "/trac.cgi/[^/]+/login">
                AuthType Basic
                AuthName "Trac"
                AuthUserFile /etc/apache2/trac.passwd
                Require valid-user
        </LocationMatch>

        DirectoryIndex trac.cgi
        ErrorLog /var/log/apache2/error.trac.log
        CustomLog /var/log/apache2/access.trac.log combined
</VirtualHost>
 

The above assumes that all the repositories are in /var/trac

Navigate to Apache settings:

cd /etc/apache2/mods-enabled/
 

Append to dav_svn.conf:

<Location /svn/Project>
   DAV svn
   SVNPath /var/svn/Project

   AuthType Basic
   AuthName "Subversion Repository"
   AuthUserFile /etc/apache2/dav_svn.passwd

  AuthzSVNAccessFile /etc/apache2/dav_svn.authz

  <LimitExcept GET PROPFIND OPTIONS REPORT>
    Require valid-user
  </LimitExcept>

</Location>
 

The above lets you check out from http://yoursite/svn/Project

If you like, you can add a new user to dav_svn.psswd:

cd ..
htpasswd2 /etc/apache2/dav_svn.passwd NewUser
 

Users can then be granted permissions by editing the dav_svn.authz file. Sample file:

[groups]
developers = NewUser, OtherUser
others = ThirdUser

# Restrictions on the entire repository.
[/]
# Anyone can read.
* = r
# Developers can change anything.
@developers = rw

# Other can write here
[/trunk/public/images]
@others = rw

[/trunk/public/stylesheets]
@others = rw
 

Restart Apache:

killall apache2
apache2

You now have have an Trac/SVN install with SVN at http://yoursite/svn/Project and Trac at http://yoursite/trac.cgi

Posted in unix | No Comments »

Using Safari Web Inspector on Windows

June 21st, 2007 by Leons Petrazickis

The latest nightlies of Webkit (development branch of Apple Safari) now have the web inspector in them. It doesn’t replace the tools in the other browsers, but it does have one very effective piece of unique functionality — a page load graph that gives an exact breakdown of order-of-loading and time-to-load of each script, stylesheet, and image.

First of all, enable the debug menu. It gives you access to the Javascript console and such things.

  1. Open C:\Documents and Settings\chng1me.T40-92U-V46\Application Data\Apple Computer\Safari
  2. Open Preferences.plist
  3. Insert the lines below mid-file:
        <key>IncludeDebugMenu</key>
        <true/>
 

Safari on lpetr.org
Open Safari by executing run-nightly-webkit.cmd in your Webkit install. Right-click and the inspect an element from the context menu.
Safari Web Inspector
Now, click on the icon in the bottom left-hand corner and choose Network.
Safari Web Inspector - Network mode
Voila!

Posted in javascript, css | 2 Comments »

Safari for Windows; Rails links

June 12th, 2007 by Leons Petrazickis

Apple has released Safari 3 Beta for Windows. Besides being slick and a pleasure to look at, it finally lets Windows-based web developers test their sites for the 5% that use Macs.

The other browsers that good web developers like us should test for are Opera, IE 6, IE 7, and Firefox.

Rails

dW | Turbocharge Ruby on Rails with Active Scaffold (June 2007)
dW | DB2 and Ruby on Rails, Part 3 (June 2007) [added]
dW | DB2 and Ruby on Rails, Part 2 (June 2007)
dW | DB2 and Ruby on Rails, Part 1 (May 2007)

I am using ActiveScaffold in my next mini-project.:)

Posted in links | No Comments »