Changes between Version 20 and Version 21 of TracOnUbuntu
- Timestamp:
- Jul 1, 2005, 5:07:52 PM (19 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracOnUbuntu
v20 v21 1 España. 1 = Trac on Ubuntu = 2 2 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!3 These 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. 4 4 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. 6 6 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 === 8 8 9 To upgrade from Warty to Hoary, I changed my '''/etc/apt/sources.list''' to look like this: 9 === 1. Install Software Packages === 10 11 To install Trac on your system, install the {{{trac}}} and {{{libapache2-svn}}} packages: 12 10 13 {{{ 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 14 sudo apt-get install trac libapache2-svn 22 15 }}} 23 16 24 ... then ran the following commands to actually perform the update: 17 === 2. Create the Trac Envioronments Directory === 18 19 You'll need a directory for Trac's envioronments to live that should be writable by the default Apache user: 20 25 21 {{{ 26 sudo apt-get update27 sudo apt-get -y upgrade22 sudo mkdir /var/trac 23 sudo chown www-data:www-data /var/trac 28 24 }}} 29 25 30 You can take a nice long break while Hoary is downloaded and installed. 26 === 3. Setup Apache2 === 31 27 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. 28 Next, create a new Apache-2 virtualhost by saving the following as {{{/etc/apache2/sites-available/trac}}} : 33 29 34 We need to install a few more things:35 36 {{{37 sudo apt-get install trac38 sudo apt-get install libapache2-svn39 }}}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@localhost52 53 DocumentRoot /var/www/54 <Directory />55 Options FollowSymLinks56 AllowOverride None57 </Directory>58 <Directory /var/www/>59 Options Indexes FollowSymLinks MultiViews60 AllowOverride None61 Order allow,deny62 allow from all63 # This directive allows us to have apache2's default start page64 # in /apache2-default/, but still have / go to the right place65 # Commented out for Ubuntu66 #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 None73 # Options ExecCGI -MultiViews +SymLinksIfOwnerMatch74 # Order allow,deny75 # Allow from all76 # </Directory>77 ## ---END OF COMMENTS---78 79 ErrorLog /var/log/apache2/error.log80 81 # Possible values include: debug, info, notice, warn, error, crit,82 # alert, emerg.83 LogLevel warn84 85 CustomLog /var/log/apache2/access.log combined86 ServerSignature On87 88 Alias /doc/ "/usr/share/doc/"89 <Directory "/usr/share/doc/">90 Options Indexes MultiViews FollowSymLinks91 AllowOverride None92 Order deny,allow93 Deny from all94 Allow from 127.0.0.0/255.0.0.0 ::1/12895 </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 MultiViews106 AllowOverride None107 Order allow,deny108 Allow from all109 </Directory>110 111 # You need something like this to authenticate users112 <Location "/cgi-bin/trac.cgi/login">113 AuthType Basic114 AuthName "YourProjectNameHere"115 AuthUserFile /var/www/trac.htpasswd116 Require valid-user117 </Location>118 119 #SVN dir120 <Location /svn>121 DAV svn122 SVNParentPath /var/svn123 </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.133 30 {{{ 134 31 <VirtualHost *> … … 143 40 </Directory> 144 41 Alias /trac "/usr/share/trac/htdocs" 42 145 43 <Location /trac.cgi> 146 # You may need to customize this147 44 SetEnv TRAC_ENV "/var/trac" 148 45 </Location> … … 151 48 ErrorLog /var/log/apache2/error.trac.log 152 49 CustomLog /var/log/apache2/access.trac.log combined 153 154 50 </VirtualHost> 155 51 }}} 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 53 You also need to uncomment the {{{AddHandler}}} line in {{{/etc/apache2/apache2.conf}}} so that the Trac CGI program will be executed: 54 157 55 {{{ 158 56 # To use CGI scripts outside /cgi-bin/: … … 161 59 }}} 162 60 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. 61 Now, disable the default virtualhost, enable the Trac virtualhost, and restart Apache2: 62 63 {{{ 64 sudo a2ensite trac 65 sudo a2dissite default 66 sudo /etc/init.d/apache2 restart 67 }}} 68 69 This last step would differ if you were already serving other virtualhosts. 70 71 === 4. Creating Environments === 164 72 165 73 I installed my Subversion repository at {{{/var/svn/YourProjectNameHere}}}. So I did a quick starting config of subversion with the following commands: … … 213 121 ''Voila! Your Trac system & website should be up and running.'' 214 122 215 ---- 123 == Comments & Suggestions == 216 124 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.