博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Trac Install Guide
阅读量:4144 次
发布时间:2019-05-25

本文共 3121 字,大约阅读时间需要 10 分钟。

1 Dependencies

1.1 Mandatory Dependencies

1.1.1 Download Python (python-2.7.1.msi)

1.1.2 Download Trac (Trac-0.12.2.win32.exe)

1.1.3 Download Setuptools (setuptools-0.6c11.win32-py2.7.exe)

1.1.4 Genshi (Genshi-0.6.win32.exe)

1.2 Optional Dependencies

1.2.1 Subversion

1.2.2 Web Server

1.2.3 Other Python Packages

2 Installing Trac

2.1 Install Python, Trac, Setuptools, Genshi

3 Creating a Project Environment

3.1 Run the following command from the command prompt:

trac-admin path-to-desired-location initenv

Note that you may have to specify the full path to trac-admin as shown here:

D:\Program Files\python27\scripts\trac-admin path-to-desired-location initenv

or you can add D:\Program Files\python27\scripts\ to the Path.

You will be prompted for the following:

Project NameDatabase connection stringRepository typePath to repository

Note:If you're not sure what to specify for one of these options, just press <Enter> to use the default value.

3.2 Test

After 3.1, it will create your Trac site. You can do a trial run by saying:

tracd --port 8000 trac-site-location

...and then visiting using your web-browser.

4 Deploying Trac

4.1 Running the Standalone Server (See 3.2)

4.2 Running Trac on a Web Server

4.2.1 Install mod_wsgi

4.2.1.1 Download mod_wsgi-win32-ap22py27-3.3.so

4.2.1.2 Rename the file mod_wsgi-win32-ap22py27-3.3.so to mod_wsgi.so and copy it to the modules subdirectory of Apache installation (D:\Program Files\Apache Software Foundation\Apache2.2\modules)

4.2.1.3 Locate httpd.conf under the conf subdirectory of the Apache installation (D:\Program Files\Apache Software Foundation\Apache2.2\conf) and open it in a text editor. Find the lines starting with and insert the following line there:

LoadModule wsgi_module modules/mod_wsgi.so

4.2.2 Configure mod_wsgi for the site

4.2.2.1 Generate trac.wsgi

Run the following command at the command prompt. Replace "temporary-directory" with the name of a temporary folder where the required scripts for your Trac site will be generated.

trac-admin trac-site-location deploy temporary-directory

This command will create two folders within "temporary-directory" -- cgi-bin and htdocs. You will find the properly configured WSGI script for your site in temporary-directory\cgi-bin\trac.wsgi.

4.2.2.2 Copy trac.wsgi from temporary-directory\cgi-bin (D:\Trac\tmp\deploy\cgi-binn) to trac-site-location (D:\Trac\myproject)

4.2.3 Configure Apache

Open httpd.conf, scroll to the bottom and add the following there:

-----------------------------------------------------------WSGIScriptAlias /trac "trac-site-location/apache/trac.wsgi"
WSGIApplicationGroup %{GLOBAL} Order deny,allow Allow from all
AuthType Basic AuthName "Trac" AuthUserFile D:/Trac/trac.htpasswd Require valid-user
-----------------------------------------------------------

Note: You should create trac.htpasswd file via hrpasswd command and put it in D:/Trac

Also, we can put these codes in a file named trac.conf and include it in http.conf.

4.2.4 Restart the Apache server for the configuration changes to take effect

 

 

Reproduced, please indicate the source!

转载地址:http://xjdti.baihongyu.com/

你可能感兴趣的文章
java多线程中的join方法详解
查看>>
ECLIPSE远程调试出现如下问题 ECLIPSE中调试代码提示找不到源
查看>>
java abstract修饰符
查看>>
数组分为两部分,使得其和相差最小
查看>>
java抽象类和接口
查看>>
有趣的排序——百度2017春招
查看>>
二叉树的最近公共祖先LCA
查看>>
数组中累加和为定值K的最长子数组长度
查看>>
素数对--腾讯2017校招编程
查看>>
JAVA集合--ArrayList实现原理
查看>>
synchronized与Lock
查看>>
数据库索引
查看>>
实现包含min,max,push,pop函数的栈
查看>>
实验2-6 字符型数据的输入输出
查看>>
实验3-5 编程初步
查看>>
实验4-1 逻辑量的编码和关系操作符
查看>>
实验5-2 for循环结构
查看>>
实验5-3 break语句和continue语句
查看>>
实验5-4 循环的嵌套
查看>>
实验5-5 循环的合并
查看>>