Changes between Version 4 and Version 5 of TracInstall
- Timestamp:
- 25/03/2015 10:37:46 (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracInstall
v4 v5 1 {{{#!div style="margin-top: .5em; padding: 0 1em; background-color: #ffd; border:1px outset #ddc; text-align: center"2 3 '''NOTE: the information in this page applies to Trac 1.0, the current version of Trac. \\4 For installing previous Trac versions, please refer to [[wiki:0.12/TracInstall]] (for Trac 0.12)'''5 }}}6 7 1 = Trac Installation Guide for 1.0 8 2 [[TracGuideToc]] … … 10 4 Trac is written in the Python programming language and needs a database, [http://sqlite.org/ SQLite], [http://www.postgresql.org/ PostgreSQL], or [http://mysql.com/ MySQL]. For HTML rendering, Trac uses the [http://genshi.edgewall.org Genshi] templating system. 11 5 12 Since version 0.12, Trac can also be localized, and there 's probably a translation available for your language. If you want to be able to use the Trac interface in other languages, then make sure you have installed the optional package [#OtherPythonPackages Babel]. Pay attention to the extra steps for localization support in the [#InstallingTrac Installing Trac] section below. Lacking Babel, you will only get the default English version, as usual.13 14 If you're interested in contributing new translations for other languages or enhanc ethe existing translations, then please have a look at [trac:wiki:TracL10N TracL10N].15 16 What follows are generic instructions for installing and setting up Trac and its requirements. While you may find instructions for installing Trac on specific systems at [trac:TracInstallPlatforms TracInstallPlatforms] on the main Trac site, please be sure to'''first read through these general instructions''' to get a good understanding of the tasks involved.6 Since version 0.12, Trac can also be localized, and there is probably a translation available in your language. If you want to use the Trac interface in other languages, then make sure you have installed the optional package [#OtherPythonPackages Babel]. Pay attention to the extra steps for localization support in the [#InstallingTrac Installing Trac] section below. Lacking Babel, you will only get the default English version. 7 8 If you're interested in contributing new translations for other languages or enhancing the existing translations, then please have a look at [trac:wiki:TracL10N TracL10N]. 9 10 What follows are generic instructions for installing and setting up Trac. While you may find instructions for installing Trac on specific systems at [trac:TracInstallPlatforms TracInstallPlatforms] on the main Trac site, please '''first read through these general instructions''' to get a good understanding of the tasks involved. 17 11 18 12 [[PageOutline(2-3,Installation Steps,inline)]] … … 24 18 * [http://www.python.org/ Python], version >= 2.5 and < 3.0 25 19 (note that we dropped the support for Python 2.4 in this release) 26 * [http://p eak.telecommunity.com/DevCenter/setuptools setuptools], version >= 0.620 * [http://pypi.python.org/pypi/setuptools setuptools], version >= 0.6 27 21 * [http://genshi.edgewall.org/wiki/Download Genshi], version >= 0.6 28 22 29 You also need a database system and the corresponding python bindings. 30 The database can be either SQLite, PostgreSQL or MySQL. 23 You also need a database system and the corresponding python bindings. The database can be either SQLite, PostgreSQL or MySQL. 31 24 32 25 ==== For the SQLite database #ForSQLite 33 26 34 As you must be using Python 2.5, 2.6 or 2.7, you already have the SQLite database bindings bundled with the standard distribution of Python (the `sqlite3` module). 35 36 However, if you'd like, you can download the latest and greatest version of [[trac:PySqlite]] from 37 [http://code.google.com/p/pysqlite/downloads/list google code], where you'll find the Windows 38 installers or the `tar.gz` archive for building from source: 39 {{{#!sh 40 $ tar xvfz <version>.tar.gz 41 $ cd <version> 42 $ python setup.py build_static install 43 }}} 44 45 This will download the latest SQLite code and build the bindings. 46 47 SQLite 2.x is no longer supported. 48 49 A known bug in PySqlite versions 2.5.2-4 prohibits upgrades of Trac databases 50 from 0.11.x to 0.12. Please use versions 2.5.5 and newer or 2.5.1 and 51 older. See #9434 for more detail. 52 53 See additional information in [trac:PySqlite PySqlite]. 27 As you must be using Python 2.5, 2.6 or 2.7, you already have the SQLite database bindings bundled with the standard distribution of Python: the `sqlite3` module. 28 29 Optionally, you may install a newer version of [pypi:pysqlite pysqlite] than the one provided by the Python distribution. See [trac:PySqlite#ThePysqlite2bindings PySqlite] for details. 54 30 55 31 ==== For the PostgreSQL database #ForPostgreSQL … … 61 37 See [trac:DatabaseBackend#Postgresql DatabaseBackend] for details. 62 38 63 64 39 ==== For the MySQL database #ForMySQL 65 40 66 Trac can now work quite well with MySQL, provided you follow the guidelines.41 Trac works well with MySQL, provided you follow the guidelines: 67 42 68 43 * [http://mysql.com/ MySQL], version 5.0 or later 69 44 * [http://sf.net/projects/mysql-python MySQLdb], version 1.2.2 or later 70 45 71 It is '''very''' important to read carefully the[trac:MySqlDb] page before creating the database.46 Given the caveats and known issues surrounding MySQL, read carefully the [trac:MySqlDb] page before creating the database. 72 47 73 48 === Optional Dependencies … … 76 51 77 52 ===== Subversion 78 * [http://subversion.apache.org/ Subversion], 1.5.x or 1.6.x and the '''''corresponding''''' Python bindings. Older versions starting from 1.0, like 1.2.4, 1.3.2 or 1.4.2, etc. shouldstill work. For troubleshooting information, check the [trac:TracSubversion#Troubleshooting TracSubversion] page.79 80 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. TracSubversion points you to [http://alagazam.net Algazam], which works for me under Python 2.6.)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. 54 55 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.) 81 56 82 57 Note that Trac '''doesn't''' use [http://pysvn.tigris.org/ PySVN], neither does it work yet with the newer `ctype`-style bindings. 83 58 84 85 59 '''Please note:''' if using Subversion, Trac must be installed on the '''same machine'''. Remote repositories are currently [trac:ticket:493 not supported]. 86 60 61 ===== Git 62 * [http://git-scm.com/ Git] 1.5.6 or later. 63 64 More information is available on the [trac:TracGit] page. 87 65 88 66 ===== Others 89 67 90 Support for other version control systems is provided via third-parties. See [trac:PluginList ] and [trac:VersionControlSystem].68 Support for other version control systems is provided via third-parties. See [trac:PluginList#VersionControlSystems] and [trac:VersionControlSystem]. 91 69 92 70 ==== Web Server 93 71 A web server is optional because Trac is shipped with a server included, see the [#RunningtheStandaloneServer Running the Standalone Server] section below. 94 72 95 Alternatively you can configure Trac to run in any of the following environments .73 Alternatively you can configure Trac to run in any of the following environments: 96 74 * [http://httpd.apache.org/ Apache] with 97 75 - [http://code.google.com/p/modwsgi/ mod_wsgi], see [wiki:TracModWSGI] and 98 76 http://code.google.com/p/modwsgi/wiki/IntegrationWithTrac 99 - [http://modpython.org/ mod_python 3. 3.1], (deprecated: see TracModPython)77 - [http://modpython.org/ mod_python 3.5.0], see TracModPython 100 78 * a [http://www.fastcgi.com/ FastCGI]-capable web server (see TracFastCgi) 101 79 * an [http://tomcat.apache.org/connectors-doc/ajp/ajpv13a.html AJP]-capable web 102 80 server (see [trac:TracOnWindowsIisAjp TracOnWindowsIisAjp]) 81 * a FastCGI and FastCGI-to-WSGI gateway (see [trac:TracOnWindowsIisWfastcgi]) 103 82 * a CGI-capable web server (see TracCgi), '''but usage of Trac as a cgi script 104 83 is highly discouraged''', better use one of the previous options. … … 107 86 ==== Other Python Packages 108 87 109 * [http://babel.edgewall.org Babel], version >= 0.9.5,110 needed for localization support (unreleased version 1.0dev should work as well)88 * [http://babel.edgewall.org Babel], version 0.9.5, 0.9.6 or >= 1.3 89 needed for localization support 111 90 * [http://docutils.sourceforge.net/ docutils], version >= 0.3.9 112 91 for WikiRestructuredText. 113 92 * [http://pygments.org Pygments] for 114 [ wiki:TracSyntaxColoring syntax highlighting].93 [TracSyntaxColoring syntax highlighting]. 115 94 [http://silvercity.sourceforge.net/ SilverCity] and/or 116 95 [http://gnu.org/software/enscript/enscript.html Enscript] may still be used … … 120 99 an internal time zone implementation. 121 100 122 '''Attention''': The various available versions of these dependencies are not necessarily interchangeable, so please pay attention to the version numbers above. If you are having trouble getting Trac to work please double-check all the dependencies before asking for help on the [trac:MailingList] or [trac:IrcChannel]. 123 124 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'' (there are even some pages that are still talking about Trac 0.8!). 125 101 {{{#!div style="border: 1pt dotted; margin: 1em" 102 **Attention**: The available versions of these dependencies are not necessarily interchangeable, so please pay attention to the version numbers. If you are having trouble getting Trac to work, please double-check all the dependencies before asking for help on the [trac:MailingList] or [trac:IrcChannel]. 103 }}} 104 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''. 126 106 127 107 == Installing Trac 108 109 The [TracAdmin trac-admin] command-line tool, used to create and maintain [TracEnvironment project environments], as well as the [TracStandalone tracd] standalone server are installed along with Trac. There are several methods for installing Trac. 110 128 111 === Using `easy_install` 129 One way to install Trac is using [http://pypi.python.org/pypi/setuptools setuptools]. 130 With setuptools you can install Trac from the Subversion repository; 112 Trac can be installed from PyPI or the Subversion repository using [http://pypi.python.org/pypi/setuptools setuptools]. 131 113 132 114 A few examples: … … 143 125 either use a released version or install from source 144 126 127 More information can be found on the [trac:setuptools] page. 128 145 129 {{{#!div style="border: 1pt dotted; margin: 1em" 146 130 **Setuptools Warning:** If the version of your setuptools is in the range 5.4 through 5.6, the environment variable `PKG_RESOURCES_CACHE_ZIP_MANIFESTS` must be set in order to avoid significant performance degradation. More information may be found in the sections on [#RunningtheStandaloneServer Running The Standalone Server] and [#RunningTraconaWebServer Running Trac on a Web Server]. … … 165 149 Make sure your OS specific headers are available for pip to automatically build PostgreSQL (`libpq-dev`) or MySQL (`libmysqlclient-dev`) bindings. 166 150 167 pip will automatically resolve all dependencies (like Genshi, pygments, etc.) and download the latest packages onpypi.python.org and create a self contained installation in `/opt/user/trac`.151 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`. 168 152 169 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) 170 154 171 Additionally, you can install several Trac plugins (listed [http://pypi.python.org/pypi?:action=search&term=trac&submit=search here]) through pip. 172 173 155 Additionally, you can install several Trac plugins (listed [https://pypi.python.org/pypi?:action=browse&show=all&c=516 here]) through pip. 174 156 175 157 === From source 176 Of course, using the python-typical setup at the top of the source directory also works. 177 178 You can obtain the source for a .tar.gz or .zip file corresponding to a release (e.g. `Trac-1.0.tar.gz`), or you can get the source directly from the repository (see [trac:SubversionRepository] for details). 158 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. 179 159 180 160 {{{#!sh … … 182 162 }}} 183 163 184 ''You 'll need root permissions or equivalent for this step.''164 ''You will need root permissions or equivalent for this step.'' 185 165 186 166 This will byte-compile the Python source code and install it as an .egg file or folder in the `site-packages` directory 187 167 of your Python installation. The .egg will also contain all other resources needed by standard Trac, such as `htdocs` and `templates`. 188 168 189 The script will also install the [wiki:TracAdmin trac-admin] command-line tool, used to create and maintain [wiki:TracEnvironment project environments], as well as the [wiki:TracStandalone tracd] standalone server.190 191 169 If you install from source and want to make Trac available in other languages, make sure Babel is installed. Only then, perform the `install` (or simply redo the `install` once again afterwards if you realize Babel was not yet installed): 192 170 {{{#!sh … … 195 173 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`). 196 174 197 === Advanced Options 175 === Using installer 176 177 On Windows Trac can be installed using the exe installers available on the [trac:TracDownload] page. Installers are available for the 32 and 64 bit versions of Python. Make sure to use the installer that matches the architecture of your Python installation. 178 179 === Using package manager 180 181 Trac may be available in the package repository for your platform. Note however, that the version provided by the package manager may not be the latest release. 182 183 === Advanced `easy_install` Options 198 184 199 185 To install Trac to a custom location, or find out about other advanced installation options, run: … … 212 198 easy_install --prefix=/usr/local --install-dir=/Library/Python/2.5/site-packages 213 199 }}} 214 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. 6/site-packages }}} by default.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. 215 201 216 202 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. 217 203 218 219 204 == Creating a Project Environment 220 205 221 A [TracEnvironment Trac environment] is the backend storage where Trac stores information like wiki pages, tickets, reports, settings, etc. An environment is basically a directory that contains a human-readable [TracIni configuration file], and variousother files and directories.222 223 A new environment is created using [ wiki:TracAdmin trac-admin]:206 A [TracEnvironment Trac environment] is the backend where Trac stores information like wiki pages, tickets, reports, settings, etc. An environment is basically a directory that contains a human-readable [TracIni configuration file], and other files and directories. 207 208 A new environment is created using [TracAdmin trac-admin]: 224 209 {{{#!sh 225 210 $ trac-admin /path/to/myproject initenv … … 229 214 230 215 Using the default database connection string in particular will always work as long as you have SQLite installed. 231 For the other [ DatabaseBackend database backends] you should plan ahead and already have a database ready to use at this point.216 For the other [trac:DatabaseBackend database backends] you should plan ahead and already have a database ready to use at this point. 232 217 233 218 Since 0.12, Trac doesn't ask for a [TracEnvironment#SourceCodeRepository source code repository] anymore when creating an environment. Repositories can be [TracRepositoryAdmin added] afterwards, and support for specific version control systems is disabled by default. … … 235 220 Also note that the values you specify here can be changed later by directly editing the [TracIni conf/trac.ini] configuration file. 236 221 237 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 (though the best advice is to opt for a platform with sub-second timestamp resolution when possible regardless of the version of Trac you are running). 222 {{{#!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. 224 }}} 238 225 239 226 Finally, make sure the user account under which the web front-end runs will have '''write permissions''' to the environment directory and all the files inside. This will be the case if you run `trac-admin ... initenv` as this user. If not, you should set the correct user afterwards. For example on Linux, with the web server running as user `apache` and group `apache`, enter: … … 248 235 }}} 249 236 250 251 237 == Deploying Trac 252 238 253 239 === Running the Standalone Server 254 240 255 After having created a Trac environment, you can easily try the web interface by running the standalone server [ wiki:TracStandalone tracd]:241 After having created a Trac environment, you can easily try the web interface by running the standalone server [TracStandalone tracd]: 256 242 {{{#!sh 257 243 $ tracd --port 8000 /path/to/myproject … … 280 266 281 267 Trac provides various options for connecting to a "real" web server: 282 - [ wiki:TracFastCgi FastCGI]268 - [TracFastCgi FastCGI] 283 269 - [wiki:TracModWSGI mod_wsgi] 284 - //[wiki:TracModPython mod_python] (no longer recommended, as mod_python is not actively maintained anymore)//285 - //[ wiki:TracCgi CGI] (should not be used, as the performance is far from optimal)//270 - [TracModPython mod_python] 271 - //[TracCgi CGI] (should not be used, as the performance is far from optimal)// 286 272 287 273 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. … … 289 275 ==== Generating the Trac cgi-bin directory #cgi-bin 290 276 291 In order for Trac to function properly with FastCGI you need to have a `trac.fcgi` file and for mod_wsgi a `trac.wsgi` file. These are Python scripts which load the appropriate Python code. They can be generated using the `deploy` option of [ wiki:TracAdmin trac-admin].292 293 There is, however, a bit of a chicken-and-egg problem. The [ wiki: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:277 In order for Trac to function properly with FastCGI you need to have a `trac.fcgi` file and for mod_wsgi a `trac.wsgi` file. These are Python scripts which load the appropriate Python code. They can be generated using the `deploy` option of [TracAdmin trac-admin]. 278 279 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: 294 280 {{{#!sh 295 281 mkdir -p /usr/share/trac/projects/my-project … … 300 286 Don't forget to check that the web server has the execution right on scripts in the `/usr/share/trac/cgi-bin` directory. 301 287 302 303 288 ==== Mapping Static Resources 304 289 … … 321 306 Assuming the deployment has been done this way: 322 307 {{{#!sh 323 $ trac-admin /var/trac/env deploy /path/to/ trac/htdocs/common308 $ trac-admin /var/trac/env deploy /path/to/shared/trac 324 309 }}} 325 310 … … 354 339 }}} 355 340 356 Alternatively to aliasing `/trac/chrome/common`, you can tell Trac to generate direct links for those static resources (and only those), using the [[ wiki:TracIni#trac-section| [trac] htdocs_location]] configuration setting:341 Alternatively to aliasing `/trac/chrome/common`, you can tell Trac to generate direct links for those static resources (and only those), using the [[TracIni#trac-section| [trac] htdocs_location]] configuration setting: 357 342 {{{#!ini 358 343 [trac] … … 365 350 $ ln -s /path/to/trac/htdocs/common /var/www/static.example.org/trac-common 366 351 }}} 367 368 352 369 353 ==== Setting up the Plugin Cache … … 382 366 * TracFastCgi if you're using another web server with FCGI support (Cherokee, Lighttpd, !LiteSpeed, nginx) 383 367 384 The following document also con stains some useful information for beginners: [trac:TracAuthenticationIntroduction].368 The following document also contains some useful information for beginners: [trac:TracAuthenticationIntroduction]. 385 369 386 370 == Granting admin rights to the admin user … … 397 381 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. 398 382 399 The components can be 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.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. 400 384 401 385 {{{#!ini … … 407 391 }}} 408 392 409 After enabling the components, repositories can be configured through the "Repositories" admin panel or by editing [TracIni#repositories-section trac.ini]. 410 411 === Automatic reference to the SVN changesets in Trac tickets 412 413 You can configure SVN to automatically add a reference to the changeset into the ticket comments, whenever changes are committed to the repository. The description of the commit needs to contain one of the following formulas: 414 * '''`Refs #123`''' - to reference this changeset in `#123` ticket 415 * '''`Fixes #123`''' - to reference this changeset and close `#123` ticket with the default status ''fixed'' 416 417 This functionality requires a post-commit hook to be installed as described in [wiki:TracRepositoryAdmin#ExplicitSync TracRepositoryAdmin], and enabling the optional commit updater components by adding the following line to the `[components]` section of your [wiki:TracIni#components-section trac.ini], or enabling the components in the "Plugins" admin panel. 418 {{{#!ini 419 tracopt.ticket.commit_updater.* = enabled 420 }}} 421 For more information, see the documentation of the `CommitTicketUpdater` component in the "Plugins" admin panel. 393 After enabling the components, repositories can be configured through the //Repositories// admin panel or by editing [TracIni#repositories-section trac.ini]. Automatic changeset references can be inserted as ticket comments by configuring [TracRepositoryAdmin#Automaticchangesetreferencesintickets CommitTicketUpdater]. 422 394 423 395 === Using Trac … … 425 397 Once you have your Trac site up and running, you should be able to create tickets, view the timeline, browse your version control repository if configured, etc. 426 398 427 Keep in mind that //anonymous// (not logged in) users can by default access only a few of the features, in particular they will have a read-only access to the resources. You will need to configure authentication and grant additional [ wiki:TracPermissions permissions] to authenticated users to see the full set of features.399 Keep in mind that //anonymous// (not logged in) users can by default access only a few of the features, in particular they will have a read-only access to the resources. You will need to configure authentication and grant additional [TracPermissions permissions] to authenticated users to see the full set of features. 428 400 429 401 '' Enjoy! ''