Changes between Version 11 and Version 12 of TracInstall
- Timestamp:
- 17/07/2015 11:41:28 (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracInstall
v11 v12 1 1 = Trac Installation Guide for 1.0 2 2 3 [[TracGuideToc]] 3 4 … … 13 14 14 15 == Dependencies 16 15 17 === Mandatory Dependencies 18 16 19 To install Trac, the following software packages must be installed: 17 20 … … 41 44 Trac works well with MySQL, provided you follow the guidelines: 42 45 43 * [http://mysql.com/ MySQL] , version 5.0 or later46 * [http://mysql.com/ MySQL] or [http://mariadb.org/ MariaDB], version 5.0 or later 44 47 * [http://sf.net/projects/mysql-python MySQLdb], version 1.2.2 or later 45 48 46 Given the caveats and known issues surrounding MySQL, read carefullythe [trac:MySqlDb] page before creating the database.49 Given the caveats and known issues surrounding MySQL, read the [trac:MySqlDb] page before creating the database. 47 50 48 51 === Optional Dependencies … … 51 54 52 55 ===== Subversion 53 * [http://subversion.apache.org/ Subversion], 1.5.x or later and the ''' ''corresponding''''' Python bindings. Older versions starting from 1.0, like 1.2.4, 1.3.2 or 1.4.2, etc. may still work. For troubleshooting information, check the [trac:TracSubversion#Troubleshooting TracSubversion] page.56 * [http://subversion.apache.org/ Subversion], 1.5.x or later and the '''corresponding''' Python bindings. Older versions starting from 1.0, like 1.2.4, 1.3.2 or 1.4.2, etc. may still work. For troubleshooting information, check the [trac:TracSubversion#Troubleshooting TracSubversion] page. 54 57 55 58 There are [http://subversion.apache.org/packages.html pre-compiled SWIG bindings] available for various platforms. (Good luck finding precompiled SWIG bindings for any Windows package at that listing. [trac:TracSubversion] points you to [http://alagazam.net Alagazam], which works for me under Python 2.6.) … … 57 60 Note that Trac '''doesn't''' use [http://pysvn.tigris.org/ PySVN], neither does it work yet with the newer `ctype`-style bindings. 58 61 59 ''' Please note:''' if using Subversion, Trac must be installed on the '''same machine'''. Remote repositories are currently [trac:ticket:493 not supported].62 '''Note:''' if using Subversion, Trac must be installed on the '''same machine'''. Remote repositories are currently [trac:ticket:493 not supported]. 60 63 61 64 ===== Git … … 69 72 70 73 ==== Web Server 71 A web server is optional because Trac is shipped with a server included, see the [#RunningtheStandaloneServer Running the Standalone Server] section below. 74 75 A web server is optional because Trac has a server included, see the [#RunningtheStandaloneServer Running the Standalone Server] section below. 72 76 73 77 Alternatively you can configure Trac to run in any of the following environments: … … 80 84 server (see [trac:TracOnWindowsIisAjp TracOnWindowsIisAjp]) 81 85 * a FastCGI and FastCGI-to-WSGI gateway (see [trac:TracOnWindowsIisWfastcgi]) 82 * a CGI-capable web server (see TracCgi), '''butusage of Trac as a cgi script83 is highly discouraged ''', better use one of the previous options.86 * a CGI-capable web server (see TracCgi), but //usage of Trac as a cgi script 87 is highly discouraged//, better use one of the previous options. 84 88 85 86 89 ==== Other Python Packages 87 90 … … 103 106 }}} 104 107 105 Please refer to the documentation of these packages to find out how they are best installed. In addition, most of the [trac:TracInstallPlatforms platform-specific instructions] also describe the installation of the dependencies. Keep in mind however that the information there ''probably concern older versions of Trac than the one you're installing''.108 Please refer to the documentation of these packages to find out how they are best installed. In addition, most of the [trac:TracInstallPlatforms platform-specific instructions] also describe the installation of the dependencies. Keep in mind however that the information there probably concern older versions of Trac than the one you're installing. 106 109 107 110 == Installing Trac … … 110 113 111 114 === Using `easy_install` 112 Trac can be installed from PyPI or the Subversion repository using [http://pypi.python.org/pypi/setuptools setuptools]. 113 114 A few examples: 115 116 Trac can be installed from [https://pypi.python.org/pypi/Trac PyPI] or the Subversion repository using [pypi:setuptools setuptools]. 117 118 A few command-line examples: 115 119 116 120 - Install Trac 1.0: 117 118 119 121 {{{#!sh 122 $ easy_install Trac==1.0 123 }}} 120 124 - Install latest development version: 121 122 123 125 {{{#!sh 126 $ easy_install Trac==dev 127 }}} 124 128 Note that in this case you won't have the possibility to run a localized version of Trac; 125 either use a released version or install from source 129 either use a released version or install from source. 126 130 127 131 More information can be found on the [trac:setuptools] page. … … 132 136 133 137 === Using `pip` 134 'pip' is an easy_install replacement that is very useful to quickly install python packages. 138 139 'pip' is an easy_install replacement that is very useful to quickly install Python packages. 135 140 To get a Trac installation up and running in less than 5 minutes: 136 141 137 Assuming you want to have your entire pip installation in `/opt/user/trac` 142 Assuming you want to have your entire pip installation in `/opt/user/trac`: 138 143 139 144 - 140 145 {{{#!sh 141 pip install trac psycopg2142 }}} 143 or 146 $ pip install trac psycopg2 147 }}} 148 or: 144 149 - 145 150 {{{#!sh 146 pip install trac mysql-python151 $ pip install trac mysql-python 147 152 }}} 148 153 … … 151 156 pip will automatically resolve all dependencies (like Genshi, pygments, etc.), download the latest packages from pypi.python.org and create a self contained installation in `/opt/user/trac`. 152 157 153 All commands (`tracd`, `trac-admin`) are available in `/opt/user/trac/bin`. This can also be leveraged for `mod_python` (using `PythonHandler` directive) and `mod_wsgi` (using `WSGIDaemonProcess` directive) 158 All commands (`tracd`, `trac-admin`) are available in `/opt/user/trac/bin`. This can also be leveraged for `mod_python` (using `PythonHandler` directive) and `mod_wsgi` (using `WSGIDaemonProcess` directive). 154 159 155 160 Additionally, you can install several Trac plugins (listed [https://pypi.python.org/pypi?:action=browse&show=all&c=516 here]) through pip. 156 161 157 162 === From source 163 158 164 Using the python-typical setup at the top of the source directory also works. You can obtain the source for a .tar.gz or .zip file corresponding to a release (e.g. `Trac-1.0.tar.gz`) from the [trac:TracDownload] page, or you can get the source directly from the repository. See [trac:TracRepositories#OfficialSubversionrepository TracRepositories] for details. 159 165 … … 162 168 }}} 163 169 164 ''You will need root permissions or equivalent for this step.'' 170 You will need root permissions or equivalent for this step. 165 171 166 172 This will byte-compile the Python source code and install it as an .egg file or folder in the `site-packages` directory … … 171 177 $ python ./setup.py install 172 178 }}} 179 173 180 Alternatively, you can run `bdist_egg` and copy the .egg from `dist/` to the place of your choice, or you can create a Windows installer (`bdist_wininst`). 174 181 … … 185 192 To install Trac to a custom location, or find out about other advanced installation options, run: 186 193 {{{#!sh 187 easy_install --help194 $ easy_install --help 188 195 }}} 189 196 … … 192 199 Specifically, you might be interested in: 193 200 {{{#!sh 194 easy_install --prefix=/path/to/installdir 195 }}} 201 $ easy_install --prefix=/path/to/installdir 202 }}} 203 196 204 or, if installing Trac on a Mac OS X system: 197 205 {{{#!sh 198 easy_install --prefix=/usr/local --install-dir=/Library/Python/2.5/site-packages 199 }}} 200 Note: If installing on Mac OS X 10.6 running {{{ easy_install http://svn.edgewall.org/repos/trac/trunk }}} will install into {{{ /usr/local }}} and {{{ /Library/Python/2.5/site-packages }}} by default. 206 $ easy_install --prefix=/usr/local --install-dir=/Library/Python/2.5/site-packages 207 }}} 208 209 '''Note''': If installing on Mac OS X 10.6 running {{{ easy_install http://svn.edgewall.org/repos/trac/trunk }}} will install into {{{ /usr/local }}} and {{{ /Library/Python/2.5/site-packages }}} by default. 201 210 202 211 The above will place your `tracd` and `trac-admin` commands into `/usr/local/bin` and will install the Trac libraries and dependencies into `/Library/Python/2.5/site-packages`, which is Apple's preferred location for third-party Python application installations. … … 221 230 222 231 {{{#!div style="border: 1pt dotted; margin: 1em" 223 **Filesystem Warning:** When selecting the location of your environment, make sure that the filesystem on which the environment directory resides supports sub-second timestamps (i.e. **not** `ext2` or `ext3` on Linux ), as the modification time of the `conf/trac.ini` file will be monitored to decide whether an environment restart is needed or not. A too coarse-grained timestamp resolution may result in inconsistencies in Trac < 1.0.2. The best advice is to opt for a platform with sub-second timestamp resolution, regardless of the Trac version.232 **Filesystem Warning:** When selecting the location of your environment, make sure that the filesystem on which the environment directory resides supports sub-second timestamps (i.e. **not** `ext2` or `ext3` on Linux, or HFS+ on OSX), as the modification time of the `conf/trac.ini` file will be monitored to decide whether an environment restart is needed or not. A too coarse-grained timestamp resolution may result in inconsistencies in Trac < 1.0.2. The best advice is to opt for a platform with sub-second timestamp resolution, regardless of the Trac version. 224 233 }}} 225 234 … … 229 238 }}} 230 239 231 The actual username and groupname of the apache server may not be exactly `apache`, and are specified in the Apache configuration file by the directives `User` and `Group` (if Apache `httpd` is what you use).240 The actual username and groupname of the Apache server may not be exactly `apache`, and are specified in the Apache configuration file by the directives `User` and `Group` (if Apache `httpd` is what you use). 232 241 233 242 {{{#!div class=important … … 269 278 - [wiki:TracModWSGI mod_wsgi] 270 279 - [TracModPython mod_python] 271 - //[TracCgi CGI] (should not be used, as the performance is far from optimal)//280 - //[TracCgi CGI]: should not be used, as it degrades performance// 272 281 273 282 Trac also supports [trac:TracOnWindowsIisAjp AJP] which may be your choice if you want to connect to IIS. Other deployment scenarios are possible: [trac:TracNginxRecipe nginx], [http://projects.unbit.it/uwsgi/wiki/Example#Traconapacheinasub-uri uwsgi], [trac:TracOnWindowsIisIsapi Isapi-wsgi] etc. … … 279 288 There is, however, a bit of a chicken-and-egg problem. The [TracAdmin trac-admin] command requires an existing environment to function, but complains if the deploy directory already exists. This is a problem, because environments are often stored in a subdirectory of the deploy. The solution is to do something like this: 280 289 {{{#!sh 281 mkdir -p /usr/share/trac/projects/my-project 282 trac-admin /usr/share/trac/projects/my-project initenv 283 trac-admin /usr/share/trac/projects/my-project deploy /tmp/deploy 284 mv /tmp/deploy/* /usr/share/trac 285 }}} 290 $ mkdir -p /usr/share/trac/projects/my-project 291 $ trac-admin /usr/share/trac/projects/my-project initenv 292 $ trac-admin /usr/share/trac/projects/my-project deploy /tmp/deploy 293 $ mv /tmp/deploy/* /usr/share/trac 294 }}} 295 286 296 Don't forget to check that the web server has the execution right on scripts in the `/usr/share/trac/cgi-bin` directory. 287 297 288 298 ==== Mapping Static Resources 289 299 290 Out of the box, Trac will pass static resources such as style sheets or images through itself. For anything but a tracd only based deployment, this is far from optimal as the web server could be set up to directly serve those static resources (for CGI setup, this is '''highly undesirable''' and will cause abysmal performance).291 292 Web servers such as [http://httpd.apache.org/ Apache] allow you to create “Aliases”to resources, giving them a virtual URL that doesn't necessarily reflect the layout of the servers file system. We also can map requests for static resources directly to the directory on the file system, avoiding processing these requests by Trac itself.300 Out of the box, Trac will pass static resources such as style sheets or images through itself. For anything but a tracd only based deployment, this is far from optimal as the web server could be set up to directly serve those static resources. For CGI setup, this is '''highly undesirable''' as it causes abysmal performance. 301 302 Web servers such as [http://httpd.apache.org/ Apache] allow you to create "Aliases" to resources, giving them a virtual URL that doesn't necessarily reflect the layout of the servers file system. We also can map requests for static resources directly to the directory on the file system, avoiding processing these requests by Trac itself. 293 303 294 304 There are two primary URL paths for static resources - `/chrome/common` and `/chrome/site`. Plugins can add their own resources, usually accessible by `/chrome/<plugin>` path, so its important to override only known paths and not try to make universal `/chrome` alias for everything. … … 320 330 }}} 321 331 322 If using mod_python, you might want to add this too (otherwise, the alias will be ignored):332 If using mod_python, you might want to add this too, otherwise the alias will be ignored: 323 333 {{{#!apache 324 334 <Location "/trac/chrome/common/"> … … 344 354 htdocs_location = http://static.example.org/trac-common/ 345 355 }}} 346 Note that this makes it easy to have a dedicated domain serve those static resources (preferentially [http://code.google.com/speed/page-speed/docs/request.html#ServeFromCookielessDomain cookie-less]). 356 357 Note that this makes it easy to have a dedicated domain serve those static resources, preferentially [http://code.google.com/speed/page-speed/docs/request.html#ServeFromCookielessDomain cookie-less]. 347 358 348 359 Of course, you still need to make the Trac `htdocs/common` directory available through the web server at the specified URL, for example by copying (or linking) the directory into the document root of the web server: … … 364 375 * TracStandalone#UsingAuthentication if you use the standalone server, `tracd`. 365 376 * [wiki:TracModWSGI#ConfiguringAuthentication TracModWSGI#ConfiguringAuthentication] if you use the Apache web server, with any of its front end: `mod_wsgi` of course, but the same instructions applies also for `mod_python`, `mod_fcgi` or `mod_fastcgi`. 366 * TracFastCgi if you 're using another web server with FCGI support (Cherokee, Lighttpd, !LiteSpeed, nginx)377 * TracFastCgi if you are using another web server with FCGI support, such as Cherokee, Lighttpd, !LiteSpeed, nginx. 367 378 368 379 The following document also contains some useful information for beginners: [trac:TracAuthenticationIntroduction]. 369 380 370 381 == Granting admin rights to the admin user 382 371 383 Grant admin rights to user admin: 372 384 {{{#!sh 373 385 $ trac-admin /path/to/myproject permission add admin TRAC_ADMIN 374 386 }}} 387 375 388 This user will have an "Admin" entry menu that will allow you to administrate your Trac project. 376 389 … … 381 394 Support for version control systems is provided by optional components in Trac and the components are disabled by default //(since 1.0)//. Subversion and Git must be explicitly enabled if you wish to use them. See TracRepositoryAdmin for more details. 382 395 383 The version control systems are enabled by adding the following to the `[components]` section of your [TracIni#components-section trac.ini], or enabling the components in the "Plugins" admin panel .396 The version control systems are enabled by adding the following to the `[components]` section of your [TracIni#components-section trac.ini], or enabling the components in the "Plugins" admin panel: 384 397 385 398 {{{#!ini 399 [components] 386 400 tracopt.versioncontrol.svn.* = enabled 387 401 }}} 388 402 389 403 {{{#!ini 404 [components] 390 405 tracopt.versioncontrol.git.* = enabled 391 406 }}}