Having the development files under a version control is crucial, even in such cases where only one developer works on them. To get more out of the version control and its tracking, I explain here how to install Trac in a Windows environment. Version used here are the current ones, but procedure should be the same for other versions too, as long as they are compatible with each others.
Here is a list of downloads needed with a short explanation if no executable for Windows is not available:
- Python 2.5.2
- EasyInstall
- Donwload ez_setup.py
- Run "C:\Python25\python.exe ez_setup.py"
- PySQLite 2.4.1
- ModPython 3.3.1
- Subversion 1.4.6 bindings for Python 2.5
- Genshi 0.4.4
- PIL 1.1.6 (not necessarily needed if no additional plugins will be installed)
- Trac 0.11 dev
- Get the latest trunk
- Run "C:\Python25\python.exe setup.py install"
- Account manager plugin
- svn co http://trac-hacks.org/svn/accountmanagerplugin/trunk
- Run "C:\Python25\python.exe setup.py install"
First set up the mod_python in Apache, which usually might be the most troubling task. Edit httpd.conf by enabling the Python module:
LoadModule python_module modules/mod_python.so
Set the mod_python as the handler for files having "py" suffix:
AddHandler mod_python .py
Lets imagine that the integration of Python to Apache now works. If not, good luck with troubleshooting.
Moving on to setting up the first Trac project. I usually have repository in a path "project/svn" and Trac set in "project/trac". The project folder is then occasionally backed up by compressing with 7zip and placed elsewhere.
To set up the Trac for kobudo.fi project, I have issued the following command:
C:\Python25\Scripts\trac-admin.exe F:\Repository.Set\kobudo.fi\trac initenv
This creates all the directories and files needed for Trac. You will be asked for project name, repository type (defaults to Subversion) and repository location. As I explained my directory structure, I have it in "F:\Repository.Set\kobudo.fi\svn". By default the database type is SQLite which is the most suitable for this setup.
To access the pages, they needed to be configured in httpd.conf:
<Location /projects/kobudo.fi>
SetHandler mod_python
PythonInterpreter main_interpreter
PythonHandler trac.web.modpython_frontend
PythonOption TracEnv "F:\Repository.Set\kobudo.fi\trac"
PythonOption TracUriRoot /projects/kobudo.fi
</Location>Before you point your browser to "http://localhost/projects/kobudo.fi" (or whatever your address would be), the configuration file of your newly set Trac requires some tweaking. You might like to set the icon and the header image for example. The ones listed below are for the Account Manager plugin installed earlier.
[account-manager]
password_store = SessionStore
hash_method = HtDigestHashMethod
[components]
trac.web.auth.LoginModule = disabled
acct_mgr.admin.accountmanageradminpage = enabled
acct_mgr.api.accountmanager = enabled
acct_mgr.db.sessionstore = enabled
acct_mgr.web_ui.accountmodule = enabled
acct_mgr.web_ui.loginmodule = enabled
acct_mgr.web_ui.registrationmodule = enabled
acct_mgr.pwhash.htdigesthashmethod = enabled
acct_mgr.pwhash.htpasswdhashmethod = enabled
To enable the Trac Admin panel, run the following command. In case you will have more users than you, substitute "authenticated" with your user name.
C:\Python25\Scripts\trac-admin.exe F:\Repository.Set\kobudo.fi\trac permission add authenticated TRAC_ADMIN
From here on the wiki available in your Trac will help. Please also note that the paths given here are the ones I have used and will most probably differ in your system.
Nearly forgot, by default character set is set to "iso-8859-15" in trac.ini. By setting it to "utf-8" a wider variety of characters will appear correctly in the diff views.






















