Changes between Version 2 and Version 3 of Trac Install
- Timestamp:
- Dec 10, 2014, 10:01:01 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Trac Install
v2 v3 4 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. 5 5 6 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.7 8 If you're interested in contributing new translations for other languages or enhance the existing translations, then please have a look at [ [trac:TracL10N]].6 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. 7 8 If you're interested in contributing new translations for other languages or enhance the existing translations, then please have a look at [trac:wiki:TracL10N TracL10N]. 9 9 10 10 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. … … 18 18 * [http://www.python.org/ Python], version >= 2.5 and < 3.0 19 19 (note that we dropped the support for Python 2.4 in this release) 20 * [http://peak.telecommunity.com/DevCenter/setuptools setuptools], version >= 0.6 , or better yet, [http://pypi.python.org/pypi/distribute distribute]21 * [http://genshi.edgewall.org/wiki/Download Genshi], version >= 0.6 (unreleased version 0.7dev should work as well)20 * [http://peak.telecommunity.com/DevCenter/setuptools setuptools], version >= 0.6 21 * [http://genshi.edgewall.org/wiki/Download Genshi], version >= 0.6 22 22 23 23 You also need a database system and the corresponding python bindings. … … 28 28 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). 29 29 30 However, if you'd like, you can download the latest and greatest version of [[trac:Py sqlite]] from30 However, if you'd like, you can download the latest and greatest version of [[trac:PySqlite]] from 31 31 [http://code.google.com/p/pysqlite/downloads/list google code], where you'll find the Windows 32 32 installers or the `tar.gz` archive for building from source: … … 41 41 SQLite 2.x is no longer supported. 42 42 43 A known bug PySqlite versions 2.5.2-4 prohibits upgrade of trac databases43 A known bug in PySqlite versions 2.5.2-4 prohibits upgrades of Trac databases 44 44 from 0.11.x to 0.12. Please use versions 2.5.5 and newer or 2.5.1 and 45 45 older. See #9434 for more detail. … … 51 51 You need to install the database and its Python bindings: 52 52 * [http://www.postgresql.org/ PostgreSQL], version 8.0 or later 53 * [http://pypi.python.org/pypi/psycopg2 psycopg2] 53 * [http://pypi.python.org/pypi/psycopg2 psycopg2], version 2.0 or later 54 54 55 55 See [trac:DatabaseBackend#Postgresql DatabaseBackend] for details. … … 87 87 A web server is optional because Trac is shipped with a server included, see the [#RunningtheStandaloneServer Running the Standalone Server ] section below. 88 88 89 Alternatively you c onfigure Trac to run in any of the following environments.89 Alternatively you can configure Trac to run in any of the following environments. 90 90 * [http://httpd.apache.org/ Apache] with 91 91 - [http://code.google.com/p/modwsgi/ mod_wsgi], see [wiki:TracModWSGI] and 92 92 http://code.google.com/p/modwsgi/wiki/IntegrationWithTrac 93 - [http://modpython.org/ mod_python 3.3.1], deprecated: see TracModPython)93 - [http://modpython.org/ mod_python 3.3.1], (deprecated: see TracModPython) 94 94 * a [http://www.fastcgi.com/ FastCGI]-capable web server (see TracFastCgi) 95 95 * an [http://tomcat.apache.org/connectors-doc/ajp/ajpv13a.html AJP]-capable web … … 105 105 * [http://docutils.sourceforge.net/ docutils], version >= 0.3.9 106 106 for WikiRestructuredText. 107 * [http://pygments. pocoo.org Pygments] for107 * [http://pygments.org Pygments] for 108 108 [wiki:TracSyntaxColoring syntax highlighting]. 109 109 [http://silvercity.sourceforge.net/ SilverCity] and/or … … 114 114 an internal time zone implementation. 115 115 116 '''Attention''': The various available versions of these dependencies are not necessarily interchang able, 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].116 '''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]. 117 117 118 118 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!). … … 122 122 === Using `easy_install` 123 123 One way to install Trac is using [http://pypi.python.org/pypi/setuptools setuptools]. 124 With setuptools you can install Trac from the subversion repository;124 With setuptools you can install Trac from the Subversion repository; 125 125 126 126 A few examples: 127 127 128 - install Trac 1.0:128 - Install Trac 1.0: 129 129 {{{ 130 130 easy_install Trac==1.0 131 131 }}} 132 (NOT YET ENABLED) 133 - install latest development version 1.0dev: 132 - Install latest development version: 134 133 {{{ 135 134 easy_install Trac==dev … … 140 139 === Using `pip` 141 140 'pip' is an easy_install replacement that is very useful to quickly install python packages. 142 To get a trac installation up and running in less than 5 minutes:141 To get a Trac installation up and running in less than 5 minutes: 143 142 144 143 Assuming you want to have your entire pip installation in `/opt/user/trac` … … 146 145 - 147 146 {{{ 148 pip -E /opt/user/tracinstall trac psycopg2147 pip install trac psycopg2 149 148 }}} 150 149 or 151 150 - 152 151 {{{ 153 pip -E /opt/user/tracinstall trac mysql-python154 }}} 155 156 Make sure your OS specific headers are available for pip to automatically build PostgreSQL ( libpq-dev) or MySQL (libmysqlclient-dev) bindings.152 pip install trac mysql-python 153 }}} 154 155 Make sure your OS specific headers are available for pip to automatically build PostgreSQL (`libpq-dev`) or MySQL (`libmysqlclient-dev`) bindings. 157 156 158 157 pip will automatically resolve all dependencies (like Genshi, pygments, etc.) and download the latest packages on pypi.python.org and create a self contained installation in `/opt/user/trac`. … … 160 159 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) 161 160 162 Additionally, you can install several trac plugins (listed [http://pypi.python.org/pypi?:action=search&term=trac&submit=search here]) through pip.161 Additionally, you can install several Trac plugins (listed [http://pypi.python.org/pypi?:action=search&term=trac&submit=search here]) through pip. 163 162 164 163 … … 167 166 Of course, using the python-typical setup at the top of the source directory also works. 168 167 169 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:SubversionRepositoryfor details).168 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). 170 169 171 170 {{{ … … 175 174 ''You'll need root permissions or equivalent for this step.'' 176 175 177 This will byte-compile the python source code and install it as an .egg file or folder in the `site-packages` directory178 of your Python installation. The .egg will also contain all other resources needed by standard Trac, such as htdocs and templates.176 This will byte-compile the Python source code and install it as an .egg file or folder in the `site-packages` directory 177 of your Python installation. The .egg will also contain all other resources needed by standard Trac, such as `htdocs` and `templates`. 179 178 180 179 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. 181 180 182 If you install from source and want to make Trac available in other languages, make sure 181 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): 183 182 {{{ 184 183 $ python ./setup.py install 185 184 }}} 186 Alternatively, you can do a `bdist_egg` and copy the .egg from dist/to the place of your choice, or you can create a Windows installer (`bdist_wininst`).185 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`). 187 186 188 187 === Advanced Options === … … 193 192 }}} 194 193 195 Also see [http://docs.python.org/ inst/inst.html Installing Python Modules] for detailed information.194 Also see [http://docs.python.org/2/install/index.html Installing Python Modules] for detailed information. 196 195 197 196 Specifically, you might be interested in: … … 199 198 easy_install --prefix=/path/to/installdir 200 199 }}} 201 or, if installing Trac toa Mac OS X system:200 or, if installing Trac on a Mac OS X system: 202 201 {{{ 203 202 easy_install --prefix=/usr/local --install-dir=/Library/Python/2.5/site-packages 204 203 }}} 205 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 204 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. 206 205 207 206 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. … … 222 221 For the other [DatabaseBackend database backends] you should plan ahead and already have a database ready to use at this point. 223 222 224 Since 0.12, Trac doesn't ask for a [TracEnvironment#SourceCodeRepository source code repository] anymore when creating an environment. Repositories can be [TracRepositoryAdmin added] afterward , or the version control support can be disabled completely if you don't need it.223 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. 225 224 226 225 Also note that the values you specify here can be changed later by directly editing the [TracIni conf/trac.ini] configuration file. 227 226 227 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). 228 228 229 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: 229 230 {{{ 230 # chown -R apache.apache /path/to/myproject 231 }}} 231 $ chown -R apache.apache /path/to/myproject 232 }}} 233 234 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 235 233 236 {{{#!div class=important … … 271 274 mv /tmp/deploy/* /usr/share/trac 272 275 }}} 276 Don't forget to check that the web server has the execution right on scripts in the `/usr/share/trac/cgi-bin` directory. 273 277 274 278 … … 341 345 ==== Setting up the Plugin Cache ==== 342 346 343 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_CACHEenvironment variable. Refer to your server documentation for detailed instructions on how to set environment variables.347 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. 344 348 345 349 == Configuring Authentication == 346 350 347 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_USERvariable 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.351 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. 348 352 349 353 The process of adding, removing, and configuring user accounts for authentication depends on the specific way you run Trac. … … 354 358 * TracFastCgi if you're using another web server with FCGI support (Cherokee, Lighttpd, !LiteSpeed, nginx) 355 359 360 The following document also constains some useful information for beginners: [trac:TracAuthenticationIntroduction]. 361 356 362 == Granting admin rights to the admin user 357 363 Grant admin rights to user admin: … … 359 365 $ trac-admin /path/to/myproject permission add admin TRAC_ADMIN 360 366 }}} 361 This user will have an "Admin" entry menu that will allow you to admin your trac project.367 This user will have an "Admin" entry menu that will allow you to administrate your Trac project. 362 368 363 369 == Finishing the install 370 371 === Enable version control components 372 373 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. 374 375 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. 376 377 {{{ 378 tracopt.versioncontrol.svn.* = enabled 379 }}} 380 381 {{{ 382 tracopt.versioncontrol.git.* = enabled 383 }}} 384 385 After enabling the components, repositories can be configured through the "Repositories" admin panel or by editing [TracIni#repositories-section trac.ini]. 364 386 365 387 === Automatic reference to the SVN changesets in Trac tickets ===