| 1 | How to install Trac 0.12 on ubuntu 11.10 machine with apache2 using wsgi. (everytime I use vim you can user any editor you want (nano, gedit..)) |
| 2 | |
| 3 | '''Install trac''' (and usefull plugins) from repository: |
| 4 | |
| 5 | {{{ |
| 6 | sudo apt-get install trac trac-accountmanager trac-graphviz trac-icalviewplugin trac-masterticket trac-wysiwyg trac-wikitablemacro trac-tags trac-customfieldadmin trac-datefieldplugin |
| 7 | }}} |
| 8 | |
| 9 | If you're going to use sqlite for db (as I do) install python-sqlite: |
| 10 | |
| 11 | {{{ |
| 12 | sudo apt-get install sqlite3 python-sqlite |
| 13 | }}} |
| 14 | |
| 15 | |
| 16 | '''install sendmail''' (if not installed already): |
| 17 | |
| 18 | {{{ |
| 19 | sudo apt-get install sendmail |
| 20 | }}} |
| 21 | |
| 22 | '''add trac user:''' |
| 23 | |
| 24 | {{{ |
| 25 | sudo adduser --system --shell /bin/sh --gecos 'trac project managment' --group --disabled-password --home /home/trac trac |
| 26 | }}} |
| 27 | |
| 28 | '''login as trac user''' start bash and swich to homedir: |
| 29 | |
| 30 | {{{ |
| 31 | sudo su trac |
| 32 | bash |
| 33 | cd |
| 34 | }}} |
| 35 | |
| 36 | '''make directory for all projects and create new project''' |
| 37 | |
| 38 | {{{ |
| 39 | mkdir projects |
| 40 | cd projects |
| 41 | trac-admin android initenv |
| 42 | }}} |
| 43 | and finish instalation |
| 44 | |
| 45 | '''back to your user'''. |
| 46 | pressing CTRL+d twice should get you back. |
| 47 | |
| 48 | now we'll configure apache |
| 49 | |
| 50 | Open apache apache site file what you want to use for trac (default should be fine). In my case I have Virtualhost for subdomain trac. |
| 51 | |
| 52 | {{{ |
| 53 | vim /etc/apache2/sites-enabled/trac |
| 54 | }}} |
| 55 | and looks like: |
| 56 | |
| 57 | {{{ |
| 58 | <VirtualHost *> |
| 59 | ServerName trac.domain.my |
| 60 | DocumentRoot /var/trac/projects |
| 61 | |
| 62 | WSGIScriptAlias ^/([^/]+) /var/trac/projects/$1/deploy/cgi-bin/trac.wsgi |
| 63 | <Directory /var/trac/projects> |
| 64 | Options Indexes FollowSymLinks MultiViews |
| 65 | AllowOverride None |
| 66 | Order allow,deny |
| 67 | allow from all |
| 68 | </Directory> |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | ... trac unrelated stuff... |
| 74 | |
| 75 | </VirtualHost> |
| 76 | }}} |
| 77 | |
| 78 | WSGIScriptAlias does all the magic. it gets project name from url and redirects to trac.wsgi in that project. |
| 79 | If you're not running trac sites as subdomain but as folder in your documentroot (i.e. domain.ur/trac/myproject) replace ^/([^/]+) line with ^/'''trac/'''([^/]+) |
| 80 | |