How to Build the Apache + SVN + TRAC platform?

Source: Internet
Author: User

I. TRAC Concept
TRAC is a Web-based event tracking system written in Python. It uses Wiki as the document format and subversion as the version control system. Can help developers with source code
This document provides management, bug tracking, and discussion. Debian
If your system is Debian, use the apt-Get install TRAC command to install it. The system will automatically install all the software packages that TRAC depends on. After the installation is complete, you can configure it.
TRAC can be set as a standalone server for use only on the local machine. It can also be integrated with Web servers such as Apache. If it is integrated with Apache, it can be configured as CGI, FastCGI, or
Mod_python.
Humanistic use:
RedHat 9
Apache 2 (mod_python)
MySQL 5 (mysql_python)
Subscription 1.4
TRAC 0.10.4

Ii. How to install the TRAC Official Website

Http://trac.edgewall.org/wiki/TracInstall
The packages it depends on:
* Python, version> = 2.3 // please keep in mind, that for rpm-based systems you will also need Python-devel and Python-
XML packages.
* Clearsilver, version> = 0.9.3 // With Python-bindings (./configure -- With-Python =/usr/bin/Python)
* A Web Server capable of executing cgi/FastCGI scripts, or Apache httpd with mod_python.
* Subversion, version >=1.0. (>= 1.1.x recommended)
* Subversion swig Python bindings (not pysvn ).
* Required database support (SQLite, PostgreSQL, and MySQL (1.10.4 and above are fully supported by TRAC ).
Before installation, check whether these packages meet the requirements of TRAC.
My version of rh9 is too low, and the result depends on more packages.

3. installation methods for each package:
1. Python:
# Tar xjvf Python-2.5.tar.gx
# Cd Python-2.5
#./Configure -- With-apxs =/usr/local/Apache/sbin/apxs
# Make; make install
2. clearsilver:
If this error is reported, tracerror: clearsilver not installed (no module named neo_cgi) is not installed in clearsilver)
# Tar xfz clearsilver-0.10.5.tar.gz
# Cd clearsilver-0.10.5
#./Configure -- disable-Apache -- disable-CSHARP -- disable-ruby -- prefix =/usr -- With-Python =/usr/local/bin/Python
# Sed-I "[email protected]/usr/local/bin/[email protected]/usr/bin/env
[[Email protected] [email protected] [/Email]
"Scripts/document. py
# Make | return 1
# Make install
# Cd Python
# Python_site = '/usr/local/bin/Python-C \
"Import sys; print [path for Path in SYS. path if path. Find ('site-packages ')! =-1] [0] "'
# Python setup. py install

3. mysql_python:
# Tar xfz MySQL-python-1.2.1.tar.gz
# Cd MySQL-python-1.2.1
# Python setup. py build
# Python setup. py install
Install mysql_client before installing mysql_python.
Mysql_config cannot be found
VI site. cfg
# Mysql_config =/usr/local/bin/mysql_config
Remove the comment and change it to the path where mysql_config is located.
4. mod_python:
# Tar zxvf mod_python-3.3.1.tar.gz
# Cd mod_python-3.3.1
#./Configure -- With-apxs =/usr/local/Apache/sbin/apxs
# Make
# Make install
Add modules to the Apache configuration file
VI/usr/local/apache2/CONF/httpd. conf
Loadmodule python_module modules/mod_python.so

4. Create a database:
# Cd/usr/local/MySQL
# Mysqladmin create dbname
# Mysql-uroot-P
> Passwd
> Grant all privileges on dbname. *
[[Email protected] [email protected] [/Email]
Identified by 'dbpass ';
> Use dbname;
> Alter database default Character Set utf8 collate utf8_general_ci;
> Quit
Take the local machine as an example:
# Mysqladmin create TRAC
# Mysql-uroot-P
> Root (MySQL-root password)
> Grant all privileges on TRAC. *
[[Email protected] [email protected] [/Email]
Identified by 'trac ';
> Use TRAC;
> Alter database default Character Set utf8 collate utf8_general_ci;
> Quit
Note: Remember the Database Name (TRAC), user name (TRAC), password (TRAC), and host name (localhost) created here)
This is because it is used to create a TRAC table later.
V. Installation and initialization of TRAC
# Tar zxvf trac-0.10.4.tar.gz
# Cd trac-0.10.4
# Python./setup. py install
In this case, please check whether the above installation is correct.
TRAC initialization:
# Trac-admin/usr/local/TRAC initenv (the/usr/loca/TRAC directory will be automatically created)
Project name [my project]> Test
Database connection string [SQLite: DB/TRAC. dB]> MYSQL: // TRAC: [email protected]/TRAC // information used to create a database
Repository type [SVN]> // This field is empty. Press enter.
Path to repository [/path/to/repos]>/usr/local/apache2/svnroot/test // SVN repository address
Templates directory [/usr/local/share/TRAC/templates]> // This field is empty. Press enter. Please confirm the path beforehand.
If the above configurations are correct, no error will be reported in this step, and TRAC will be installed normally.
The rest is the configuration of Apache.

6. Configure and start the TRAC Virtual Host
# Vi/usr/local/apache2/CONF/httpd. conf
Add before:

Sethandler mod_python
Pythonhandler TRAC. Web. modpython_frontend
Pythonoption tracenv/usr/local/TRAC // TRAC installation directory
Setenv python_egg_cache/tmp
Pythonoption tracuriroot/TRAC
Authtype basic
Authname "test's TRAC"
Authuserfile/usr/local/apache2/svnroot/test/passwd // SVN User Password directory
Require valid-user

Restart Apache # service httpd restart

Http: // ip/TRAC
You can see the TRAC interface ..

VII. Summary
In fact, it is not difficult to install TRAC. It took me one day to configure Nagios yesterday and added n multiple plug-ins. Today, the TRAC with a one-day configuration has encountered n many errors, and I have not
The error is not listed. In fact, all errors can be found and solved in the official FAQ. Nothing is too difficult, so be careful. I believe you can also configure it successfully.
It will be a waste of time to study other TRAC functions tomorrow. Install Bugzilla and compare the bug tracking of TRAC.

Some modifications and errors of TRAC:
Trac-Email
Modify TRAC. ini
[Notification]
Always_policy_owner = true
Always_policy_reporter = Yes
Always_policy_updater = true
Mime_encoding = quoted-printable
Smtp_always_bcc =
Smtp_always_cc = @ example.com
Smtp_default_domain =
Smtp_enabled = true
Smtp_from = @ example.com
Smtp_password =
Smtp_port = 25
Smtp_replyto =
Smtp_server =
Smtp_user =
Use_public_cc = false
Use_short_addr = false
Use_tls = false

An error is reported when an attachment is added.
Python traceback
Traceback (most recent call last ):
File "/usr/local/lib/python2.5/Site-packages/TRAC/web/Main. py", line 406, in dispatch_request
Dispatcher. Dispatch (req)
File "/usr/local/lib/python2.5/Site-packages/TRAC/web/Main. py", line 237, in dispatch
Resp = chosen_handler.process_request (req)
File "/usr/local/lib/python2.5/Site-packages/TRAC/attachment. py", line 361, in process_request
Self. _ do_save (req, attachment)
File "/usr/local/lib/python2.5/Site-packages/TRAC/attachment. py", line 496, in _ do_save
Attachment. insert (filename, upload. File, size)
File "/usr/local/lib/python2.5/Site-packages/TRAC/attachment. py", line 180, in insert
OS. makedirs (self. Path)
File "/usr/local/lib/python2.5/OS. py", line 165, in makedirs
Makedirs (Head, Mode)
File "/usr/local/lib/python2.5/OS. py", line 172, in makedirs
Mkdir (name, Mode)
Oserror: [errno 13] Permission denied: '/usr/local/TRAC/Attachments/ticket'

Solution: The attachments directory permission is incorrect.
Chmod-r 755/usr/local/TRAC/attachments
Chown-r XXX. xxxx/usr/local/TRAC/attachments
Modify the drop-down box --- when the drop-down box is new ticket, CC can directly drop down the user name without manual input
Modify TRAC. ini
[Ticket]
Restrict_owner = false to true.


Supplement: if the error is: tracerror: Unsupported version control system "SVN". Check that the python Bindings for "SVN" are correctly installed.
That is, setenv python_egg_cache/tmp is added to httpd. conf.

 

More exciting Linux video tutorial, all in 51cto School: http://edu.51cto.com/course/courseList/id-48.html

 

How to Build the Apache + SVN + TRAC platform?

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.