Trac Install Guide

1 Dependencies

1.1 Mandatory Dependencies

1.1.1 Download Python (python-2.7.1.msi)

 http://www.python.org/getit/

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

 http://trac.edgewall.org/wiki/TracDownload

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

 http://pypi.python.org/pypi/setuptools#downloads

1.1.4 Genshi (Genshi-0.6.win32.exe)

 http://genshi.edgewall.org/wiki/Download

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  http://localhost:8000/ 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

 http://code.google.com/p/modwsgi/wiki/DownloadTheSoftware?tm=2

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 withLoadModule? 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"

<Directory "trac-site-location/apache">
	WSGIApplicationGroup %{GLOBAL}
	Order deny,allow
	Allow from all
</Directory>

<Location "/trac">
	AuthType Basic
	AuthName "Trac"
	AuthUserFile D:/Trac/trac.htpasswd
	Require valid-user
</Location>

-----------------------------------------------------------

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!


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值