= How to install Trac 0.12 on Ubuntu 11.10 with Apache2 using WSGI {{{#!div class="system-message" '''Notice''': These instructions are incomplete. See http://robertbasic.com/blog/trac-on-ubuntu for more detailed instructions. }}} Every time I use vim you can use any editor you want, such as nano or gedit. '''Install Trac''' and some useful plugins from the repository: {{{#!sh sudo apt-get install trac trac-accountmanager trac-graphviz trac-icalviewplugin trac-mastertickets trac-wysiwyg trac-wikitablemacro trac-tags trac-customfieldadmin trac-datefieldplugin }}} If you're going to use sqlite for the database, then install python-sqlite: {{{#!sh sudo apt-get install sqlite3 python-sqlite }}} '''Install sendmail''' (if not installed already): {{{#!sh sudo apt-get install sendmail }}} '''Add Trac user''' {{{#!sh sudo adduser --system --shell /bin/sh --gecos 'trac project management' --group --disabled-password --home /var/trac trac }}} '''Add www-data to Trac group''' so Apache can access Trac files: {{{#!sh sudo adduser www-data trac }}} '''Login as Trac user''' start bash and switch to the home directory: {{{#!sh sudo su trac bash cd }}} '''Make directory for all projects and create new project''' {{{#!sh mkdir projects cd projects trac-admin android initenv trac-admin android deploy android/deploy }}} and finish installation. '''Change permissions so group can write/read/execute''' {{{#!sh chmod 0775 . -R }}} You can add as many projects as you want and at any point in time. All you have to do is create a new project, deploy it and you're set. '''Back to your user''' Pressing Ctrl-D twice should get you back. '''Configure Apache webserver''' Open the Apache site file that you want to use for Trac. The default file should be fine. In my case I have Virtualhost for subdomain Trac: {{{#!sh vim /etc/apache2/sites-enabled/trac }}} and it looks like: {{{#!apache ServerName trac.domain.my DocumentRoot /var/trac/projects WSGIScriptAliasMatch ^/([^/]+) /var/trac/projects/$1/deploy/cgi-bin/trac.wsgi WSGIApplicationGroup %{GLOBAL} Options Indexes +ExecCGI +SymLinksIfOwnerMatch AllowOverride None Order allow,deny allow from all AuthType Basic AuthName "trac" AuthUserFile /var/trac/.passwd Require valid-user ... trac unrelated stuff... }}} WSGIScriptAlias does all the magic. It gets its project name from url and redirects to trac.wsgi in that project. If you're not running Trac sites as a subdomain but as a folder in your documentroot (i.e. `domain.ur/trac/myproject`), then replace: {{{#!sh ^/([^/]+) }}} with: {{{#!sh ^/trac/([^/]+) }}} (there's just added 'trac/'). And make sure that `/var/trac/projects` is in DocumentRoot. '''Reload Apache configuration''' {{{#!sh sudo service apache2 reload }}}