VisualSVN Server / Trac tips

Here are few tips I return to when installing or creating a new Trac environment:

VisualSVN Server Trac installation

VisualSVN Server failed to start once I've installed the Trac integration. Apache's log had an entry saying it cannot find mod_python.so file, although it was on the right place. After a bit of googling, I've managed to solve the problem by adding msvcr71.dll and msvcp71.dll to my Windows System folder. I can't give a credit to a person who found the solution, because I don't remember the page where I found it.

Creating Trac environment

Before you start, make sure there you have SVN repository prepared. Also, you should have at least one user that will get TRAC_ADMIN rights. Use VisualSVN Server Manager to create SVN repository and user(s).

If you have used defaults from Trac integration page, your SVN repositories will be in C:\Repositories\ and Trac environments in C:\Trac\.

  • Run a console and go to: C:\Program Files\VisualSVN Server\bin\python\Scripts
  • Run: trac-admin C:\Trac\<ProjectName> initenv
    • trac-admin will ask you a few questions, answer as below
    • enter project name (used for Trac page title and description)
    • database connection string (press Enter for default)
    • repository type (Enter for default)
    • path to repository: C:\Repositories\<ProjectName>
  • To make a single user an administrator run: trac-admin C:\Trac\<ProjectName> permission add <UserName> TRAC_ADMIN
  • Permissions for other users can be set in Trac itself, through the Admin interface

Additional settings

  • Change the Trac environment logo
    • Copy new image to: C:\Program Files\VisualSVN Server\bin\python\Lib\site-packages\trac\htdocs
    • Edit C:\Trac\<ProjectName>\conf\trac.ini, and find [header_logo] section
    • Change src to: src = common/image.jpg
  • Change the default attachment size
    • Edit C:\Trac\<ProjectName>\conf\trac.ini, and find [attachment] section
    • Change max_size = 262144 to max_size = 2097152
  • Use drop-down field instead of text box when defining ticket owner
    • This is very useful setting for smaller teams - to display all team members in a drop-down instead of typing the name in text box
    • Edit C:\Trac\<ProjectName>\conf\trac.ini, and find [ticket] section
    • Change restrict_owner = false to restrict_owner = true
    • Note that the user will not be displayed in the drop-down until he got a session on the server. The easiest way to get the session is to log in and change user preferences.

This post is more a note to myself. Other configuration options for Trac can be found in TracGuide.


7 comments:

  1. Jeff

    I just downloaded the latest version of Visual SVN (2.0.7) and tried to do the Trac configuration from http://www.visualsvn.com/server/trac/. Since Python 2.5 was already installed, I tried to use that but when trying to go to Trac, the event viewer says:mod_python (pid=3292, interpreter='main_interpreter', phase='PythonHandler', handler='trac.web.modpython_frontend'): Application error.

    Is your httpd-custom.conf any different than what Visual SVN recommended?

     
  2. Miroslav Popovic

    Currently I'm using VisualSVN Server 2.0.4 and my httpd-custom.conf file looks exactly the same as the one on http://www.visualsvn.com/server/trac - for Subversion authentication.

    I did have some troubles while installing - related to PYTHONHOME environment variable ... %ProgramFiles% wasn't working for me, so I used the full path: c:\Program Files (x86)\VisualSVN Server\trac\python\

    Not sure if that's your problem though. It seems that your Python interpreter is started but throws an exception. Maybe Trac is incompatible with your version of Python, so try to set PYTHONHOME to suggested value and see if Trac can run after that (restart VisualSVN Server just in case).

     
  3. Unknown

    I am also using VisualSVN Server with Trac.
    I have two major problems:
    1-I read through the tracguide to configure notifications. I configured my trac.ini file so that I can use the gmail as my smtp server
    [notification]
    smtp_enabled = true
    use_tls = true
    mime_encoding = base64
    smtp_server = smtp.gmail.com
    smtp_port = 587
    smtp_user = user
    smtp_password = password

    but still I am not able to send or receive e-mail.

    2)My second problem is that I don't know how I will make the browser source to reach my repository in my VisualSVN server. There should be an easy way to work this out I guess.

    Thanks,

     
  4. Miroslav Popovic

    1. I'm also using Gmail as notification email, and it works fine. Here's what I have in my config:

    [notification]
    admit_domains =
    always_notify_owner = true
    always_notify_reporter = true
    always_notify_updater = false
    ignore_domains =
    mime_encoding = base64
    smtp_always_bcc =
    smtp_always_cc =
    smtp_default_domain =
    smtp_enabled = true
    smtp_from =
    smtp_from_name =
    smtp_password =
    smtp_port = 587
    smtp_replyto =
    smtp_server = smtp.gmail.com
    smtp_subject_prefix = __default__
    smtp_user = @gmail.com
    ticket_subject_template = $prefix #$ticket.id: $summary
    use_public_cc = false
    use_short_addr = false
    use_tls = true

    My guess is that you've probably forget to include @gmail.com suffix when defining smtp_user. You must enter full email address when sending mail thru Gmail's SMTP server: user@gmail.com.

    2. Could you be more specific? I didn't understood this question.

     
  5. Miroslav Popovic

    Blogger eat some of the text, here's config part again:

    [notification]
    admit_domains =
    always_notify_owner = true
    always_notify_reporter = true
    always_notify_updater = false
    ignore_domains =
    mime_encoding = base64
    smtp_always_bcc =
    smtp_always_cc =
    smtp_default_domain =
    smtp_enabled = true
    smtp_from = "from email address"
    smtp_from_name = "from name"
    smtp_password = "pass"
    smtp_port = 587
    smtp_replyto = "reply to email address"
    smtp_server = smtp.gmail.com
    smtp_subject_prefix = __default__
    smtp_user = @gmail.com
    ticket_subject_template = $prefix #$ticket.id: $summary
    use_public_cc = false
    use_short_addr = false
    use_tls = true

     
  6. Unknown

    Miroslov you were right about me not writing the @gmail.com part.
    My second problem was from the misconfiguration of the path for the repository for the inenv command.

    Thaks for your help.

     
  7. Anonymous

    Jeff did you ever find a solution to your problem? I'm facing the same issues with the newer versions. Thank you!

     

Post a Comment