Changes between Version 2 and Version 3 of Trac Install


Ignore:
Timestamp:
Dec 10, 2014, 10:01:01 PM (10 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Trac Install

    v2 v3  
    44Trac 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.
    55
    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]].
     6Since 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
     8If 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].
    99
    1010What 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.
     
    1818 * [http://www.python.org/ Python], version >= 2.5 and < 3.0
    1919   (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
    2222
    2323You also need a database system and the corresponding python bindings.
     
    2828As 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).
    2929
    30 However, if you'd like, you can download the latest and greatest version of [[trac:Pysqlite]] from
     30However, if you'd like, you can download the latest and greatest version of [[trac:PySqlite]] from
    3131[http://code.google.com/p/pysqlite/downloads/list google code], where you'll find the Windows
    3232installers or the `tar.gz` archive for building from source:
     
    4141SQLite 2.x is no longer supported.
    4242
    43 A known bug PySqlite versions 2.5.2-4 prohibits upgrade of trac databases
     43A known bug in PySqlite versions 2.5.2-4 prohibits upgrades of Trac databases
    4444from 0.11.x to 0.12. Please use versions 2.5.5 and newer or 2.5.1 and
    4545older. See #9434 for more detail.
     
    5151You need to install the database and its Python bindings:
    5252 * [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
    5454
    5555See [trac:DatabaseBackend#Postgresql DatabaseBackend] for details.
     
    8787A web server is optional because Trac is shipped with a server included, see the [#RunningtheStandaloneServer Running the Standalone Server ] section below.
    8888
    89 Alternatively you configure Trac to run in any of the following environments.
     89Alternatively you can configure Trac to run in any of the following environments.
    9090 * [http://httpd.apache.org/ Apache] with
    9191   - [http://code.google.com/p/modwsgi/ mod_wsgi], see [wiki:TracModWSGI] and
    9292     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)
    9494 * a [http://www.fastcgi.com/ FastCGI]-capable web server (see TracFastCgi)
    9595 * an [http://tomcat.apache.org/connectors-doc/ajp/ajpv13a.html AJP]-capable web
     
    105105 * [http://docutils.sourceforge.net/ docutils], version >= 0.3.9
    106106   for WikiRestructuredText.
    107  * [http://pygments.pocoo.org Pygments] for
     107 * [http://pygments.org Pygments] for
    108108   [wiki:TracSyntaxColoring syntax highlighting].
    109109   [http://silvercity.sourceforge.net/ SilverCity] and/or
     
    114114   an internal time zone implementation.
    115115
    116 '''Attention''': The various available versions of these dependencies are not necessarily interchangable, 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].
    117117
    118118Please 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!).
     
    122122=== Using `easy_install`
    123123One way to install Trac is using [http://pypi.python.org/pypi/setuptools setuptools].
    124 With setuptools you can install Trac from the subversion repository;
     124With setuptools you can install Trac from the Subversion repository;
    125125
    126126A few examples:
    127127
    128  - install Trac 1.0:
     128 - Install Trac 1.0:
    129129   {{{
    130130   easy_install Trac==1.0
    131131   }}}
    132    (NOT YET ENABLED)
    133  - install latest development version 1.0dev:
     132 - Install latest development version:
    134133   {{{
    135134   easy_install Trac==dev
     
    140139=== Using `pip`
    141140'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:
     141To get a Trac installation up and running in less than 5 minutes:
    143142
    144143Assuming you want to have your entire pip installation in `/opt/user/trac`
     
    146145 -
    147146{{{
    148 pip -E /opt/user/trac install trac psycopg2
     147pip install trac psycopg2
    149148}}}
    150149or
    151150 -
    152151{{{
    153 pip -E /opt/user/trac install trac mysql-python
    154 }}}
    155 
    156 Make sure your OS specific headers are available for pip to automatically build PostgreSQL (libpq-dev) or MySQL (libmysqlclient-dev) bindings.
     152pip install trac mysql-python
     153}}}
     154
     155Make sure your OS specific headers are available for pip to automatically build PostgreSQL (`libpq-dev`) or MySQL (`libmysqlclient-dev`) bindings.
    157156
    158157pip 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`.
     
    160159All 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)
    161160
    162 Additionally, you can install several trac plugins (listed [http://pypi.python.org/pypi?:action=search&term=trac&submit=search here]) through pip.
     161Additionally, you can install several Trac plugins (listed [http://pypi.python.org/pypi?:action=search&term=trac&submit=search here]) through pip.
    163162
    164163
     
    167166Of course, using the python-typical setup at the top of the source directory also works.
    168167
    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:SubversionRepository for details).
     168You 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).
    170169
    171170{{{
     
    175174''You'll need root permissions or equivalent for this step.''
    176175
    177 This will byte-compile the python source code and install it as an .egg file or folder in the `site-packages` directory
    178 of your Python installation. The .egg will also contain all other resources needed by standard Trac, such as htdocs and templates.
     176This will byte-compile the Python source code and install it as an .egg file or folder in the `site-packages` directory
     177of your Python installation. The .egg will also contain all other resources needed by standard Trac, such as `htdocs` and `templates`.
    179178
    180179The 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.
    181180
    182 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):
     181If 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):
    183182{{{
    184183$ python ./setup.py install
    185184}}}
    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`).
     185Alternatively, 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`).
    187186
    188187=== Advanced Options ===
     
    193192}}}
    194193
    195 Also see [http://docs.python.org/inst/inst.html Installing Python Modules] for detailed information.
     194Also see [http://docs.python.org/2/install/index.html Installing Python Modules] for detailed information.
    196195
    197196Specifically, you might be interested in:
     
    199198easy_install --prefix=/path/to/installdir
    200199}}}
    201 or, if installing Trac to a Mac OS X system:
     200or, if installing Trac on a Mac OS X system:
    202201{{{
    203202easy_install --prefix=/usr/local --install-dir=/Library/Python/2.5/site-packages
    204203}}}
    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
     204Note: 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.
    206205
    207206The 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.
     
    222221For the other [DatabaseBackend database backends] you should plan ahead and already have a database ready to use at this point.
    223222
    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.
     223Since 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.
    225224
    226225Also note that the values you specify here can be changed later by directly editing the [TracIni conf/trac.ini] configuration file.
    227226
     227When 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
    228229Finally, 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:
    229230{{{
    230 # chown -R apache.apache /path/to/myproject
    231 }}}
     231$ chown -R apache.apache /path/to/myproject
     232}}}
     233
     234The 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).
    232235
    233236{{{#!div class=important
     
    271274mv /tmp/deploy/* /usr/share/trac
    272275}}}
     276Don't forget to check that the web server has the execution right on scripts in the `/usr/share/trac/cgi-bin` directory.
    273277
    274278
     
    341345==== Setting up the Plugin Cache ====
    342346
    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_CACHE environment variable. Refer to your server documentation for detailed instructions on how to set environment variables.
     347Some 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.
    344348
    345349== Configuring Authentication ==
    346350
    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_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.
     351Trac 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.
    348352
    349353The process of adding, removing, and configuring user accounts for authentication depends on the specific way you run Trac.
     
    354358 * TracFastCgi if you're using another web server with FCGI support (Cherokee, Lighttpd, !LiteSpeed, nginx)
    355359
     360The following document also constains some useful information for beginners: [trac:TracAuthenticationIntroduction].
     361
    356362== Granting admin rights to the admin user
    357363Grant admin rights to user admin:
     
    359365$ trac-admin /path/to/myproject permission add admin TRAC_ADMIN
    360366}}}
    361 This user will have an "Admin" entry menu that will allow you to admin your trac project.
     367This user will have an "Admin" entry menu that will allow you to administrate your Trac project.
    362368
    363369== Finishing the install
     370
     371=== Enable version control components
     372
     373Support 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
     375The 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{{{
     378tracopt.versioncontrol.svn.* = enabled
     379}}}
     380
     381{{{
     382tracopt.versioncontrol.git.* = enabled
     383}}}
     384
     385After enabling the components, repositories can be configured through the "Repositories" admin panel or by editing [TracIni#repositories-section trac.ini].
    364386
    365387=== Automatic reference to the SVN changesets in Trac tickets ===