Install Trac on Ubuntu

Source: Internet
Author: User
Trac is a lightweight project management software that uses the Web interface. Recently, I found that it is a good idea to use it to manage personal transactions, so I installed one on my own machine. For non-professionals like me, it is a little troublesome to install Trac. Some problems can be solved only with the help of a dedicated Engineer, so it is necessary to record them. My system is Ubuntu7.04. I believe the following installation process is similar to Debain. Step 1: Install the Trac software and initialize the Trac system. Installing Trac on Ubuntu is a lightweight project management software that uses the Web interface, recently I found that it is good to use it to manage personal transactions, so I installed one on my own machine. For non-professionals like me, it is a little troublesome to install Trac. Some problems can be solved only with the help of a dedicated Engineer, so it is necessary to record them. My system is Ubuntu 7.04. I believe the following installation process is similar to Debain.

Step 1: Install the Trac software and initialize the Trac system

Installing the Trac software on Ubuntu is simple. You only need to run it:

Sudo apt-get install trac

After installation, you can create a Trac system. I am going to install it in the/var/www/trac directory. To create a Trac system, use the initenv command in trac-admin. Note that all operations on the Trac system are completed by www-data users, because Trac is a Web application and accessed through Apache. The detailed process is as follows:

Cd/var/www
Sudo mkdir trac
Sudo chown-R www-data: www-data trac
Sudo-u www-data trac-admin trac initenv
Project Name [My Project]> enter your Project Name here
Database connection string [sqlite: db/trac. db]>
Repository type [svn]>
Path to repository [/path/to/repos]> enter the Subversion address of your project.
Templates directory [/usr/share/trac/templates]>

Note: by default, Trac can only access the Subversion repository of the local machine, and the "file: //" prefix cannot be added when you fill in the address above.

Step 2: Configure Apache
After the Trac system is initialized, you must configure it in Apache to use it. Because Trac uses CGI, you must first set the CGI program (/usr/share/Trac/cgi-bin/trac. to the cgi-bin directory of Apache (just make a symbolic link ). The process is as follows:

Cd/usr/lib
Sudo mkdir cgi-bin
Sudo chown-R www-data: www-data cgi-bin
Cd cgi-bin
Sudo-u www-data ln-s/usr/share/trac/cgi-bin/trac. cgi trac. cgi

Then add the Trac site configuration information to the Apache configuration. In Ubuntu, the site configuration is usually stored in the/etc/apache2/sites-available/default file, you can edit the file and add the following content (this content is included in the Trac instruction documents, in/usr/share/doc/trac/README. in the Debian file ):

Alias/trac/"/usr/share/trac/htdocs /"

Options Indexes MultiViews
AllowOverride None
Order allow, deny
Allow from all


SetEnv TRAC_ENV "/var/www/trac"


AuthType Basic
AuthName "trac"
AuthUserFile/etc/apache2/trac. htpasswd
Require valid-user


The Basic authentication method based on the htpasswd file supported by Apache is configured above, and/etc/apache2/trac is used. htpasswd is the password file, so you need to create this file and create the user name and password used to access the Trac system. This is done using the htpasswd Command, as shown below:

Cd/etc/apaceh2
Sudo htpasswd-c trac. htpasswd your Username
Enter the user password here

Finally, reload Apache configuration:
Sudo/etc/init. d/apache2 reload

Then you can access your Trac through a browser. The address is http: // localhost/cgi-bin/trac. cgi.

Step 3: Install WebAdmin
After installation, you have obtained a full-featured Trac system. However, many management tasks, such as adding modules and managing permissions, must be completed using the trac-admin command line tool, not very convenient. To simplify Trac usage, you can install the WebAdmin plug-in.

First install setuptools:
Sudo apt-get install python-setuptools

Download the source code of WebAdmin from the Subversion of Trac for compilation, as shown below:

Cd/tmp
Sudo-u www-data svn co http://svn.edgewall.com/repos/trac/sandbox/webadmin/
Sudo-u www-data python setup. py bdist_egg

After compilation, A TracWebAdmin-xxx.egg file is generated under the dist directory, which is copied to the plugins directory of the trac system .. The egg file is a packaging method for Python software, similar to the one used in Java to develop EJB. when the software package is loaded, Apache will decompress the package to/var/www /. python-eggs directory, so if you have not created/var/www /. create a python-eggs directory first. Finally, the Apache configuration is reloaded, And the WebAdmin installation is complete.

After WebAdmin is installed, the "admin" item appears in the top navigation bar after logging on to Trac for users with certain Admin permissions. Click here to complete some management operations. However, because the default user does not have the admin permission, you must first use the trac-admin Tool to set permissions for the user before using the WebAdmin management function.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.