Edgewall Software

Changes between Version 20 and Version 21 of TracOnUbuntu


Ignore:
Timestamp:
Jul 1, 2005, 5:07:52 PM (19 years ago)
Author:
anonymous
Comment:

a bit of refactoring

Legend:

Unmodified
Added
Removed
Modified
  • TracOnUbuntu

    v20 v21  
    1 España.
     1= Trac on Ubuntu =
    22
    3 These instructions were written for a '''fresh install''' of Ubuntu(Hoary). I used the Ubuntu [http://www.ubuntulinux.org/support/documentation/faq/installation-custom/view?searchterm=server%20install Custom install] which creates a very bare-bones system - no X server or other niceties. Just the ticket for a lightweight, nimble server!
     3These instructions were written for a '''fresh install''' of Ubuntu. This documentation suggests performing [http://www.ubuntulinux.org/support/documentation/faq/installation-custom/view?searchterm=server%20install custom install] when installing Ubuntu to create a base system without an X server or other graphical niceties. These instructions, however, should work reasonably well if you already have Ubuntu installed or you have performed a full install.
    44
    5 These instructions should work OK under other conditions (full install, existing systems) as well.
     5'''Warty users:''' Ubuntu needs versions of {{{python-sqlite}}} and {{{clearsilver}}} that aren't available on Warty (see #468 & #1104). You will need to [http://ubuntuguide.org/4.10/index.html#upgradewartytohoary upgrade to the Hoary release] or later.
    66
    7 FYI, Trac has trouble with Ubuntu's {{{WartyWarthog}}} release; it needs versions of python-SQLite and clearsilver that aren't available on Warty (see #468 & #1104). So I upgraded my fresh Warty install to the {{{HoaryHedgehog}}} release. A fresh Hoary install should be ok but I didn't test that.
     7== Installation ===
    88
    9 To upgrade from Warty to Hoary, I changed my '''/etc/apt/sources.list''' to look like this:
     9=== 1. Install Software Packages ===
     10
     11To install Trac on your system, install the {{{trac}}} and {{{libapache2-svn}}} packages:
     12
    1013{{{
    11 ## Main & restricted
    12 deb http://archive.ubuntu.com/ubuntu hoary main restricted
    13 deb-src http://archive.ubuntu.com/ubuntu hoary main restricted
    14 
    15 ## Universe (needed for the Trac install)
    16 deb http://archive.ubuntu.com/ubuntu hoary universe
    17 deb-src http://archive.ubuntu.com/ubuntu hoary universe
    18 
    19 ## Security
    20 deb http://security.ubuntu.com/ubuntu hoary-security main restricted
    21 deb-src http://security.ubuntu.com/ubuntu hoary-security main restricted
     14sudo apt-get install trac libapache2-svn
    2215}}}
    2316
    24 ... then ran the following commands to actually perform the update:
     17=== 2. Create the Trac Envioronments Directory ===
     18
     19You'll need a directory for Trac's envioronments to live that should be writable by the default Apache user:
     20
    2521{{{
    26 sudo apt-get update
    27 sudo apt-get -y upgrade
     22sudo mkdir /var/trac
     23sudo chown www-data:www-data /var/trac
    2824}}}
    2925
    30 You can take a nice long break while Hoary is downloaded and installed.
     26=== 3. Setup Apache2 ===
    3127
    32 Once that's done, we have a brand-new Hoary install. The rest of these instructions look painful, but really the hardest part is now over. With a fast net connection, you can do the rest of this in 10-15 minutes.
     28Next, create a new Apache-2 virtualhost by saving the following as {{{/etc/apache2/sites-available/trac}}} :
    3329
    34 We need to install a few more things:
    35 
    36 {{{
    37 sudo apt-get install trac
    38 sudo apt-get install libapache2-svn
    39 }}}
    40 
    41 '''NOTE:''' You should also do an '''apt-get install python''' before installing '''trac'''.  Apparently, apt-get failed to install python properly and cause some errors on in the later commands.  The only caveat here is that '''apt-get install python''' will uninstall '''gde''' so beware!!!  Do an '''apt-get install gde''' to restore the desktop... if you installed the desktop, that is. Also, take a look near the end of this file for how the original author solved the python issue without doing this. Could be that python changed in the Hoary repository?
    42 
    43 ----
    44 NOTE: Throughout the rest of this text I use {{{YourProjectNameHere}}} as the project name. Clearly, you'll want to replace this with a name for your own project!
    45 ----
    46 
    47 Configure Apache for by editing '''/etc/apache2/sites-available/default'''. When you're done the file will look like this (I think my changes are pretty obvious - they are preceded by the comment lines IN ALL CAPS):
    48 {{{
    49 NameVirtualHost *
    50 <VirtualHost *>
    51         ServerAdmin webmaster@localhost
    52 
    53         DocumentRoot /var/www/
    54         <Directory />
    55                 Options FollowSymLinks
    56                 AllowOverride None
    57         </Directory>
    58         <Directory /var/www/>
    59                 Options Indexes FollowSymLinks MultiViews
    60                 AllowOverride None
    61                 Order allow,deny
    62                 allow from all
    63                 # This directive allows us to have apache2's default start page
    64                 # in /apache2-default/, but still have / go to the right place
    65                 # Commented out for Ubuntu
    66                 #RedirectMatch ^/$ /apache2-default/
    67         </Directory>
    68 
    69 ## ---THESE LINES FROM ORIGINAL FILE WERE COMMENTED OUT---
    70 #       ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    71 #       <Directory "/usr/lib/cgi-bin">
    72 #               AllowOverride None
    73 #               Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
    74 #               Order allow,deny
    75 #               Allow from all
    76 #       </Directory>
    77 ## ---END OF COMMENTS---
    78 
    79         ErrorLog /var/log/apache2/error.log
    80 
    81         # Possible values include: debug, info, notice, warn, error, crit,
    82         # alert, emerg.
    83         LogLevel warn
    84 
    85         CustomLog /var/log/apache2/access.log combined
    86         ServerSignature On
    87 
    88     Alias /doc/ "/usr/share/doc/"
    89     <Directory "/usr/share/doc/">
    90         Options Indexes MultiViews FollowSymLinks
    91         AllowOverride None
    92         Order deny,allow
    93         Deny from all
    94         Allow from 127.0.0.0/255.0.0.0 ::1/128
    95     </Directory>
    96 
    97 ## ---THESE LINES WERE ADDED TO THE ORIGINAL FILE---
    98 Alias /trac "/usr/share/trac/htdocs"
    99 ScriptAlias /cgi-bin/ /usr/share/trac/cgi-bin/
    100 <Location "/cgi-bin/trac.cgi">
    101  SetEnv TRAC_ENV "/var/trac/YourProjectNameHere"
    102 </Location>
    103 
    104 <Directory "/usr/share/trac/htdocs">
    105   Options Indexes MultiViews
    106   AllowOverride None
    107   Order allow,deny
    108   Allow from all
    109 </Directory>
    110 
    111 # You need something like this to authenticate users
    112 <Location "/cgi-bin/trac.cgi/login">
    113   AuthType Basic
    114   AuthName "YourProjectNameHere"
    115   AuthUserFile /var/www/trac.htpasswd
    116   Require valid-user
    117 </Location>
    118 
    119 #SVN dir
    120 <Location /svn>
    121   DAV svn
    122   SVNParentPath /var/svn
    123 </Location>
    124 ## ---END OF ADDITIONS---
    125 
    126 </VirtualHost>
    127 
    128 }}}
    129 
    130 Alternatively, instead of making a mess of your nice default vhost, why not take advantage of the vhost setup that unbuntu kindly has already set up for you.
    131 
    132 Make a new file called /etc/apache2/sites-available/trac and put this in it.
    13330{{{
    13431<VirtualHost *>
     
    14340        </Directory>
    14441        Alias /trac "/usr/share/trac/htdocs"
     42
    14543        <Location /trac.cgi>
    146             # You may need to customize this
    14744            SetEnv TRAC_ENV "/var/trac"
    14845        </Location>
     
    15148        ErrorLog /var/log/apache2/error.trac.log
    15249        CustomLog /var/log/apache2/access.trac.log combined
    153 
    15450</VirtualHost>
    15551}}}
    156 Note that you'll also need to make the following change to the apache2.conf file. (which some people don't like doing, I've never understood why not) Make sure that the {{{AddHandler}}} line is uncommented.
     52
     53You also need to uncomment the {{{AddHandler}}} line in {{{/etc/apache2/apache2.conf}}} so that the Trac CGI program will be executed:
     54
    15755{{{
    15856# To use CGI scripts outside /cgi-bin/:
     
    16159}}}
    16260
    163 Then, use {{{ sudo a2ensite trac }}} and restart apache, and you're good to go.  Now you have your normal site left as before, running at www.example.com and your trac project running at trac.example.com.  Feel free to go and play with the rewrite rules to pretty it up further, but now, back to the rest of the setup.
     61Now, disable the default virtualhost, enable the Trac virtualhost, and restart Apache2:
     62
     63{{{
     64sudo a2ensite trac
     65sudo a2dissite default
     66sudo /etc/init.d/apache2 restart
     67}}}
     68
     69This last step would differ if you were already serving other virtualhosts.
     70
     71=== 4. Creating Environments ===
    16472
    16573I installed my Subversion repository at {{{/var/svn/YourProjectNameHere}}}. So I did a quick starting config of subversion with the following commands:
     
    213121''Voila! Your Trac system & website should be up and running.''
    214122
    215 ----
     123== Comments & Suggestions ==
    216124
    217 OPTIONAL: create a redirect file called /var/www/index.html with this one line:
    218 {{{
    219 <META HTTP-EQUIV="Refresh" CONTENT="0; URL=http://10.0.0.102/cgi-bin/trac.cgi">
    220 }}}
    221 
    222 ... with this change, you can get to Trac with '''!http://servername''' instead of the more cumbersome '''!http://servername/cgi-bin/trac.cgi'''
    223 
    224 ----
    225 putting your trac.htpasswd file into /var/www might not be such a good idea though, since that might be served by apache to the outside
     125* Celebrate with beer.