Changes between Version 6 and Version 7 of TracInstall
- Timestamp:
- Jun 20, 2020, 9:43:52 PM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracInstall
v6 v7 1 = Trac Installation Guide for 1. 11 = Trac Installation Guide for 1.2 2 2 [[TracGuideToc]] 3 3 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.orgGenshi] templating system.4 Trac is written in the Python programming language and needs a database, [https://sqlite.org/ SQLite], [https://www.postgresql.org/ PostgreSQL], or [https://www.mysql.com/ MySQL]. For HTML rendering, Trac uses the [https://genshi.edgewall.org/ Genshi] templating system. 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 * [http ://www.python.org/ Python], version >= 2.6 and < 3.018 * [https://www.python.org/ Python], version >= 2.6 and < 3.0 19 19 (note that we dropped the support for Python 2.5 in this release) 20 * [http ://pypi.python.org/pypi/setuptools setuptools], version >= 0.621 * [http ://genshi.edgewall.org/wiki/DownloadGenshi], version >= 0.620 * [https://pypi.org/project/setuptools setuptools], version >= 0.6 21 * [https://pypi.org/project/Genshi Genshi], version >= 0.6 22 22 23 23 You also need a database system and the corresponding python bindings. The database can be either SQLite, PostgreSQL or MySQL. … … 27 27 As you must be using Python 2.6 or 2.7, you already have the SQLite database bindings bundled with the standard distribution of Python (the `sqlite3` module). 28 28 29 Optionally, you may install a newer version of [http ://pypi.python.org/pypi/pysqlite pysqlite] than the one provided by the Python distribution. See [trac:PySqlite#ThePysqlite2bindings PySqlite] for details.29 Optionally, you may install a newer version of [https://pypi.org/project/pysqlite pysqlite] than the one provided by the Python distribution. See [trac:PySqlite#ThePysqlite2bindings PySqlite] for details. 30 30 31 31 ==== For the PostgreSQL database #ForPostgreSQL 32 32 33 33 You need to install the database and its Python bindings: 34 * [http ://www.postgresql.org/ PostgreSQL], version 8.0 or later35 * [http ://pypi.python.org/pypi/psycopg2 psycopg2], version 2.0 or later34 * [https://www.postgresql.org/ PostgreSQL], version 8.0 or later 35 * [https://pypi.org/project/psycopg2 psycopg2], version 2.0 or later 36 36 37 37 See [trac:DatabaseBackend#Postgresql DatabaseBackend] for details. … … 41 41 Trac works well with MySQL, provided you follow the guidelines: 42 42 43 * [http ://mysql.com/ MySQL], version 5.0 or later44 * [http ://sf.net/projects/mysql-python MySQLdb], version 1.2.2 or later43 * [https://www.mysql.com/ MySQL], version 5.0 or later 44 * [https://sf.net/projects/mysql-python MySQLdb], version 1.2.2 or later 45 45 46 46 Given the caveats and known issues surrounding MySQL, read carefully the [trac:MySqlDb] page before creating the database. … … 50 50 ==== Subversion 51 51 52 [http ://subversion.apache.org/ Subversion], 1.6.x or later and the '''''corresponding''''' Python bindings.53 54 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.)52 [https://subversion.apache.org/ Subversion], 1.6.x or later and the '''''corresponding''''' Python bindings. 53 54 There are [https://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 [https://alagazam.net Alagazam], which works for me under Python 2.6.) 55 55 56 56 For troubleshooting information, see the [trac:TracSubversion#Troubleshooting TracSubversion] page. … … 64 64 ==== Git 65 65 66 [http ://git-scm.com/ Git] 1.5.6 or later is supported. More information is available on the [trac:TracGit] page.66 [https://git-scm.com/ Git] 1.5.6 or later is supported. More information is available on the [trac:TracGit] page. 67 67 68 68 ==== Other Version Control Systems … … 74 74 75 75 Alternatively you can configure Trac to run in any of the following environments: 76 * [http://httpd.apache.org/ Apache] with 77 - [https://github.com/GrahamDumpleton/mod_wsgi mod_wsgi], see [wiki:TracModWSGI] and 78 [http://code.google.com/p/modwsgi/wiki/IntegrationWithTrac ModWSGI IntegrationWithTrac]. 79 - [http://modpython.org/ mod_python 3.5.0], see TracModPython 80 * a [http://www.fastcgi.com/ FastCGI]-capable web server (see TracFastCgi) 81 * an [http://tomcat.apache.org/connectors-doc/ajp/ajpv13a.html AJP]-capable web 76 * [https://httpd.apache.org/ Apache] with 77 * [https://github.com/GrahamDumpleton/mod_wsgi mod_wsgi], see [wiki:TracModWSGI] and [https://code.google.com/p/modwsgi/wiki/IntegrationWithTrac ModWSGI IntegrationWithTrac]. 78 * [http://modpython.org/ mod_python 3.5.0], see TracModPython 79 * a [https://fastcgi-archives.github.io/ FastCGI]-capable web server (see TracFastCgi) 80 * an [https://tomcat.apache.org/connectors-doc/ajp/ajpv13a.html AJP]-capable web 82 81 server (see [trac:TracOnWindowsIisAjp TracOnWindowsIisAjp]) 83 82 * Microsoft IIS with FastCGI and a FastCGI-to-WSGI gateway (see [trac:CookBook/Installation/TracOnWindowsIisWfastcgi IIS with FastCGI]) … … 111 110 112 111 === Using `easy_install` 113 Trac can be installed from PyPI or the Subversion repository using [http ://pypi.python.org/pypi/setuptools setuptools].112 Trac can be installed from PyPI or the Subversion repository using [https://pypi.org/project/setuptools setuptools]. 114 113 115 114 A few examples: … … 121 120 - Install latest development version: 122 121 {{{#!sh 123 $ easy_install http ://download.edgewall.org/trac/Trac-latest-dev.tar.gz122 $ easy_install https://download.edgewall.org/trac/Trac-latest-dev.tar.gz 124 123 }}} 125 124 Note that in this case you won't have the possibility to run a localized version of Trac; … … 138 137 Assuming you want to have your entire pip installation in `/opt/user/trac` 139 138 140 -141 139 {{{#!sh 142 pip install trac psycopg2140 $ pip install trac psycopg2 143 141 }}} 144 142 or 145 -146 143 {{{#!sh 147 pip install trac mysql-python144 $ pip install trac mysql-python 148 145 }}} 149 146 … … 186 183 To install Trac to a custom location, or find out about other advanced installation options, run: 187 184 {{{#!sh 188 easy_install --help189 }}} 190 191 Also see [http ://docs.python.org/2/install/index.html Installing Python Modules] for detailed information.185 $ easy_install --help 186 }}} 187 188 Also see [https://docs.python.org/2/install/index.html Installing Python Modules] for detailed information. 192 189 193 190 Specifically, you might be interested in: 194 191 {{{#!sh 195 easy_install --prefix=/path/to/installdir192 $ easy_install --prefix=/path/to/installdir 196 193 }}} 197 194 or, if installing Trac on a Mac OS X system: 198 195 {{{#!sh 199 easy_install --prefix=/usr/local --install-dir=/Library/Python/2.6/site-packages196 $ easy_install --prefix=/usr/local --install-dir=/Library/Python/2.6/site-packages 200 197 }}} 201 198 … … 215 212 }}} 216 213 217 [TracAdmin trac-admin] will prompt you for the information it needsto 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.214 You will be prompted for the information needed 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. 218 215 219 216 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. … … 274 271 - [wiki:TracModWSGI Apache with mod_wsgi] 275 272 - [TracModPython Apache with mod_python] 276 - //[TracCgi CGI](should not be used, as the performance is far from optimal)//277 278 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.273 - [TracCgi CGI] //(should not be used, as the performance is far from optimal)// 274 275 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], [https://uwsgi-docs.readthedocs.io/en/latest/#Traconapacheinasub-uri uwsgi], [trac:TracOnWindowsIisIsapi Isapi-wsgi] etc. 279 276 280 277 ==== Generating the Trac cgi-bin directory #cgi-bin 281 278 282 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]. 283 284 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: 285 {{{#!sh 286 mkdir -p /usr/share/trac/projects/my-project 287 trac-admin /usr/share/trac/projects/my-project initenv 288 trac-admin /usr/share/trac/projects/my-project deploy /tmp/deploy 289 mv /tmp/deploy/* /usr/share/trac 290 }}} 291 Don't forget to check that the web server has the execution right on scripts in the `/usr/share/trac/cgi-bin` directory. 279 Application scripts for CGI, FastCGI and mod-wsgi can be generated using the [TracAdmin trac-admin] `deploy` command: 280 [[TracAdminHelp(deploy)]] 281 282 Grant the web server execution right on scripts in the `cgi-bin` directory. 283 284 For example, the following yields a typical directory structure: 285 {{{#!sh 286 $ mkdir -p /var/trac 287 $ trac-admin /var/trac/<project> initenv 288 $ trac-admin /var/trac/<project> deploy /var/www 289 $ ls /var/www 290 cgi-bin htdocs 291 $ chmod ugo+x /var/www/cgi-bin/* 292 }}} 292 293 293 294 ==== Mapping Static Resources … … 295 296 Without additional configuration, Trac will handle requests for static resources such as stylesheets and images. For anything other than a TracStandalone deployment, this is not optimal as the web server can be set up to directly serve the static resources. For CGI setup, this is '''highly undesirable''' as it causes abysmal performance. 296 297 297 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 their location on the file system. We can map requests for static resources directly to directories on the file system, to avoid Trac processing the requests.298 Web servers such as [https://httpd.apache.org/ Apache] allow you to create //Aliases// to resources, giving them a virtual URL that doesn't necessarily reflect their location on the file system. We can map requests for static resources directly to directories on the file system, to avoid Trac processing the requests. 298 299 299 300 There are two primary URL paths for static resources: `/chrome/common` and `/chrome/site`. Plugins can add their own resources, usually accessible at the `/chrome/<plugin>` path. 300 301 301 A single `/chrome` alias can used if the static resources are extracted for all plugins. This means that the `deploy` command must be executed after installing or updating a plugin that provides static resources, or after modifying resources in the `$env/htdocs` directory. This is probably appropriate for most installations but may not be what you want if, for example, you wish to upload plugins through the //Plugins// administration page. 302 303 The resources are extracted using the [TracAdmin trac-admin]` <environment> deploy` command: 304 [[TracAdminHelp(deploy)]] 305 306 The target `<directory>` will contain an `htdocs` directory with: 302 A single `/chrome` alias can used if the static resources are extracted for all plugins. This means that the `deploy` command (discussed in the previous section) must be executed after installing or updating a plugin that provides static resources, or after modifying resources in the `$env/htdocs` directory. This is probably appropriate for most installations but may not be what you want if, for example, you wish to upload plugins through the //Plugins// administration page. 303 304 The `deploy` command creates an `htdocs` directory with: 307 305 - `common/` - the static resources of Trac 308 306 - `site/` - a copy of the environment's `htdocs/` directory … … 322 320 Assuming the deployment has been done this way: 323 321 {{{#!sh 324 $ trac-admin /var/trac/ env deploy /path/to/shared/trac322 $ trac-admin /var/trac/<project> deploy /var/www 325 323 }}} 326 324 … … 366 364 }}} 367 365 368 Another alternative to aliasing `/trac/chrome/common` is having Trac generate direct links for those static resources (and only those), using the [ [TracIni#trac-section| [trac] htdocs_location]] configuration setting:366 Another alternative to aliasing `/trac/chrome/common` is having Trac generate direct links for those static resources (and only those), using the [TracIni#trac-section htdocs_location] configuration setting: 369 367 {{{#!ini 370 368 [trac] … … 379 377 }}} 380 378 381 ==== Setting up the Plugin Cache 379 ==== Setting up the Plugin Cache #egg-cache 382 380 383 381 Some Python plugins need to be extracted to a cache directory. By default the cache resides in the home directory of the current user. When running Trac on a Web Server as a dedicated user (which is highly recommended) who has no home directory, this might prevent the plugins from starting. To override the cache location you can set the `PYTHON_EGG_CACHE` environment variable. Refer to your server documentation for detailed instructions on how to set environment variables. 382 383 If you setup hook scripts that call Trac, such as the Subversion post-commit hook script provided in the `/contrib` directory, make sure you define the `PYTHON_EGG_CACHE` environment variable within these scripts as well. 384 384 385 385 == Configuring Authentication