Configuring the Web Admin Plugin For Trac
Introduction
The goal of this article is to help developers, sys admin, whoever out there to get a complete software control and management environment installed and configured using Subversion and Trac, running on Windows.
What We're Going to Install
- Apache
- Subversion
- Eclipse, and CFEclipse, Subclipse
- Trac (Python, Subversion bindings, Clearsilver, PySQLite)
But we use IIS!
- Your Apache/Subversion/Trac environment shouldn't be on the server as your
ColdFusion/IIS configuration
- Apache, Subversion and Trac should be on a server of their own; Windows,
Linux, etc
- If you absolutely need to run these on the same server, then you simply install
Apache on a different port, e.g. 8080
Why Windows and not *nix?
- A *nix install of Subversion and Trac is easy
- Using Fedora Core, e.g. yum �install trac
- There are a multitude of unanswered questions on how to set up Subversion and Trac on
Windows
What This Article Doesn't Cover
- Why we use Version Control
- Why we use Subversion
- Why we use Trac
Why Apache
- Not required
- SVN has it's own built-in server, called SVNSERVE
- Apache has a number of advantages
- Enhanced repository logging
- Can use HTTPS
- Built in repository browsing
- Svnserve(Windows) only allows a single repository
- Svnserve runs on non-standard port 3690
- Apache allows authentication against htpassword, LDAP, etc.
- Svnserve uses a clear text file
- Svnserve has issues with concurrency issues
What Version of Apache?
- Using 2.0.x as later versions (2.2.x) have issues with Trac
- We're installing 2.0.59
- We are using non-SSL
Install Apache
- Do install
- Apache configuration done via httpd.conf file
- Create new windows user file "apache"
- Modify Apache2 service to use "apache" user
- Give "apache" user full access to Apache logs folder
Install Subversion
- Install SVN 1.4.3
- SVN will make changes to the Apache httpd.conf
- Enables mod_dav.so
- Provides WebDav functionality
- Adds dav_svn_module
- Makes repository available via network
- Adds authz_svn_module
- Enables per directory access
- Set up Authentication
<Location /svn>
DAV svn
SVNParentPath
d:\svn
AuthType Basic
AuthName
"Fuzzy Orange Repositories"
AuthUserFile passwd
Require valid-user
</Location>
This configures all repositories to be located under d:\svn
- They can be accessed via http://<servername>/svn
- Access is restricted to know username/passwords listed in "passwd"
- Create the password file
- Open DOS prompt
- Browse to Apache 2 folder
- bin\htpasswd �c passwd
- This creates our passwd file
- Additional users can be added bin\htpasswd passwd
- Create d:\svn
- Give "apache" account full access to this folder
- Restart Apache
Create a Repository
-
We need to create a repository outside of Subclipse
- Open a DOS box and type
svnadmin create
d:\svn\blogcfc
Grab CFEclipse and Subclipse
- http://www.eclipse.org
- http://www.cfeclipse.org/index.cfm?event=page&page=download
- http://subclipse.tigris.org/install.html
Import an Existing Project
- Download a copy of BlogCFC from http://blogcfc.riaforge.org/
- Deploy BlogCFC to d:\www\blogcfc
- Using Eclipse, change to your SVN Repository Perspective
- Create a new location
- http://<servername>/svn/blogcfc
- Change to CFE Perspective
- Create new Project, point to d:\www\blogcfc
- Choose Team/Share Project
- SVN is now set up for BlogCFC
Modify Some Code
- Simply modify one of the files in your project
- Commit back to SVN, by right clicking, choosing Team and then Commit
You now have Subversion installed, you have created a repository, imported an existing projects, made changes to your code, and commited them back to Subversion.
Installing Trac
- Install Python 2.4.3 http://www.python.org/download/releases/2.4.3/
- Install Subversion bindings http://subversion.tigris.org/files/documents/15/38214/svn-python-1.4.4.win32-py2.4.exe
- Install Clearsilver 0.9.14 http://www.clearsilver.net/downloads/
- Install Pysqlite 2.3.2 http://initd.org/pub/software/pysqlite/releases/2.3/2.3.4/pysqlite-2.3.4.win32-py2.4.exe
- Install Trac 0.10.4 http://trac.edgewall.org/wiki/TracDownload
Create a Trac Project
- Create a directory d:\TracProjects
- Give "apache" user full access to the above directory
- Python scripts\trac-admin d:\TracProjects\blogcfc initenv
- Project Name: BlogCFC
- DB Connection String: Use Default
- Version Control: use default
- Repository Path: d:\svn\blogcfc
- Templates: use default
- Python scripts\tracd �port 8000 d:\TracProject\BlogCFC
- We now know Trac is working
Configure Trac to use Apache
- Install mod_python http://www.modpython.org/
- Modify httpd.conf and add LoadModule python_module modules/mod_python.so
- Add configuration to httpd.conf
<Location /projects>
SetHandler mod_python
PythonHander trac.web.modpython_frontend
PythonOption TracEnvParentDir
d:\TracProjects
PythonOption TracUriRoot /projects
</Location>
<LocationMatch "/projects/[^/]+/login">
AuthType Basic
AuthName
"Fuzzy Orange Trac Projects"
AuthUserFile passwd
Require valid-user
</LocationMatch>
You can now hit http://<servername>/projects/blogcfc