The following describes how to build TRAC in Ubuntu.
1. download the latest tracversion from http://trac.edgewall.org/wiki/tracdownload( 0.12 currently)
2. Install the SDK in one step based on http://trac.edgewall.org/wiki/tracinstall.
2. 1. install necessary Libraries
2.1.1 check whether Python has been installed
2.1.2 install setuptools (the easy_install command will be used in subsequent installation)
In ubuntu, you can easily use The sudo apt-Get install Python-setuptools command to install
2.1.3 install genshi
Sudo easy_install genshi (unbutu can be easily used, but Python egg installation needs to be downloaded in the window)
2.1.4 install SVN
This includes the svn service and the svn Implementation of Python. Note that the major versions of both parties must be consistent. For example, if the major version of the svn service is 1.6, the corresponding implementation of Python should also be 1.6, otherwise, problems may occur during the integration of TRAC. Remember!
Apt-Get install Subversion
Apt-Get install Python-Subversion
2.1.4 install Apache
You can install apache2 through sudo apt-Get install or download the latest version from the Apache website.
2.1.5 install mod_wsgi (you can also install mod_python as needed, but we recommend that you use mod_wsgi because mod_wsgi is faster and mod_python has stopped development. Note that no matter what mod is installed, pay special attention to whether the Python version of this mod is consistent with the Python version to be run !!)
Go to http://code.google.com/p/modwsgi/download mod_wsgito install
You can also install it through the sudo apt-Get install libapache2-mod-wsgi command
2. Install the optional Libraries
2.2.1 install Babel
To support localization and select different languages, install Babel
You can download it through the sudo SVN Co http://svn.edgewall.org/repos/babel//home/download/Babel command, but make sure that SVN is installed
Because Babel depends on cldr, You need to import cldr before installation. Select the appropriate cldr version to download according to the downloaded Babel installation instructions. Then run sudo python. /scripts/import_cldr.py/home/download/common command import cldr (Note:/home/download/common is the decompressed cldr path, which must be consistent with the actual path !). Installing cldr is very important. If you choose to install Babel without installing cldr, an error will occur when you install TRAC again, leading to installation failure. If you do not consider localization, skip this step. If you do not install Babel, you do not need to install cldr.
After the download is complete, go to the trunks directory in the download directory and execute the sudo Python setup. py install command to install Babel.
2.2.2 install the docutils module, which is used in TRA/home/download/common/home/download/commonc wiki.
Download it at http://docutils.sourceforge.net/
Decompress the package and run the sudo Python setup. py install command to install
2.2.3 install pygments and syntax highlighting tools
Download the package at http://bitbucket.org/birkenfeld/pygments-main/downloads
Decompress the package and run sudo Python setup. py install.
2.2.4 install pytz, mainly for Time Zone Processing
Download pytz from http://pypi.python.org/pypi/pytz/#downloads( be sure to select a version for Python)
Run the sudo easy_install pytz-2010l-py2.6.egg command to install pytz
2.3 install TRAC
You can use the easy_install command of setuptools to install it. The specific command is easy_install TRAC = 0.12. You can also download it before installing it. The specific command is sudo Python seup. py install.
2.4 create a TRAC project Runtime Environment
Run the sudo trac-admin/home/Diebold-trac initenv command to create a TRAC project. You need to answer some questions during the creation process. For the name of the project to be created, the database link characters used. The entered content will be included in the TRAC. ini configuration file of the project. You do not have to worry about errors during the creation process. You can change all the content in TRAC. ini.
After creation, you can run the tracd -- Port 8000/home/Diebold-trac command to start the TRAC independent web service.
Open your browser and enter http: // 127.0.0.1: 8000 to browse TRAC. If you enter the project, the page prompts that you do not have the read and write permissions on the directory, You need to manually change the read and write permissions of the directory. The specific command is sudo chmod-r 777 Diebold-trac.
2.5 configure TRAC
2.5.1 generate the wsgi configuration file
You can easily use the TARC-Admin Diebold-trac deploy Diebold-trac command to generate wsgi configuration files. After the command is successfully executed, the cgi-bin/TRAC. wsgi file is generated. The/file is the wsgi configuration file, which will be used when Apache is configured later.
2.5.2 configure Apache
Open the Apache configuration file httpd. conf (if you do not know the specific installation location of Apache, you can run the whereis apache2 command to find it. Generally, the configuration file is in/etc/apache2)
Add the following configuration in httpd. conf:
Wsgiscriptalias/TRAC/home/Diebold-trac/cgi-bin/TRAC. wsgi
<Directory/home/Diebold-trac>
Wsgiapplicationgroup % {Global}
Order deny, allow
Allow from all
</Directory>
Restart Apache after the configuration is complete. The restart command is sudo/etc/init. d/apache2 restart.
Note: Common Apache commands are sudo/etc/init. d/apache2 start or restart or stop.
After Apache is restarted, you can browse TRAC through http: // localhost/TRAC.
2.5.3 configure basic permission Control
Create an htpasswd file. It is recommended that the first user use the command line to create the file. Other users can use the TRAC plug-in.
Htpasswd-C htpasswd Admin
After creating a user as prompted, grant the admin permission to the user for subsequent operations. The specific command is trac-admin/home/Diebold-trac permission Add Admin trac_admin.
2.5.4 install the TRAC plug-in
Install Account Manager Plugin with the command easy_install https://trac-hacks.org/svn/accountmanagerplugin/trunk
When configuring account manager, you can select different modules as needed. However, if you use loginmodule, disable web_ui. add acct_mgr.web_ui.loginmodule = enabled to the components configuration in ini, and set password store
[Account-manager]
; Configure the plugin to store passwords in the htpasswd format:
Password_store = htpasswdstore
; With TRAC <0.10 use this instead:
Password_format = htpasswd
; The file where user accounts are stored
; The webserver will need write permissions to this file
; And its parent folder
Password_file =/var/TRAC. htpasswd
In addition, you need to comment out the require valid-user configuration in Apache configuration. Otherwise, an error will occur during running. Remember to remember!
After the preceding steps are completed, restart Apache and you will find that the pages used for Logon are different from those used by Apache by default!
Install svnauthz file administration plugin (manage SVN users and permissions), download from http://trac-hacks.org/wiki/svnauthzadminpluginand install
After the installation is complete, set the svn-related options of TRAC. ini, specifically
Authz_file =/home/Repository/D-cash/CONF/authz
Authz_module_name = D-cash (note that the repository name created in svnadmin create is entered here. Remember, otherwise, invalidpath is reported when svnauthadmin is used to manage permissions, the execution fails !)
After successful configuration, you can use subversion access on the TRAC admin page to manage SVN users and permissions.
2.5.5 configure the version Library (repository)
Create a repository first. The specific command is sudo svnadmin create d-cash.
After adding repository to Trac, run the synchronization command sudo trac-admin/home/Diebold-trac repository Resync D-cash.
It is best to configure post-commit in the svn hook so that the svn update can be seen in the source broswer of TRAC. The specific method is as follows: add the following command to post-commit: sudo/usr/local/bin/trac-admin/home/Diebold-trac Changeset added $ repos $ Rev
Run the svnserve command svnserve-d-r/home/Repository/