Technical preparation
Check to see if package your_package is installed
#rpm-qa | grep your_package
Installing the Your_package Package
#rpm-IVH Your_package
Or
#rpm-UVH Your_package
Step 1, install Python and related packages
Please verify that the packages below are installed and, if not, go to the RHEL5/CENTOS5 CD to find these packages and install
libxml2-python-2.6.26-2.1.2
mod_python-3.2.8-3.1
Python-devel-2.4.3-19.el5
Python-2.4.3-19.el5
Step 2, install SQLite and related packages [if you use MySQL as a TRAC database, this step can be ignored]
Please verify that the packages below are installed and, if not, go to the RHEL5/CENTOS5 CD to find these packages and install
Sqlite-3.3.6-2
python-sqlite-1.1.7-1.2.1
Step 3, install MySQL and related packages [if you use SQLite as the TRAC database, this step can be ignored]
Please verify that the packages below are installed and, if not, go to the RHEL5/CENTOS5 CD to find these packages and install
mod_auth_mysql-3.0.0-3.1mysql-server-5.0.22-2.1
mysql-5.0.22-2.1
mysql-devel-5.0.22-2.1
Mysql-python-1.2.1-1
Step 4, install setuptools[If you do not want to use Easyinstall, this step can be omitted, the following steps we do not use the Easyinstall]
#wget http://peak.telecommunity.com/dist/ez_setup.py
#python ez_setup.py
Make sure your network is clear, if the installation fails, try several more times, or ignore this step installation
Step 5, install Clearsliver
Go to the official website http://www.clearsilver.net/downloads/download the appropriate version of Clearsliver
I'm using clearsilver-0.10.5.tar.gz.
#tar XVFZ clearsilver-0.10.5.tar.gz
#cd clearsilver-0.10.5
#./configure--with-python=/usr/bin/python--prefix=/usr/local--disable-ruby--disable-java--disable-apache-- Disable-csharp--disable-perl
#make
#make Install
#cd python
#python./python.py Install
If you do not want to compile or install your own failure, you can download the following RPM package
python-clearsilver-0.10.4-4.fc5.rpm
clearsilver-0.10.4-4.fc5.rpm
However, the above two packages are for DEDORA5, do not guarantee that there is no problem, the annex has the two RPM package
Step 6, install TRAC and related packages
To the official website http://trac.edgewall.org/download the appropriate version,
I'm using trac-0.10.4.tar.gz.
#tar XVFZ trac-0.10.4.tar.gz
#cd trac-0.10.4
#python./setup.py Install
Installed by default in the/usr/share/trac/directory
Step 7, create the MySQL database [if you use SQLite as a TRAC database, this step can be ignored]
Login MySQL
#mysql Mysql-u Root-p
Create User Trac
Mysql>grant all privileges in *.* to trac@ '% ' identified by ' password ' with GRANT OPTION;
Create DATABASE, Note: If you want to use Chinese in trac, you must set the database encoding is utf8,mysql default encoding is Latin1
Mysql>create DATABASE IF not EXISTS trac_telecom default charset UTF8 COLLATE;
Step 8, the TRAC Projects project library configuration
Creates a TRAC project library parent path, and I/trac/projects as the project Library parent path for TRAC (Parentdir). This directory is arbitrary and if multiple project libraries must be under the same parent path, it is recommended that all TRAC project libraries be placed under the same parent path for ease of administration. We use the following command to initialize the project library telecomprojects
#trac-admin/trac/projects/telecomprojects initenv
The following is the Trac-admin Installation Wizard
Project name [My project]>telecomproject//Enter project name Telecomproject, of course, the name is arbitrary, the proposal library name and path name is the same database Connection string [sqlite:db/trac.db]>mysql://trac:password@localhost:1521/trac_telecom//Here we use the MySQL database, If you use SQLite Direct carriage return Repository type [svn]> direct return//warehouse type SVN return Path to Repository [/path/to/repos]& gt;/svn/repos/telecomprojects //Input SVN project library path Templates directory [/usr/share/trac/templates] > Direct return //template path, if you choose the TRAC installation path when installing, then rewrite this to the correct TRAC installation path
Step 9, Start Trac and access
Start TRAC
#tracd--port 8000/trac/projects/telecomprojects
Then visit the following Web site to see if TRAC is working properly
Http://localhost:8000/or Http://localhost:8000/TelecomProject.
With the above steps 7~8, we can add multiple TRAC projects repeatedly
Like what
#trac-admin/trac/projects/otherprojects initenv
Step 10, Apache and TRAC integration
Edit Apache configuration file/etc/httpd/conf/httpd.conf file or/etc/httpd/conf.d/python.conf file
At the end add the following section <Location/trac> SetHandler mod_python Pythoninterpreter main_interpreter Pythonhandler trac.web.modpython_frontend pythonoption tracenvparentdir//If a single item can also be written as Pythonoption tracenv/trac/ projects/telecomprojects #PythonOption tracenv/trac/ projects/telecomprojects authtype Basic authname "Trac Projects" authuserfile/svn/.htpasswd Require valid-user </LOCATION>&NBSP;&NBSp
Note 1: If a single item can be written as a pythonoption tracenv/trac/projects/telecomprojects, I recommend that all project libraries be placed under the same parent path
Note 2: We can see that the configuration of the authentication mode is the same as SVN configuration, and the same user authentication file is used (if your SVN is authenticated with the user authentication file)!
Step 11, secure access settings [must be set, otherwise TRAC cannot access]
Modifying the owner and access rights of a directory
#chown Apache.apache-r/trac
#chmod 755-r/trac
Modify the SELinux settings
Disable SELinux (strongly not recommended) or hook up disable SELinux protection for httpd Daemon This option in the SELinux graphics management interface, otherwise Apache this virtual user cannot access the/trac directory. Of course you can also set Apache access rights in a better way.
Use experience
1. TRAC does not support the database authentication method, support LDAP authentication way, if want to and SVN account one, must use login user file authentication way, the author in another article will talk about Svn+trac+apache integration scheme
2. Trac attachment support is too small (about 250k), we can modify the TRAC project library configuration file, such as/trac/projects/telecomprojects/conf/trac.ini file, find
[Attachment]
max_size=262144
.........
Change the value of the max_size to the size you want, such as 1000000 (around 10M)
3. The attachment text Chinese question, the attachment if is the text way, wants the text the character code to become the Utf-8, for instance may notepad the TXT file into the utf-8 format, otherwise the attachment content displays on the page displays will appear garbled, of course the file downloading is no problem, I wonder why TRAC displays the contents of the text attachment.