In Python 2.6 install Trac 0.12.1 Project Management System

An article on the version of Python Subversion binding support issues, and Python interpreter using the Python 2.5 is not Python 2.6.

In this article we build a Python interpreter uses Python 2.6.6, project management using Trac 0.12.1, a database using MySQL, code management with Subversion 1.6.13 of the Trac project management system.

Packages needed for the following:

Trac 0.12.1, Trac program < http://trac.edgewall.org/wiki/TracDownload >
Apache 2.2.16, Web server < http://httpd.apache.org/download.cgi >
Subversion 1.6.13, code version management tools < http://sourceforge.net/projects/win32svn/ >
Python 2.6.6, Python interpreter < http://www.python.org/ >

mod_python-3.3.2-dev-20080819.win32-py2.6.exe Python's Apache module unofficial < http://vagabonds.info/python/mod_python-3.3.2-dev-20080819.win32-py2.6. exe >
svn-win32-1.6.13_py.zip, Python 2.6 of Subversion binding < http://sourceforge.net/projects/win32svn/ >

setuptools (ez_setup.py), Python's package building and publishing tools < http://peak.telecommunity.com/DevCenter/setuptools >
Genshi-0.6 (Genshi-0.6.win32.exe), Python-based template engine < http://genshi.edgewall.org/wiki/Download >
Babel-0.9.5, Python-based language that supports plug-ins < http://babel.edgewall.org/wiki/Download >

MySQL 5.1.51, the database server < http://www.mysql.com/ >
MySQL-python-1.2.2.win32-py2.6.exe, Python module to access MySQL database < http://sourceforge.net/projects/mysql-python/ > Private < http://www.codegood.com / archives / 4 >

Installation error how to do?
If you find some parts of the installation process is not normal, and remember to correct the following way:

1. View the error message, see if you can find tips
2. Forgot to check for installed software
3. Check the httpd.conf is wrong
4. Remember to restart Apache after changes

First, install Apache and subversion

Download the official website of the Apache 2.2.16 version of the msi installation package, the Executive can be. After installing the browser to access http://localhost/ , such as Apache can see the start page that is installed successfully.
Apache2.2 installed by default in C: \ Program Files \ Apache Software Foundation \ Apache2.2 directory.

Downloaded from the Subversion Setup-Subversion-1.6.13.msi, implementation can be.
Subversion is installed by default in C: \ Program Files \ Subversion directory.

Then integrated with Subversion and Apache (which can also refer to this article.)
Will be C: \ Program Files \ Subversion \ bin under the following files to C: \ Program Files \ Apache Software Foundation \ Apache2.2 \ modules directory:

mod_authz_svn.so
mod_dav_svn.so

And then create the code repository directory C: \ SVNROOT.

Then modify C: \ Program Files \ Apache Software Foundation \ Apache2.2 \ conf \ httpd.conf, find the following line, remove the # in front.

LoadModule dav_module modules / mod_dav.so

Then add the following in the vicinity of this line:

LoadModule dav_svn_module modules / mod_dav_svn.so

After the end of httpd.conf add the following:

<Location /repos>
DAV svn
SVNParentPath "C: / SVNROOT"
</ Location>

Then restart Apache.

At the end of httpd.conf add the following:

LoadModule proxy_module modules / mod_proxy.so
LoadModule proxy_balancer_module modules / mod_proxy_balancer.so

<Location /balancer>
SetHandler balancer-manager
Order Deny, Allow
Deny from all
Allow from 127.0.0.1
</ Location>

Then restart Apache.

Then try to access the http://localhost/balancer , you will see below as follows:

Server Version: Apache/2.2.16 (Win32) DAV / 2 SVN/1.6.13

If this shows SVN/1.6.13, it indicates a successful installation.

Second, install Python, mod_wsgi and SVN binding

1, the official website from the Python 2.6 Python's msi installation package to install, assuming installed to C: \ Python26 directory.

2, from Web site to download the unofficial mod_python mod_python 3.3.2 for Win32 version ( http://vagabonds.info/python/mod_python-3.3.2-dev-20080819.win32-py2.6.exe ).

When it will ask you to install Apache is installed, enter C: \ Program Files \ Apache Software Foundation \ Apache2.2 to.

Finally open the C: \ Program Files \ Apache Software Foundation \ Apache2.2 \ conf \ httpd.conf, find the LoadModule, add the following line:

LoadModule python_module modules / mod_python.so

Then restart Apache.

Then try to access the http://localhost/balancer , you will see below as follows:

Server Version: Apache/2.2.16 (Win32) DAV / 2 SVN/1.6.13 mod_python/3.3.2-dev-20080819 Python/2.6.6

If this shows mod_python/3.3.1 Python/2.6.6 the instructions to install successfully.

3, the installation of Subversion binding to Python support for Subversion. Where to download just download the Subversion svn-win32-1.6.13_py.zip file and install it. Before installation see README.txt.

Python 2.5 or more users please note:
From Python 2.5 + will not be used. Dll be loaded extension module, you must manually add the directory of all *. dll files libsvn (libsvn / *. dll) renamed. Pyd extension. Please do not change the file libsvn_swig_py-1.dll file name.
Svn directories libsvn and should be extracted to C: \ Python26 \ Lib \ site-packages directory directory.

4, please http://peak.telecommunity.com/DevCenter/setuptools ez_setup.py download and install the setuptools:

Installation command: ez_setup.py setuptools == dev

5, please go to http://genshi.edgewall.org/wiki/Download Genshi-0.6.win32.exe download and install Genshi-0.6:

6, in order to allow Trac to display Chinese, the installation of Trac prior to go http://babel.edgewall.org/ Babel-0.9.5.win32.exe download and install Babel.

Third, install MySQL and MySQLdb

To the official home page to download the latest version of MySQL 5.1.51 (mysql-5.1.51-win32.msi) and install it. Please read carefully before you install MySQL http://trac.edgewall.org/wiki/MySqlDb .

1, create the database, and then authorize the user name and password.
mysql> CREATE DATABASE trac DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
Query OK, 1 row affected (0.02 sec)

MySQL> GRANT ALL ON TRAC .* TO tracuser @ localhost IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.00 sec)

MySQL database connection string is as follows:

mysql: / / tracuser: password @ localhost / trac

2, Trac database must be configured to utf8 character set and utf8_bin collation type.

After installing Trac to check as follows:
mysql> USE trac;
Database changed
mysql> SHOW VARIABLES WHERE variable_name IN ('character_set_database', 'collation_database');
+------------------------+----------+
| Variable_name | Value |
+------------------------+----------+
| Character_set_database | utf8 |
| Collation_database | utf8_bin |
+------------------------+----------+
2 rows in set (0.01 sec)

mysql> SHOW FULL COLUMNS FROM 'node_change';
+-------------+-------------+-----------+-
| Field | Type | Collation |
+-------------+-------------+-----------+-
| Rev | varchar (64) | utf8_bin |
| Path | text | utf8_bin |
| Node_type | varchar (32) | utf8_bin |
| Change_type | varchar (32) | utf8_bin |
| Base_path | text | utf8_bin |
| Base_rev | varchar (64) | utf8_bin |
+-------------+-------------+-----------+-
6 rows in set (0.00 sec)

In addition to all the tables must be InnoDB or NDB type because Trac does not support the transaction mechanism used MyISAM table type.

3, in order for Python support for MySQL, we also need to install MySQL-python-1.2.2.win32-py2.6 module. To http://sourceforge.net/projects/mysql-python/ or http://www.codegood.com/archives/4 download and install version 1.2.2.

After installation is complete, determine the C: \ Python26 \ Lib \ site-packages \ MySQLdb directory exists.

Fourth, the installation Trac

Trac finally played the main character's turn. Trac download page to download the installation program Trac (Trac-0.12.win32.exe) and install it.

And then create the project directory C: \ Projects.

Then open the C: \ Program Files \ Apache Software Foundation \ Apache2.2 \ conf \ httpd.conf, in the most at the end add the following:

<Location /projects>
SetHandler mod_python
PythonHandler trac.web.modpython_frontend
PythonOption TracEnvParentDir C: / Projects
PythonOption TracUriRoot / projects
</ Location>

Then restart Apache, visit http://localhost/projects/ , you will see Available Projects words, then the installation was successful. At this point all the completed installation.

, To create projects

Now we want to create a real development in the use of the project. We named this project hello.

First, to establish a code repository. Open a command line, enter the following command:

C:
cd C: \ SVNROOT
md hello
cd hello
svnadmin create.

Note that the last space after a symbol "."

Then open the browser, access http://localhost/repos/hello/ . If you have the above settings are correct, you will see the following:

hello - Revision 0: /
----------------------------------------------
Note that the code repository to build a successful, but http://localhost/repos/hello/ is the code repository URL.

And then create the database. From the Start menu to start MySQL, MySQL Command Line Client tool, create a new database trac, attention to the character encoding set to UTF8.

And then create Trac project. Open a command line, enter the following command:

C:
cd C: \ Projects
C: \ Python26 \ Scripts \ trac-admin hello initenv

trac-admin management tool for the Trac, hello to the project name, initenv command instructs Trac to create a new project. Then follow the contents of the input:

Project Name [My Project]> Hello World
Database connection string [sqlite: db / trac.db]> mysql: / / <username>: <password> @ localhost / trac

Database connection line, <username> and <password> were set when installing MySQL user name and password. If the creation fails, you need to delete the C: \ Projects \ hello then try again.
mysql: / / tracuser: password @ localhost / trac

Last tips
Congratulations!
That you installed successfully.

Open a browser, access http://localhost/projects/hello to see Trac's interface.

VI, set the HTTP authentication in the top right of Trac have a Login menu interface, then log in through the menu, create a bug or do other modifications do not need to enter your user name each time. But this menu need to be individually configured to work properly.

First, we want to generate the password file. Open a command line, enter the following command:

C:
cd C: \ Projects
"C: \ Program Files \ Apache Software Foundation \ Apache2.2 \ bin \ htpasswd"-c trac.htpasswd admin
Automatically using MD5 format.
New password: *****
Re-type new password: *****
Adding password for user admin
To generate the password file trac.htpasswd.

After an additional user to the password file so only you can.
"C: \ Program Files \ Apache Software Foundation \ Apache2.2 \ bin \ htpasswd" trac.htpasswd user

Then edit the httpd.conf, in the most at the end add the following:

<LocationMatch "/projects/[^/]+/login">
AuthType Basic
AuthName "Trac"
AuthUserFile C: / Projects / trac.htpasswd
Require valid-user
</ LocationMatch>

Then restart Apache.

To access the "management" (Admin) tag, you must give the user admin permissions TRAC_ADMIN. Open a command line, enter the following command:
C:
cd C: \ Projects
C: \ Python26 \ Scripts \ trac-admin hello permission add admin TRAC_ADMIN

So far we have Trac project management system based on the installation is complete.

分类:Python 时间:2010-11-03 人气:184
分享到:
blog comments powered by Disqus

相关文章

  • Mysql database server configuration file / etc / my.cnf configuration details 2010-10-24

    The following is a Mysql database server configuration file / etc / my.cnf configuration details. Applications is the InnoDB engine, 4-core CPU, 32 Bit SUSE. [Client] port = 3306 socket = / tmp / mysql.sock # The MySQL server [Mysqld] bind-address =

  • Error infos: DedeCms error Warning: database connection, database password may be incorrect or the database server error! 2011-04-27

    This is because DedeCMS does not have the correct server and database connection , 3 kinds of possible occurrence of a problem : First, your database server is having problems , If you bought a virtual host or shared server, please contact space requ

  • Turn: F5 help eBay database server load balancing 2008-10-02

    U.S. eBay is the world's largest online trading platform. According to statistics, every day thousands of categories involving several millions of items on eBay to sell; eBay's annual growth rate of 50%. But, compared to the fast-growing business, eB

  • Optimization of MySQL database server details 2010-08-19

    MySql Server Admin program, in order to use the client program, the program must be running, because the client by connecting to the server to access the database. Let us to the server system variables and state variables as the basis, optimizing our

  • Details of the MySQL database server optimization 2010-08-19

    MySql Server Admin program, in order to use the client program, the program must be running, because the client by connecting to the server to access the database. Let the server system variables and state variables as the basis for optimizing our My

  • Web architecture for the use of the database server 2010-11-02

    About SSD Last year, we have used a number of SSD's PC, used for the database server, database server to improve IO capabilities. However, from the current use situation, if the SSD as primary storage, there are some problems: First, SSD stability is

  • MySQL database server on CentOS configuration 2011-03-18

    CentOS also inadvertently found a professional forum, remember: http://www.centospub.com So, start learning the configuration The environment: CentOS system mysql-server (version forget, because it is installed using yum) Process is as follows (repro

  • ctypes python module applications in Chinese help documentation 2010-02-04

    Translator: butland, translated in 2010.1.2 - 2010.1.3, personal blog: http://butlandblog.appspot.com/ Content: . Load the dynamic link library . Dll is loaded from the reference function . Call the function 1 . The basic data types . Call the functi

  • mysql database server command statements log 2010-03-18

    MySQL database server in the installed directory to find my.ini file In the last line with: log=D:/Program Files/MySQL/MySQL Server 5.1/log.txt Restart, open the log.txt you can see the results. Today, parameters encountered encoding settings: SET co

  • Development Notes: Python Module in 2010-09-16

    Python Module of the more important concepts. Common situation is a pre-written. Py file in another file, need to import, it will be written in advance. Py files are copied to the current directory, or add in sys.path prior written. Py file where the

iOS 开发

Android 开发

Python 开发

JAVA 开发

开发语言

PHP 开发

Ruby 开发

搜索

前端开发

数据库

开发工具

开放平台

Javascript 开发

.NET 开发

云计算

服务器

Copyright (C) codeweblog.com, All Rights Reserved.

CodeWeblog.com 版权所有 黔ICP备15002463号-1

processed in 0.738 (s). 12 q(s)