Edgewall Software

Changes between Initial Version and Version 1 of TracFeisty


Ignore:
Timestamp:
May 12, 2007, 11:57:34 PM (17 years ago)
Author:
luizsoarez@…
Comment:

Initial import from the guide I wrote on http://www.mdlabs.est.ips.pt/majestic13/TracFeisty

Legend:

Unmodified
Added
Removed
Modified
  • TracFeisty

    v1 v1  
     1This guide shows all the steps to correctly install a [http://trac.edgewall.org trac] system on a Ubuntu 7.04 Server. Please feel free to contact me ([mailto:luizsoarez@gmail.com Luis]) at any time with corrections or sugestions. This guide will be constantly updated but you see [http://www.mdlabs.est.ips.pt/majestic13/TracFeisty the original] on the madlabs page.
     2
     3This guide focuses on several things that I missed throughout the documentation, both official and unofficial:
     4
     5 * Everything configured from scratch ''with'' authentication, multiple projects and mod_python
     6 * Not losing time explaining the decisions here. This is specifically to have multiple repositories, authentication and mod_python on Ubuntu. I never fork() the guide to give other possibilities
     7 * The guide is pretty complete. After following the instructions here, my next step was to update my subversion reposity and continue on creating users and project environments. The esential is completelly covered here
     8 * And if you're using a fresh instalation of Feisty Fawn and follow these instructions strictly, it will all be finished within 5 minutes!!!
     9
     10Enjoy and comment!
     11
     12
     13== Apache ==
     14 * The first step is to install Apache.
     15
     16 {{{
     17 $ sudo apt-get install apache2
     18 }}}
     19
     20 apt-get configures everything you need and your webroot will be configured to {{{/var/www}}}. Ubuntu (actually, Debian) divides apache websites (virtualhost) in a set of directories under {{{/etc/apache2/sites-available}}} and has two utilites to configure them: {{{a2ensite}}} and {{{a2dissite}}}. We'll make use of these tools throughout this guide.
     21
     22
     23== Subversion ==
     24The idea with our subversion instalation is to have a main directory and several repositories under it. We'll be setting {{{/svn}}} as our subversion parent dir and then create {{{/svn/project1}}}, {{{/svn/project2}}}, etc as needed. This second step will configure subversion, set apache to use mod_dav_svn and enable authentication through the digest method.
     25
     26 * We start by apt-getting the packages
     27
     28 {{{
     29 $ sudo apt-get install subversion libapache2-svn
     30 }}}
     31
     32 * We'll now configure {{{mod_dav_svn}}} and enable the {{{mod_auth_digest}}} module. We start by editing {{{/etc/apache2/mods-enabled/dav_svn.conf}}}
     33
     34 {{{
     35 $ sudo vim /etc/apache2/mods-enabled/dav_svn.conf
     36 }}}
     37
     38 This file probably has already a set of directives in it. I just show here the final version without the comments and changed to enable digest authentication:
     39
     40 {{{
     41 <Location /svn>
     42  DAV svn
     43  SVNParentPath /svn
     44
     45  ####### BASIC
     46  AuthType Basic
     47
     48  AuthName "Subversion Repository"
     49  AuthUserFile /etc/apache2/dav_svn.passwd
     50  AuthzSVNAccessFile /etc/apache2/authz_svn.access
     51
     52  Require valid-user
     53 </Location>
     54 }}}
     55
     56
     57 * The next step is to create a user for subversion.
     58
     59 {{{
     60 $ sudo htpasswd -cm /etc/apache2/dav_svn.passwd luis
     61 New password: my_password
     62 Re-type new password: my_password
     63 }}}
     64
     65 * Additionally we'll create the authorization file for our users
     66 {{{
     67 $ sudo vim /etc/apache2/authz_svn.access
     68 }}}
     69
     70 * And add the following rule for our user. In this case, we'll be allowing him full access to the {{{teste}}} repository.
     71
     72 {{{
     73 [teste:/]
     74 luis = rw
     75 }}}
     76
     77 * Finally we restart apache.
     78
     79 {{{
     80 $ sudo apache2ctl restart
     81 }}}
     82
     83 * Our next task is to create the subversion parent dir and a repository, and add a dummy project to it:
     84 {{{
     85 $ sudo mkdir /svn
     86 $ sudo svnadmin create /svn/teste
     87
     88 $ sudo mkdir /tmp/teste
     89 $ sudo mkdir /tmp/teste/branches
     90 $ sudo mkdir /tmp/teste/tags
     91 $ sudo mkdir /tmp/teste/trunks
     92
     93 $ sudo chmod -R 777 /svn
     94 $ sudo chown -R www-data:www-data /svn
     95
     96 $ sudo svn import /tmp/teste http://localhost/svn/teste -m "initial import" --username luis
     97
     98 $ sudo rm -rf /tmp/teste
     99 }}}
     100
     101 We can now point a browser to http://localhost/svn/teste and an authentication pop-up should apear and, after that, our repository. It is a good time to read some more on the "Per-Directory Access Control" part of the subversion book. One part of the security involved in this instalation only has to do with Subversion so some reading on [http://svnbook.red-bean.com/en/1.0/svn-book.html#svn-ch-6-sect-4.4.2 Per-Directory Access Control] might be useful at this time.
     102
     103
     104== trac ==
     105
     106Let's now head for the instalation of the trac system. For trac to work we'll be needing python and a number of other packages. Then we'll have to create a trac environment for each repository we want trac to serve.
     107
     108 * Let's start with apt-getting the needed packages
     109
     110 {{{
     111 $ sudo apt-get install trac libapache2-svn libapache2-mod-python libapache2-mod-python-doc
     112 }}}
     113
     114 * trac needs a directory to put the environments on where apache can read/write. We'll also add a symlink to this directory so it's easier to get there:
     115
     116 {{{
     117 $ sudo mkdir /var/lib/trac
     118 $ sudo chown -R www-data:www-data /var/lib/trac
     119 $ sudo ln -s /var/lib/trac/ /trac
     120 }}}
     121
     122 * Now we need another site for apache:
     123
     124 {{{
     125 $ sudo vim /etc/apache2/sites-available/trac
     126 }}}
     127
     128 * And add the following code to it:
     129
     130 {{{
     131 <Location /trac>
     132  SetHandler mod_python
     133  PythonHandler trac.web.modpython_frontend
     134  PythonOption TracEnvParentDir /var/lib/trac
     135  PythonOption TracUriRoot /trac
     136 </Location>
     137
     138 <LocationMatch "/trac/[^/]+/login">
     139  AuthType Basic
     140  AuthName "Trac"
     141  AuthUserFile /etc/apache2/dav_svn.passwd
     142  Require valid-user
     143 </LocationMatch>
     144 }}}
     145
     146 * Let's now enable this site:
     147
     148 {{{
     149 $ sudo a2ensite trac
     150 Site trac installed; run /etc/init.d/apache2 reload to enable.
     151 $ sudo  /etc/init.d/apache2 reload
     152 Reloading web server config...                                                     [ OK ]
     153 }}}
     154
     155
     156 * The final step is to initialize the trac environment for our project. The only thing I had to fill in here was the name of my projecto and the path to my subversion repository:
     157
     158 {{{
     159 $ sudo trac-admin /trac/teste initenv
     160 Creating a new Trac environment at /trac/teste
     161 Trac will first ask a few questions about your environment
     162 in order to initalize and prepare the project database.
     163 Please enter the name of your project.
     164 This name will be used in page titles and descriptions.
     165 Project Name [My Project]> O Teste Final
     166 Please specify the connection string for the database to use.
     167 By default, a local SQLite database is created in the environment
     168 directory. It is also possible to use an already existing
     169 PostgreSQL database (check the Trac documentation for the exact
     170 connection string syntax).
     171 Database connection string [sqlite:db/trac.db]>
     172 Please specify the type of version control system,
     173 By default, it will be svn.
     174 If you don't want to use Trac with version control integration,
     175 choose the default here and don't specify a repository directory.
     176 in the next question.
     177 Repository type [svn]>
     178 Please specify the absolute path to the version control
     179 repository, or leave it blank to use Trac without a repository.
     180 You can also set the repository location later.
     181 Path to repository [/path/to/repos]> /svn/teste
     182 Please enter location of Trac page templates.
     183 Default is the location of the site-wide templates installed with Trac.
     184 Templates directory [/usr/share/trac/templates]>
     185 Creating and Initializing Project
     186 Installing default wiki pages
     187 /usr/share/trac/wiki-default/TracTicketsCustomFields => TracTicketsCustomFields
     188 /usr/share/trac/wiki-default/WikiPageNames => WikiPageNames
     189 /usr/share/trac/wiki-default/TracUnicode => TracUnicode
     190 /usr/share/trac/wiki-default/TracChangeset => TracChangeset
     191 /usr/share/trac/wiki-default/TracTickets => TracTickets
     192 /usr/share/trac/wiki-default/WikiStart => WikiStart
     193 /usr/share/trac/wiki-default/WikiFormatting => WikiFormatting
     194 /usr/share/trac/wiki-default/TracQuery => TracQuery
     195 /usr/share/trac/wiki-default/InterMapTxt => InterMapTxt
     196 /usr/share/trac/wiki-default/InterWiki => InterWiki
     197 /usr/share/trac/wiki-default/TracAdmin => TracAdmin
     198 /usr/share/trac/wiki-default/TracLinks => TracLinks
     199 /usr/share/trac/wiki-default/TracModPython => TracModPython
     200 /usr/share/trac/wiki-default/TracEnvironment => TracEnvironment
     201 /usr/share/trac/wiki-default/WikiRestructuredText => WikiRestructuredText
     202 /usr/share/trac/wiki-default/TracInstall => TracInstall
     203 /usr/share/trac/wiki-default/WikiDeletePage => WikiDeletePage
     204 /usr/share/trac/wiki-default/CamelCase => CamelCase
     205 /usr/share/trac/wiki-default/TracAccessibility => TracAccessibility
     206 /usr/share/trac/wiki-default/TracTimeline => TracTimeline
     207 /usr/share/trac/wiki-default/TracReports => TracReports
     208 /usr/share/trac/wiki-default/TracWiki => TracWiki
     209 /usr/share/trac/wiki-default/TracRoadmap => TracRoadmap
     210 /usr/share/trac/wiki-default/WikiProcessors => WikiProcessors
     211 /usr/share/trac/wiki-default/TracSearch => TracSearch
     212 /usr/share/trac/wiki-default/WikiHtml => WikiHtml
     213 /usr/share/trac/wiki-default/TracIni => TracIni
     214 /usr/share/trac/wiki-default/WikiRestructuredTextLinks => WikiRestructuredTextLinks
     215 /usr/share/trac/wiki-default/RecentChanges => RecentChanges
     216 /usr/share/trac/wiki-default/TracNotification => TracNotification
     217 /usr/share/trac/wiki-default/TracBackup => TracBackup
     218 /usr/share/trac/wiki-default/TracPermissions => TracPermissions
     219 /usr/share/trac/wiki-default/TracBrowser => TracBrowser
     220 /usr/share/trac/wiki-default/SandBox => SandBox
     221 /usr/share/trac/wiki-default/InterTrac => InterTrac
     222 /usr/share/trac/wiki-default/WikiNewPage => WikiNewPage
     223 /usr/share/trac/wiki-default/TracInterfaceCustomization => TracInterfaceCustomization
     224 /usr/share/trac/wiki-default/TracSyntaxColoring => TracSyntaxColoring
     225 /usr/share/trac/wiki-default/TracPlugins => TracPlugins
     226 /usr/share/trac/wiki-default/TracUpgrade => TracUpgrade
     227 /usr/share/trac/wiki-default/TracSupport => TracSupport
     228 /usr/share/trac/wiki-default/WikiMacros => WikiMacros
     229 /usr/share/trac/wiki-default/TracImport => TracImport
     230 /usr/share/trac/wiki-default/TracLogging => TracLogging
     231 /usr/share/trac/wiki-default/TracGuide => TracGuide
     232 /usr/share/trac/wiki-default/TracRevisionLog => TracRevisionLog
     233 /usr/share/trac/wiki-default/TracFastCgi => TracFastCgi
     234 /usr/share/trac/wiki-default/TracCgi => TracCgi
     235 /usr/share/trac/wiki-default/TracRss => TracRss
     236 /usr/share/trac/wiki-default/TracStandalone => TracStandalone
     237 /usr/share/trac/wiki-default/TitleIndex => TitleIndex
     238 Indexing repository
     239
     240 ---------------------------------------------------------------------
     241 Project environment for 'O Teste final' created.
     242
     243 You may now configure the environment by editing the file:
     244
     245  /var/lib/trac/teste2/conf/trac.ini
     246
     247 If you'd like to take this new project environment for a test drive,
     248 try running the Trac standalone web server `tracd`:
     249
     250  tracd --port 8000 /var/lib/trac/teste2
     251
     252 Then point your browser to http://localhost:8000/teste.
     253 There you can also browse the documentation for your installed
     254 version of Trac, including information on further setup (such as
     255 deploying Trac to a real web server).
     256
     257 The latest documentation can also always be found on the project
     258 website:
     259
     260  http://trac.edgewall.org/
     261
     262 Congratulations!
     263 }}}
     264
     265 At this point we still have to reset the ownership of the repository to the www-data user so that the database file can be accessed. Also, it's always a good idea to restart apache, just in case...
     266
     267 {{{
     268 $ sudo chown -R www-data:www-data /var/lib/trac
     269 $ sudo apache2ctl restart
     270 }}}
     271
     272 * At this point we are still without any authentication. We'll start by removing permissions to the anonymous user, allowing him only to see the initial page. Then we'll also set our main user as the trac's root:
     273
     274 {{{
     275 $ sudo trac-admin /trac/teste permission remove anonymous BROWSER_VIEW CHANGESET_VIEW FILE_VIEW LOG_VIEW MILESTONE_VIEW REPORT_SQL_VIEW REPORT_VIEW ROADMAP_VIEW SEARCH_VIEW TICKET_CREATE TICKET_MODIFY TICKET_VIEW TIMELINE_VIEW WIKI_CREATE WIKI_MODIFY
     276
     277 $ sudo trac-admin /trac/teste permission add luis TRAC_ADMIN
     278 }}}
     279
     280 * You can now check http://localhost/trac and you should see a list with all the projects for which you have a trac environment set. clicking on one of them will get you to a page where you could have a small description of your project but you won't see any ather links (important ones at least). Try to login to see the differences.
     281