We are going to start using Agile development for some of our new projects so I was asked to get an project management tool set up. I had used Trac in the past and heard of the Agile42 Agilo plugin for it. I had also used VersionOne professionally but that is a paid app. I eventually decided to give Trac + Agilo a go on our Windows Server 2003 virtual image server called “myserver”. Our project will be called “myproject”.
The main Trac install doc can be found at http://trac.edgewall.org/wiki/TracInstall which I used a bit, but also deviated from as well.
Downloads
The files that I required were:
- Apache HTTPD 2.2.19: Download Win32 Binary including OpenSSL MSI http://httpd.apache.org/download.cgi#apache22 for example httpd-2.2.19-win32-x86-openssl-0.9.8r.msi.
- MySQL 5.5.12: Download Windows (x86, 32-bit) MSI Installer from http://www.mysql.com/downloads/mysql/ for example mysql-5.5.12-win32.msi.
- PHP 5.3.6: Download Windows VC9 x86 Thread Safe Installer from http://windows.php.net/download/ for example php-5.3.6-Win32-VC9-x86.msi.
- Python 2.7.1: Download Python 2.7.1 Windows Installer from http://www.python.org/download/ for example python-2.7.1.msi.
- Python setuptools 0.6c11: Download the Windows executable for the correct Python version (above) from http://pypi.python.org/pypi/setuptools#files for example setuptools-0.6c11.win32-py2.7.exe.
- phpMyAdmin 3.4.1: Download the phpMyAdmin zip package (English only) from http://www.phpmyadmin.net/home_page/downloads.php for example phpMyAdmin-3.4.1-english.zip.
- Genshi 0.6: Download the Windows package from http://genshi.edgewall.org/wiki/Download#Installers for example Genshi-0.6.win32.exe.
- mod_wsgi 3.3 (py27): Download mod_wsgi-win32-ap22py27-3.3.so – Apache 2.2 / Python 2.7 from http://code.google.com/p/modwsgi/wiki/DownloadTheSoftware?tm=2#Windows_Binary_Downloads for example mod_wsgi-win32-ap22py27-3.3.so.
- MySQL-python 1.2.3: Download MySQL-python 1.2.3 for Windows and Python 2.7 from http://www.codegood.com/archives/129 for example MySQL-python-1.2.3.win32-py2.7.exe.
- Agile42 Agilo 0.9.3: Download the Agilo Source Code from http://www.agile42.com/cms/pages/download-install/ for example agilo-0.9.3.tar.gz.
Installation Steps
Our server has a C: drive for OS files, D: drive for installed apps, and E: drive for data and content. If you see these drive listings in the instructions then you now know our reasoning.
- Apache Install: run the httpd-2.2.19-win32-x86-openssl-0.9.8r.msi file to install Apache. Choose the default options except for the screens below:
- Server Information
- Administrator’s Email Address: websupport@blah.com
- Setup Type
- Custom: select
- Cusom Setup
- Change install location to: D:Apache2.2
- Server Information
- Apache Config: create the empty folder E:logs. Also create the file E:wwwindex.html with content
<h1>It workz!</h1>
Next, open up the D:Apache2.2confhttpd.conf and edit the following lines:
- DocumentRoot
DocumentRoot "E:/www"
- Directory
<Directory "E:/www">
- DirectoryIndex
DirectoryIndex index.html index.php
- ErrorLog
ErrorLog "E:/logs/error.log"
- CustomLog
CustomLog "E:/logs/access.log" common
- Save the file and restart Apache. Test http://myserver to make sure that your “It workz!” message appears.
- DocumentRoot
- MySQL Installation: run the mysql-5.5.12-win32.msi file to install MySQL. Choose the default options except for the screens below:
- Choose Setup Type
- Custom button
- Custom Setup
- MySQL Server: D:MySQL Server 5.5
- Server data files: E:MySQL Server 5.5 Data
- Choose Setup Type
- MySQL Server Instance Configuration Wizard: This will auto open at the end of the installation but it can also be opened from the Start menu. Choose the default options except for the screens below:
- Configuration type: Detailed Configuration
- Server Type: Server Machine
- Database Usage: Mulitfunctional Database
- Drive: E:MySQL Datafiles
- Concurrent connections: Decision Support (DSS)/OLAP
- Networking options
- Enable TCP/IP Networking: enabled
- Port Number: 3306
- Enable Strict Mode: enabled
- Character Set: Best Support for Multilingualism (UTF8)
- Windows Options
- Install As Windows Service: enabled
- Service Name: MySQL
- Launch the MySQL Server automatically: enabled
- Include Bin Directory in Windows PATH: enabled
- Security
- Modify Security Settings: enabled
- New root password: <some password>
- Enable root access from remote machines: enabled
- Execute and finish.
- PHP Installation: run the php-5.3.6-Win32-VC9-x86.msi file to install PHP. Choose the default options except for the screens below:
- Destination Folder: D:PHP
- Web Server Setup: Apache 2.2.x Module
- Apache Configuration Directory: D:Apache2.2conf
- Finish the installation. Try to restart Apache to be sure that you have the correct PHP version for your install of Apache.
- phpMyAdmin Installation: Unzip the phpMyAdmin-3.4.1-english.zip file to E:wwwphpMyAdmin and ensure that you can navigate to http://myserver/phpMyAdmin and login using your MySQL root user.
- Python Installation: run the python-2.7.1.msi file to install Python. Choose the default options except for the screens below:
- Select Destination Directory: D:Python27
- Finish the install.
- Python Configuration: open the Environment Variables for Windows and add a new System Variable as Variable name:
PYTHON_HOME
and Variable value:D:Python27
. Edit thePath
System Variable and add to the end of the Variable value:....;%PYTHON_HOME%;%PYTHON_HOME%Scripts
- Python setuptools Installation: run the setuptools-0.6c11.win32-py2.7.exe file to install Python setuptools. It is a pretty straight forward install.
- Genshi Installation: run the Genshi-0.6.win32.exe file to install Python setuptools. It is a pretty straight forward install.
- mod_wsgi Module Installation: Copy the mod_wsgi-win32-ap22py27-3.3.so file to D:Apache2.2modules directory. Edit the D:Apache2.2confhttpd.conf file and add the following line at the bottom of the file:
LoadModule wsgi_module modules/mod_wsgi-win32-ap22py27-3.3.so
Restart Apache to make sure that the module loads successfully.
- MySQL-Python Installation: run the MySQL-python-1.2.3.win32-py2.7.exe file to install MySQL-Python. It is a pretty straight forward install.
- Prepare Trac database: from documentation at http://trac.edgewall.org/wiki/MySqlDb.
- Go to phpMyAdmin (http://myserver/phpMyAdmin) and press the Databases tab. In the Create New Database section enter:
- Name: trac
- Collation: utf8_bin
- Select the new ‘trac’ database and then go into SQL tab. Run the statemtent
SHOW VARIABLES WHERE variable_name IN ('character_set_database', 'collation_database');
and ensure that the output looks like
+------------------------+----------+ | Variable_name | Value | +------------------------+----------+ | character_set_database | utf8 | | collation_database | utf8_bin | +------------------------+----------+ 2 rows in set (0.01 sec)
- Select the Privileges tab and select Add a new User.
- Name: tracadm
- Password: <some pass>
- Database for user: Grant all privileges on database “trac”
- Press Go
- Your connection string for Trac will be “mysql://tracadm:<some pass>@localhost/trac” when prompted.
- Go to phpMyAdmin (http://myserver/phpMyAdmin) and press the Databases tab. In the Create New Database section enter:
- Trac Installation:
- For Trac 0.12.2, run the following commands from the command line:
easy_install Babel==0.9.5 easy_install Trac
Ensure that these install successfully.
- Create the folder E:/trac/myproject then create a new project (doc: http://trac.edgewall.org/wiki/TracInstall#CreatingaProjectEnvironment) by running the following from command line:
trac-admin E:/trac/myproject initenv
and input the parameters when asked for name and connection string:
Creating a new Trac environment at E:tracmyproject Trac will first ask a few questions about your environment in order to initialize and prepare the project database. Please enter the name of your project. This name will be used in page titles and descriptions. Project Name [My Project]> myproject Please specify the connection string for the database to use. By default, a local SQLite database is created in the environment directory. It is also possible to use an already existing PostgreSQL database (check the Trac documentation for the exact connection string syntax). Database connection string [sqlite:db/trac.db]> mysql://tracadm:<some pass>@local host/trac Creating and Initializing Project Installing default wiki pages ........ --------------------------------------------------------------------- Project environment for 'myproject' created. You may now configure the environment by editing the file: E:tracmyprojectconftrac.ini If you'd like to take this new project environment for a test drive, try running the Trac standalone web server `tracd`: tracd --port 8000 E:tracmyproject Then point your browser to http://localhost:8000/myproject. There you can also browse the documentation for your installed version of Trac, including information on further setup (such as deploying Trac to a real web server). The latest documentation can also always be found on the project website: http://trac.edgewall.org/ Congratulations!
- Create a folder called E:traceggs which will store the egg cache. Also, create a file E:tractrac.wsgi (which is the WSGI mod so Apache can use Python, doc: (http://trac.edgewall.org/wiki/TracModWSGI)) with the following content:
import os os.environ['TRAC_ENV_PARENT_DIR'] = 'E:/trac' os.environ['PYTHON_EGG_CACHE'] = 'E:/traceggs' import trac.web.main application = trac.web.main.dispatch_request
we are using the
TRAC_ENV_PARENT_DIR
so that if there are more projects added they can be shown in the project index at http://myserver/trac. - Open the Apache config D:Apache2.2confhttpd.conf, go to the bottom of the file where the _+LoadModule wsgi_module …+- was added and below that add:
<Directory E:/trac> WSGIApplicationGroup %{GLOBAL} Order deny,allow Allow from all </Directory>
this will force all calls to http://myserver/trac to look in E:trac. Restart Apache and ensure that there are no errors.
- Try to go to http://myserver/trac, click on the Available Project: myproject, and you should see the skeleton of a Trac site!
- For Trac 0.12.2, run the following commands from the command line:
- Authentication: Using the instruction found at http://trac.edgewall.org/wiki/TracModWSGI#UsingDigestAuthentication we will start with Digest Authentication.
- In a command window run:
trac-admin E:tracmyproject permission add admin TRAC_ADMIN
This will map the user ‘admin’ with the role of TRAC_ADMIN. However the user ‘admin’ needs to be created still.
- Open the system Environment Variables and create a new System Variable with Variable name:
APACHE_HOME
and Variable value:D:Apache2.2
. Next, edit thePath
System variable and add the following the the END of the Variable value:...;%APACHE_HOME%bin
. Save all of these changes and open a NEW command window. - Create a new password file by running the command:
htdigest -c E:/trac/trac.htpasswd trac admin
- Open the Apache config again (D:/Apache2.2/conf/httpd.conf) and enable the auth_digest_module by un-commenting it:
LoadModule auth_digest_module modules/mod_auth_digest.so
and at the very bottom of the file add the following:
<LocationMatch "/trac/[^/]+/login"> AuthType Digest AuthName "trac" AuthDigestDomain /trac AuthUserFile E:/trac/trac.htpasswd Require valid-user </LocationMatch>
- Restart Apache and ensure that there are no errors. Navigate to http://myserver/trac/myproject and select ‘login’. A popup will ask for credentials. Enter ‘admin’ and the password that was entered into the htdigest file from above. You should be logged in and see the new Admin tab that was not there before.
- In a command window run:
- Agile42 Installation: Note: The site instructions can be found at http://www.agile42.com/agilo/how-install-agilo-trac/#windows.
- Extract the agilo-0.9.3.tar.gz archive into E:tempagilo.
- From command prompt run:
E:tempagilo> python setup.py install
this will compile and install Agilo to the Python sites.
- Open the project trac.ini file that you want to Agilo enable. For our example, open E:tracmyprojectconftrac.ini and add the following to the end of the file:
[components] agilo.* = enabled # the following lines are only required to use Agilo Pro #agilo_common.* = enabled #agilo_pro.* = enabled
save the file.
- From the command prompt also run:
trac-admin E:/trac/myproject upgrade trac-admin E:/trac/myproject wiki upgrade
- Restart Apache then visit the http://myserver/trac/myproject again. The Trac project should now be Agilo enabled (with new skins).
Configuration Steps
Look and Feel
Edit the E:tracmyprojectconftrac.ini and set the following:
[project] admin = admin_trac_url = . descr = Project management tool for the MyProject project. footer = Visit the Trac open source project at<br /><a href="http://trac.edgewall.org/">http://trac.edgewall.org/</a> icon = site/favicon.ico name = myproject url = http://myserver/trac/myproject [header_logo] alt = MyProject Project height = -1 link = /trac/myproject src = site/logo.png width = -1
The site/ content is actually found in E:tracmyprojecthtdocs and copy the favicon.ico from D:Python27Libsite-packagesagilo-0.9.3-py2.7.eggagilohtdocsimages and put it into the project htdocs folder. Also copy the logo.png image for the header to the project htdocs folder.
Email Notification
To enable the email features for Trac edit the E:tracmyprojectconftrac.ini and set the following:
[notification] admit_domains = always_notify_owner = false always_notify_reporter = false always_notify_updater = true ambiguous_char_width = single email_sender = SmtpEmailSender ignore_domains = mime_encoding = none sendmail_path = sendmail smtp_always_bcc = smtp_always_cc = smtp_default_domain = smtp_enabled = true smtp_from = websupport@blah.com smtp_from_name = Trac - MyProject smtp_password = smtp_port = 25 smtp_replyto = websupport@blah.com smtp_server = mailhost smtp_subject_prefix = __default__ smtp_user = ticket_subject_template = $prefix #$ticket.id: $summary use_public_cc = false use_short_addr = false use_tls = false
Logging
To enable the logging features for Trac edit the E:tracmyprojectconftrac.ini and set the following:
[logging] log_file = trac.log log_level = WARNING log_type = file
The log file will be found under the project log folder in E:tracmyprojectlog.
Alternative Authentication
We can optionally install the Trac AccountManagerPlugin (http://trac-hacks.org/wiki/AccountManagerPlugin) to let Trac handle logins via an form instead of Apache HTTP login.
- Disable the Apache HTTP Digest Authentication: In the steps above we enable HTTP Digest Authentication via Apache. Go into the D:Apache2.2confhttpd.conf and comment out the LocationMatch directive:
#<LocationMatch "/trac/[^/]+/login"> # AuthType Digest # AuthName "trac" # AuthDigestDomain /trac # AuthUserFile E:/trac/trac.htpasswd # Require valid-user #</LocationMatch>
Restart Apache.
- Download Subversion (SVN)_: The AccountManagerPlugin needs Subversion to download so go to http://sourceforge.net/projects/win32svn/ (if Windows 32bit is the OS) and grab the MSI. For example Setup-Subversion-1.6.16.msi.
- Install SVN: Run the installer being sure to install to D:Subversion. Once the install is complete, go into the Environment Variables and create a new System Variable with Variable name:
SVN_HOME
and Variable value:D:Subversion
. Next, edit thePath
System Variable and add to the end of the Variable value:....;%SVN_HOME%bin
. Press OK out of all of the dialogs. - Install the Trac AccountManagerPlugin: For Trac 0.12 open a command window and enter the command:
easy_install https://trac-hacks.org/svn/accountmanagerplugin/trunk
If you are installing a different version of Trac, please verify what the correct location of the AccountManagerPlugin you should install from the website http://trac-hacks.org/wiki/AccountManagerPlugin#Install. Restart Apache for the new plugin to load.
- Configure: Open the Trac Admin Plugin page (http://myserver/trac/myproject/admin/general/plugin).
- Find the ‘trac 0.12.2’ section (usually at the top) and then scroll to the ‘trac.web.auth.*’ property and deselect the LoginModule which handles the Apache HTTP authentication. Save and verify that E:tracmyprojectconftrac.ini has the line:
[components] .... trac.web.auth.loginmodule = disabled
disabled. It is not enough for it to just not exist, it needs to be explicitly disabled.
- Scroll down to the ‘tracaccountmanager 0.3dev-r10250’ section (bottom) and enable the following:
- acct_mgr.admin.AccountGuardAdminPage
- acct_mgr.admin.AccountManagerAdminPage
- acct_mgr.api.AccountManager
- acct_mgr.guard.AccountGuard
- acct_mgr.htfile.AbstractPasswordFileStore
- acct_mgr.htfile.HtDigestStore
- acct_mgr.notification.AccountChangeListener
- acct_mgr.notification.AccountChangeNotificationAdminPanel
- acct_mgr.pwhash.HtDigestHashMethod
- acct_mgr.web_ui.AccountModule
- acct_mgr.web_ui.EmailVerificationModule
- acct_mgr.web_ui.LoginModule
- Apply all changes. Once applied, there should be an Accounts > Configuration option in the navigation. Go there and set the following:
- HTDigestStore: set drop down to 1 (ie first)
- filename: E:tractrac.htpasswd which is the same file that we set up above for Apache HTTP Digest Authentication
- realm: trac
- Allow the user to be remembered across sessions without needing to re-authenticate: deselect
- Force users to change passwords after a password reset: check
- Force users to verify their email addresses: check
- Then go to Accounts > Notification and select __ALL_ check boxes and put in the administrator’s email (ie: websupport@blah.com) and Save.
- Go to Accounts > Users and add in your users manually. Once added, you should see the entry in the E:tractrac.htpasswd file.
- Find the ‘trac 0.12.2’ section (usually at the top) and then scroll to the ‘trac.web.auth.*’ property and deselect the LoginModule which handles the Apache HTTP authentication. Save and verify that E:tracmyprojectconftrac.ini has the line:
That is it! Now on to adding backlog and sprints.
Happy Agile’n!