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 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!