close
Warning:
Can't synchronize with repository "(default)" (The repository directory has changed, you should resynchronize the repository with: trac-admin $ENV repository resync '(default)'). Look in the Trac log for more information.
- Timestamp:
-
2021-07-11T14:17:48-07:00 (4 years ago)
- Author:
-
trac
- Comment:
-
--
Legend:
- Unmodified
- Added
- Removed
- Modified
-
|
v5
|
v6
|
|
| 1 | | = Trac Installation Guide for 1.3 |
| | 1 | = Trac Installation Guide for 1.5 |
| 2 | 2 | [[TracGuideToc]] |
| 3 | 3 | |
| 4 | | Trac is written in the Python programming language and needs a database, [https://sqlite.org/ SQLite], [https://www.postgresql.org/ PostgreSQL], or [https://mysql.com/ MySQL]. For HTML rendering, Trac uses the [http://jinja.pocoo.org Jinja2] templating system, though Genshi templates will still be supported until at least Trac 1.5.1. |
| | 4 | Trac is written in the Python programming language and needs a database, [https://sqlite.org/ SQLite], [https://www.postgresql.org/ PostgreSQL], or [https://mysql.com/ MySQL]. For HTML rendering, Trac uses the [http://jinja.pocoo.org Jinja2] templating system, though Genshi templates are supported until Trac 1.5.1. |
| 5 | 5 | |
| 6 | 6 | 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. |
| … |
… |
|
| 16 | 16 | To install Trac, the following software packages must be installed: |
| 17 | 17 | |
| 18 | | * [https://www.python.org/ Python], version >= 2.7 and < 3.0 |
| 19 | | (note that we dropped the support for Python 2.6 in this release) |
| 20 | | * [https://pypi.org/project/setuptools setuptools], version >= 0.6 |
| | 18 | * [https://www.python.org/ Python], version >= 3.5 |
| | 19 | * [https://pypi.org/project/setuptools setuptools], version > 5.6 |
| 21 | 20 | * [https://pypi.org/project/Jinja2 Jinja2], version >= 2.9.3 |
| 22 | | |
| 23 | | {{{#!div style="border: 1pt dotted; margin: 1em" |
| 24 | | **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 [#DeployingTrac Deploying Trac]. |
| 25 | | }}} |
| 26 | 21 | |
| 27 | 22 | You also need a database system and the corresponding python bindings. The database can be either SQLite, PostgreSQL or MySQL. |
| … |
… |
|
| 37 | 32 | You need to install the database and its Python bindings: |
| 38 | 33 | * [https://www.postgresql.org/ PostgreSQL], version 9.1 or later |
| 39 | | * [https://pypi.org/project/psycopg2 psycopg2], version 2.0 or later |
| | 34 | * [https://pypi.org/project/psycopg2 psycopg2], version 2.5 or later |
| 40 | 35 | |
| 41 | 36 | See [trac:DatabaseBackend#Postgresql DatabaseBackend] for details. |
| … |
… |
|
| 54 | 49 | ==== Subversion |
| 55 | 50 | |
| 56 | | [https://subversion.apache.org/ Subversion], 1.6.x or later and the '''''corresponding''''' Python bindings. |
| | 51 | [https://subversion.apache.org/ Subversion], 1.14.x or later and the '''''corresponding''''' Python bindings. |
| 57 | 52 | |
| 58 | 53 | There are [https://subversion.apache.org/packages.html pre-compiled SWIG bindings] available for various platforms. See [trac:TracSubversion#GettingSubversion getting Subversion] for more information. |
| … |
… |
|
| 78 | 73 | |
| 79 | 74 | Alternatively you can configure Trac to run in any of the following environments: |
| 80 | | * [https://httpd.apache.org/ Apache] with |
| 81 | | - [https://github.com/GrahamDumpleton/mod_wsgi mod_wsgi], see [wiki:TracModWSGI] and |
| | 75 | * [https://httpd.apache.org/ Apache] with |
| | 76 | - [https://github.com/GrahamDumpleton/mod_wsgi mod_wsgi], see [wiki:TracModWSGI] and |
| 82 | 77 | [https://code.google.com/p/modwsgi/wiki/IntegrationWithTrac ModWSGI IntegrationWithTrac]. |
| 83 | 78 | - [http://modpython.org/ mod_python 3.5.0], see TracModPython |
| … |
… |
|
| 86 | 81 | server (see [trac:TracOnWindowsIisAjp TracOnWindowsIisAjp]) |
| 87 | 82 | * Microsoft IIS with FastCGI and a FastCGI-to-WSGI gateway (see [trac:CookBook/Installation/TracOnWindowsIisWfastcgi IIS with FastCGI]) |
| 88 | | * a CGI-capable web server (see TracCgi), '''but usage of Trac as a cgi script |
| 89 | | is highly discouraged''', better use one of the previous options. |
| 90 | | |
| | 83 | * a CGI-capable web server (see TracCgi), '''but usage of Trac as a cgi script |
| | 84 | is highly discouraged''', better use one of the previous options. |
| | 85 | |
| 91 | 86 | |
| 92 | 87 | ==== Other Python Packages |
| 93 | 88 | |
| 94 | | * [http://babel.pocoo.org Babel], version 0.9.6 or >= 1.3, |
| | 89 | * [http://babel.pocoo.org Babel], version >= 2.2, |
| 95 | 90 | needed for localization support |
| 96 | | * [http://docutils.sourceforge.net docutils], version >= 0.3.9 |
| 97 | | for WikiRestructuredText. |
| 98 | | * [http://pygments.org Pygments] for |
| 99 | | [TracSyntaxColoring syntax highlighting]. |
| 100 | | * [https://pypi.org/project/textile Textile] for rendering the [https://github.com/textile/python-textile Textile markup language]. |
| 101 | 91 | * [http://pytz.sourceforge.net pytz] to get a complete list of time zones, |
| 102 | | otherwise Trac will fall back on a shorter list from |
| 103 | | an internal time zone implementation. |
| | 92 | otherwise Trac will fall back on a shorter list from |
| | 93 | an internal time zone implementation. Installing Babel |
| | 94 | will install pytz. |
| | 95 | * [http://docutils.sourceforge.net docutils], |
| | 96 | version >= 0.14, for WikiRestructuredText. |
| | 97 | * [http://pygments.org Pygments], version >= 1.0, |
| | 98 | for [TracSyntaxColoring syntax highlighting]. |
| | 99 | * [https://pypi.org/project/textile Textile], |
| | 100 | version >= 2.3, |
| | 101 | for rendering the [https://github.com/textile/python-textile Textile markup language]. |
| 104 | 102 | * [https://pypi.org/project/passlib passlib] on Windows to decode [TracStandalone#BasicAuthorization:Usingahtpasswdpasswordfile htpasswd formats] other than `SHA-1`. |
| 105 | 103 | * [https://pypi.org/project/pyreadline pyreadline] on Windows for trac-admin [TracAdmin#InteractiveMode command completion]. |
| … |
… |
|
| 118 | 116 | |
| 119 | 117 | === Using `pip` |
| 120 | | `pip` is the modern Python package manager and is included in Python 2.7.9 and later. Use [https://bootstrap.pypa.io/get-pip.py get-pip.py] to install `pip` for an earlier version of Python. |
| 121 | | |
| 122 | | {{{#!sh |
| 123 | | $ pip install Trac |
| 124 | | }}} |
| 125 | | |
| 126 | | `pip` will automatically resolve the //required// dependencies (Jinja2 and setuptools) and download the latest packages from pypi.org. |
| | 118 | `pip` is the modern Python package manager and is included in Python distributions. `pip` will automatically |
| | 119 | resolve the //required// dependencies (Jinja2 and |
| | 120 | setuptools) and download the latest packages from pypi.org. |
| 127 | 121 | |
| 128 | 122 | You can also install directly from a source package. You can obtain the source in a tar or zip from the [trac:TracDownload] page. After extracting the archive, change to the directory containing `setup.py` and run: |
| … |
… |
|
| 142 | 136 | $ pip install https://download.edgewall.org/trac/Trac-latest-dev.tar.gz |
| 143 | 137 | }}} |
| 144 | | * Install the unreleased 1.2-stable from subversion: |
| | 138 | * Install the unreleased 1.4-stable from subversion: |
| 145 | 139 | {{{#!sh |
| 146 | 140 | $ pip install svn+https://svn.edgewall.org/repos/trac/branches/1.2-stable |
| … |
… |
|
| 153 | 147 | The optional dependencies can be installed from PyPI using `pip`: |
| 154 | 148 | {{{#!sh |
| 155 | | $ pip install babel docutils pygments pytz textile |
| 156 | | }}} |
| | 149 | $ pip install babel docutils pygments textile |
| | 150 | }}} |
| | 151 | |
| | 152 | The optional dependencies can alternatively be |
| | 153 | specified using the `extras` keys in the setup file: |
| | 154 | {{{#!sh |
| | 155 | $ pip install Trac[babel,rest,pygments,textile] |
| | 156 | }}} |
| | 157 | |
| | 158 | `rest` is the extra that installs the `docutils` |
| | 159 | dependency. |
| | 160 | |
| | 161 | Include `mysql` or `psycopg2-binary` in the |
| | 162 | list if using the MySQL or PostgreSQL database. |
| 157 | 163 | |
| 158 | 164 | Additionally, you can install several Trac plugins from PyPI (listed [https://pypi.org/search/?c=Framework+%3A%3A+Trac here]) using pip. See TracPlugins for more information. |
| … |
… |
|
| 175 | 181 | }}} |
| 176 | 182 | |
| 177 | | [TracAdmin trac-admin] will prompt you for the information it needs to create the environment: the name of the project and the [TracEnvironment#DatabaseConnectionStrings database connection string]. If you're not sure what to specify for any of these options, just press `<Enter>` to use the default value. |
| | 183 | [TracAdmin trac-admin] will prompt you for the information it needs to create the environment: the name of the project and the [TracEnvironment#DatabaseConnectionStrings database connection string]. If you're not sure what to specify for any of these options, just press `<Enter>` to use the default value. |
| 178 | 184 | |
| 179 | 185 | Using the default database connection string will always work as long as you have SQLite installed. For the other [trac:DatabaseBackend database backends] you should plan ahead and already have a database ready to use at this point. |
| … |
… |
|
| 194 | 200 | == Deploying Trac |
| 195 | 201 | |
| 196 | | {{{#!div style="border: 1pt dotted; margin: 1em" |
| 197 | | **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. |
| 198 | | |
| 199 | | If running `tracd`, the environment variable can be set system-wide or for just the user that runs the `tracd` process. There are several ways to accomplish this in addition to what is discussed here, and depending on the distribution of your OS. |
| 200 | | |
| 201 | | To be effective system-wide a shell script with the `export` statement may be added to `/etc/profile.d`. To be effective for a user session the `export` statement may be added to `~/.profile`. |
| 202 | | {{{#!sh |
| 203 | | export PKG_RESOURCES_CACHE_ZIP_MANIFESTS=1 |
| 204 | | }}} |
| 205 | | |
| 206 | | Alternatively, the variable can be set in the shell before executing `tracd`: |
| 207 | | {{{#!sh |
| 208 | | $ PKG_RESOURCES_CACHE_ZIP_MANIFESTS=1 tracd --port 8000 /path/to/myproject |
| 209 | | }}} |
| 210 | | |
| 211 | | If running the Apache web server, !Ubuntu/Debian users should add the `export` statement to `/etc/apache2/envvars`. !RedHat/CentOS/Fedora should can add the `export` statement to `/etc/sysconfig/httpd`. |
| 212 | | }}} |
| 213 | | |
| 214 | 202 | === Running the Standalone Server |
| 215 | 203 | |
| … |
… |
|
| 226 | 214 | === Running Trac on a Web Server |
| 227 | 215 | |
| 228 | | Trac provides various options for connecting to a "real" web server: |
| | 216 | Trac provides various options for connecting to a "real" web server: |
| 229 | 217 | - [TracFastCgi FastCGI] |
| 230 | | - [wiki:TracModWSGI Apache with mod_wsgi] |
| | 218 | - [wiki:TracModWSGI Apache with mod_wsgi] |
| 231 | 219 | - [TracModPython Apache with mod_python] |
| 232 | 220 | - [TracCgi CGI] //(should not be used, as the performance is far from optimal)// |
| … |
… |
|
| 344 | 332 | Trac uses HTTP authentication. You'll need to configure your webserver to request authentication when the `.../login` URL is hit (the virtual path of the "login" button). Trac will automatically pick the `REMOTE_USER` variable up after you provide your credentials. Therefore, all user management goes through your web server configuration. Please consult the documentation of your web server for more info. |
| 345 | 333 | |
| 346 | | The process of adding, removing, and configuring user accounts for authentication depends on the specific way you run Trac. |
| | 334 | The process of adding, removing, and configuring user accounts for authentication depends on the specific way you run Trac. |
| 347 | 335 | |
| 348 | 336 | Please refer to one of the following sections: |