Linux and Open Source Blog

  • Home
  • WordPress Plugins
  • About
  • Contact

Install and Set Up Subversion And Trac As Virtual Hosts On An Ubuntu Linux Server

Posted on January 12, 2008 by Linewbie.com Posted in guides, how to, servers, tutorials .

This howto outlines the process by which one can set up the Subversion version control system, and have it work in tandem with Trac, the project manager for software development projects, on a server running Ubuntu (or possibly Debian). It is brought to you by Openject Consulting.

Setting up Subversion

For detailed information on this, including alternate setups, have a look at Version Control with Subversion.

  1. Install the required packages.
    sudo aptitude install enscript libapache2-mod-python python-docutils trac db4.3-util libapache2-svn subversion-tools
  2. Create a virtual host directory for SVN. We’ll use /var/local/svn instead of /var/www so that Subversion instances don’t clog up the directory of web root directories.
    sudo mkdir -p /var/local/svn/svn.example.com
  3. Create a development group, and add the web user to it.
    sudo addgroup example; sudo adduser www-data example
  4. Add users to the development group. These are persons that need access to the repository.
    1. sudo adduser username1 example
    2. sudo adduser username2 example
    3. sudo adduser username3 example
  5. Set the proper permissions.
    sudo chmod 2770 /var/local/svn/svn.example.com
  6. Set up the repository.
    sudo svnadmin create /var/local/svn/svn.example.com
  7. Clear the current password file. By default it’s for the svnserve protocol, but we’ll be using HTTPS (or just HTTP). We’ll be adding users to this file later in the process.
    sudo rm /var/local/svn/svn.example.com/conf/passwd
    sudo touch /var/local/svn/svn.example.com/conf/passwd
  8. Allow the group to write to the repository.
    sudo chmod -R g+w /var/local/svn/svn.example.com
  9. Set proper file ownership.
    sudo chown -R www-data:example /var/local/svn/svn.example.com
  10. Set the repository access permissions. Information on how to do this can be found in the Path-Based Authorization section of Version Control with Subversion.
    sudo vi /var/local/svn/svn.example.com/conf/authz
  11. Create a directory for the log files.
    sudo mkdir /var/log/apache2/svn.example.com
  12. Add the site to the log rotation list.
    sudo vi /etc/logrotate.d/apache2
  13. Configure the virtual host…
    sudo vi /etc/apache2/sites-available/svn.example.com
    …with the following data. If you don’t care about SSL, you can ignore the SSL options and run this on port 80.
    <VirtualHost [server's IP address]:443>
      ServerName svn.example.com
      <Location />
        DAV svn
        AuthType Basic
        AuthName "svn.example.com"
        AuthUserFile /var/local/svn/svn.example.com/conf/passwd
        AuthzSVNAccessFile /var/local/svn/svn.example.com/conf/authz
        SVNPath /var/local/svn/svn.example.com
        Require valid-user
      </Location>
      CustomLog /var/log/apache2/svn.example.com/access.log combined
      ErrorLog /var/log/apache2/svn.example.com/error.log
      SSLEngine on
      SSLCertificateFile /etc/apache2/ssl/apache.pem
    # Add this once there is a real (non self-signed) certificate.
    #  SSLCertificateKeyFile /etc/apache2/ssl/server.key
    </VirtualHost>
    <VirtualHost [server's IP address]:80>
      ServerName svn.example.com
      Redirect / https://svn.example.com/
    </VirtualHost>
    Reference:
    /etc/apache2/mods-enabled/dav_svn.conf
  14. Enable the subversion virtual host.
    sudo a2ensite svn.example.com
  15. Create user/password combinations.
    htpasswd /var/local/svn/svn.example.com/conf/passwd username
  16. Restart the web server.
    sudo /etc/init.d/apache2 restart
  17. If you’re going to have users working locally, set up svnwrap. (See the man page for details.)
    sudo ln -s /usr/bin/svnwrap /usr/local/bin/svn

Setting up Trac

  1. Create the web directory. We’ll use /var/local/trac instead of /var/www so as not to clog up the directory of webroots.
    sudo mkdir /var/local/trac/trac.example.com
  2. Set the proper permissions.
    sudo chmod 2770 /var/local/trac/trac.example.com
  3. Create a Trac instance.
    sudo trac-admin /var/local/trac/trac.example.com initenv
  4. Set proper ownership on the web directory.
    sudo chown -R www-data:example /var/local/trac/trac.example.com
  5. Allow the group to write to the repository.
    sudo chmod -R g+w /var/local/trac/trac.example.com
  6. Configure it.
    sudo vi /var/local/trac/trac.example.com/conf/trac.ini
  7. Create a directory for the log files.
    sudo mkdir /var/log/apache2/trac.example.com
  8. Add the site to the log rotation list.
    sudo vi /etc/logrotate.d/apache2
  9. Configure the virtual host…
    sudo vi /etc/apache2/sites-available/trac.example.com
    …with the following data. If you don’t care about SSL, you can skip the SSL options and run this on port 80.
    # Trac Configuration
    <VirtualHost [server's IP address]:80>
      ServerName trac.example.com
      Redirect / https://trac.example.com/
    </VirtualHost>
    <VirtualHost [server's IP address]:443>
      ServerName trac.example.com
      DocumentRoot /var/local/trac/trac.example.com/
      Alias /trac/ /usr/share/trac/htdocs
      <Directory "/usr/share/trac/htdocs/">
          Options Indexes MultiViews
          AllowOverride None
          Order allow,deny
          Allow from all
      </Directory>
      <Location />
          SetHandler mod_python
          PythonHandler trac.web.modpython_frontend
          PythonInterpreter main_interpreter
          PythonOption TracEnv /var/local/trac/trac.example.com/
          PythonOption TracUriRoot /
          AuthType Basic
          AuthName "trac.example.com"
          # Use the SVN password file.
          AuthUserFile /var/local/svn/svn.example.com/conf/passwd
          Require valid-user
      </Location>
      CustomLog /var/log/apache2/trac.example.com/access.log combined
      ErrorLog /var/log/apache2/trac.example.com/error.log
      SSLEngine on
      SSLCertificateFile /etc/apache2/ssl/apache.pem
    # Add this once there is a real (non self-signed) certificate.
    #  SSLCertificateKeyFile /etc/apache2/ssl/server.key
    </VirtualHost>
    Reference:
    http://trac.edgewall.org/wiki/TracOnUbuntu
  10. Enable the Trac virtual host.
    sudo a2ensite trac.example.com
  11. Restart the web server.
    sudo /etc/init.d/apache2 restart

The last thing to do is add the subdomains “svn” and “trac” to the DNS configuration for your domain. Once this is done, Subversion and Trac will be integrated into your server environment, and will be accessible from the web.

2 Comments
Tags: Linux Server, Subversion, SVN, Trac, ubuntu .
« Nice and Useful OpenOffice.org extensions
Keep Internet junk content away with content filters »

2 Responses

  1. ganar dinero en casa por internet says
    January 4, 2013 at 6:37 pm

    Hmm is anyone else experiencing problems with the pictures on this blog loading?
    I’m trying to figure out if its a problem on my end or if it’s the blog.
    Any suggestions would be greatly appreciated.

    Reply
  2. Selva says
    October 8, 2015 at 1:15 am

    Thank you very much, but why wasn’t the fix to the Expose9 floating stauts bar included on it? If you activate Expose9 while the stauts bar is hidden on Chrome (e.g. page has already loaded and there is nothing to display), a phantom, transparent stauts bar is added to the Expose9 row – something that does not occur if the Status Bar is actually showing something.A bug has already been filled and properly closed for the nightlies…

    Reply

Leave a comment

Leave a comment Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Does an un-confirmed Bitcoin transaction expire?
  • Looting of the Fox: The Story of Sabotage at ShapeShift
  • Decentralization, Scalability, and Fault Tolerance of Bitcoin
  • Stripe will soon accept Bitcoin payments
  • Zynga announces Bitcoin acceptance in game
  • How to import very large sql dump via phpmyadmin
  • How to compare the content of two folders automatically
  • Top 5 reasons to start experimenting with Linux
  • The day our mind became open sourced
  • Mark Shuttleworth wants to turn canonical (ubuntu) into the next Apple Inc.

Categories

  • applications/software (26)
    • browsers (2)
    • development (1)
    • information management (1)
    • Mobility (1)
    • multimedia (5)
    • office suites (2)
    • security (6)
    • servers (6)
    • system (2)
  • audio/video/pics (3)
  • Bitcoin (3)
  • books & literature (1)
  • cms/portals (1)
  • desktop environments (7)
    • gnome (2)
    • kde (5)
  • events/shows (3)
    • interviews (1)
    • people (1)
    • surveys (1)
  • games & gaming (2)
  • general topics (4)
  • guides (112)
    • how to (105)
    • tips (87)
    • tutorials (86)
  • hardware (8)
    • desktop & laptop pc (5)
    • gadgets & mobiles (2)
  • howtoforge (47)
  • internet/web (4)
    • design & development (2)
  • linux and open source blog (49)
  • linux.com (76)
  • linux/unix/os distros (113)
    • debian/ubuntu based (10)
    • mac/osx (2)
    • other distros (3)
  • news (217)
  • open source (8)
    • business & foss (2)
  • other (26)
    • uncategorized (26)
  • Programming (3)
    • PHP (2)
  • quotes & thoughts (10)
  • random stuff (4)
    • cool stuff (3)
    • funny stuff (1)
  • review/preview/tests (7)
  • wordpress/blogging (3)

Archives

  • July 2016
  • April 2016
  • January 2015
  • April 2014
  • January 2014
  • November 2013
  • February 2013
  • November 2012
  • April 2012
  • March 2012
  • January 2012
  • December 2011
  • August 2011
  • March 2008
  • February 2008
  • January 2008
  • December 2007
  • November 2007
  • October 2007
  • September 2007
  • August 2007
  • July 2007
  • June 2007
  • May 2007
  • April 2006

Recent Posts

  • Does an un-confirmed Bitcoin transaction expire?
  • Looting of the Fox: The Story of Sabotage at ShapeShift
  • Decentralization, Scalability, and Fault Tolerance of Bitcoin
  • Stripe will soon accept Bitcoin payments
  • Zynga announces Bitcoin acceptance in game
  • How to import very large sql dump via phpmyadmin
  • How to compare the content of two folders automatically
  • Top 5 reasons to start experimenting with Linux
  • The day our mind became open sourced
  • Mark Shuttleworth wants to turn canonical (ubuntu) into the next Apple Inc.

Categories

  • applications/software (26)
    • browsers (2)
    • development (1)
    • information management (1)
    • Mobility (1)
    • multimedia (5)
    • office suites (2)
    • security (6)
    • servers (6)
    • system (2)
  • audio/video/pics (3)
  • Bitcoin (3)
  • books & literature (1)
  • cms/portals (1)
  • desktop environments (7)
    • gnome (2)
    • kde (5)
  • events/shows (3)
    • interviews (1)
    • people (1)
    • surveys (1)
  • games & gaming (2)
  • general topics (4)
  • guides (112)
    • how to (105)
    • tips (87)
    • tutorials (86)
  • hardware (8)
    • desktop & laptop pc (5)
    • gadgets & mobiles (2)
  • howtoforge (47)
  • internet/web (4)
    • design & development (2)
  • linux and open source blog (49)
  • linux.com (76)
  • linux/unix/os distros (113)
    • debian/ubuntu based (10)
    • mac/osx (2)
    • other distros (3)
  • news (217)
  • open source (8)
    • business & foss (2)
  • other (26)
    • uncategorized (26)
  • Programming (3)
    • PHP (2)
  • quotes & thoughts (10)
  • random stuff (4)
    • cool stuff (3)
    • funny stuff (1)
  • review/preview/tests (7)
  • wordpress/blogging (3)

Archives

  • July 2016
  • April 2016
  • January 2015
  • April 2014
  • January 2014
  • November 2013
  • February 2013
  • November 2012
  • April 2012
  • March 2012
  • January 2012
  • December 2011
  • August 2011
  • March 2008
  • February 2008
  • January 2008
  • December 2007
  • November 2007
  • October 2007
  • September 2007
  • August 2007
  • July 2007
  • June 2007
  • May 2007
  • April 2006
Privacy Policy

Est. 2002

linewbie.com serving the linux and open source community since April 09, 2002

CyberChimps WordPress Themes

© Linux and Open Source Blog