Edgewall Software

Changes between Version 53 and Version 54 of TracEnvironment


Ignore:
Timestamp:
Oct 23, 2014, 7:33:53 AM (10 years ago)
Author:
Ryan J Ollos
Comment:

New-style markup.

Legend:

Unmodified
Added
Removed
Modified
  • TracEnvironment

    v53 v54  
    11** Note: this page documents the 1.0 version of Trac, see [[0.12/TracEnvironment]] if you need the previous version **
    2 = The Trac Environment =
     2= The Trac Environment
    33
    44Trac uses a directory structure and a database for storing project data. The directory is referred to as the “environment”.
    55
    6 == Creating an Environment ==
     6== Creating an Environment
    77
    88A new Trac environment is created using  [TracAdmin#initenv trac-admin's initenv]:
    9 {{{
     9{{{#!sh
    1010$ trac-admin /path/to/myproject initenv
    1111}}}
     
    3131 - TracPlugins located in a [TracIni#inherit-section shared plugins folder] that is defined in an [TracIni#GlobalConfiguration inherited configuration] are currently not loaded during creation, and hence, if they need to create extra tables for example, you'll need to [TracUpgrade#UpgradetheTracEnvironment upgrade the environment] before being able to use it.
    3232
    33 == Database Connection Strings ==
     33== Database Connection Strings
    3434
    3535Since version 0.9, Trac supports both [http://sqlite.org/ SQLite] and
     
    4242Note that if the username or password of the connection string (if applicable) contains the `:`, `/` or `@` characters, they need to be URL encoded.
    4343
    44 === SQLite Connection String ===
     44=== SQLite Connection String
    4545The connection string for an SQLite database is:
    4646{{{
     
    4949where `db/trac.db` is the path to the database file within the Trac environment.
    5050
    51 === PostgreSQL Connection String ===
     51=== PostgreSQL Connection String
    5252If you want to use PostgreSQL or MySQL instead, you'll have to use a
    5353different connection string. For example, to connect to a PostgreSQL
     
    7878See the [http://www.postgresql.org/docs/ PostgreSQL documentation] for detailed instructions on how to administer [http://postgresql.org PostgreSQL].
    7979Generally, the following is sufficient to create a database user named `tracuser`, and a database named `trac`.
    80 {{{
    81 createuser -U postgres -E -P tracuser
    82 createdb -U postgres -O tracuser -E UTF8 trac
     80{{{#!sh
     81$ createuser -U postgres -E -P tracuser
     82$ createdb -U postgres -O tracuser -E UTF8 trac
    8383}}}
    8484When running `createuser` you will be prompted for the password for the user 'tracuser'. This new user will not be a superuser, will not be allowed to create other databases and will not be allowed to create other roles. These privileges are not needed to run a trac instance. If no password is desired for the user, simply remove the `-P` and `-E` options from the `createuser` command.  Also note that the database should be created as UTF8. LATIN1 encoding causes errors trac's use of unicode in trac.  SQL_ASCII also seems to work.
    8585
    8686Under some default configurations (debian) one will have run the `createuser` and `createdb` scripts as the `postgres` user.  For example:
    87 {{{
    88 sudo su - postgres -c 'createuser -U postgres -S -D -R -E -P tracuser'
    89 sudo su - postgres -c 'createdb -U postgres -O tracuser -E UTF8 trac'
     87{{{#!sh
     88$ sudo su - postgres -c 'createuser -U postgres -S -D -R -E -P tracuser'
     89$ sudo su - postgres -c 'createdb -U postgres -O tracuser -E UTF8 trac'
    9090}}}
    9191
     
    9595}}}
    9696
    97 === MySQL Connection String ===
     97=== MySQL Connection String
    9898
    9999The format of the MySQL connection string is similar to the examples presented for PostgreSQL, with the `postgres` schema being replaced by `mysql`. For example, to connect to a MySQL
     
    104104}}}
    105105
    106 == Source Code Repository ==
     106== Source Code Repository
    107107
    108108Since version 0.12, a single Trac environment can be connected to more than one repository. There are many different ways to connect repositories to an environment, see TracRepositoryAdmin. This page also details the various attributes that can be set for a repository (like `type`, `url`, `description`).
     
    110110In Trac 0.12 `trac-admin` no longer asks questions related to repositories. Therefore, by default Trac is not connected to any source code repository, and the ''Browse Source'' toolbar item will not be displayed.
    111111You can also explicitly disable the `trac.versioncontrol.*` components (which are otherwise still loaded)
    112 {{{
     112{{{#!ini
    113113[components]
    114114trac.versioncontrol.* = disabled
     
    121121
    122122Example of a configuration for a Subversion repository used as the default repository:
    123 {{{
     123{{{#!ini
    124124[trac]
    125125repository_type = svn
     
    128128
    129129The configuration for a scoped Subversion repository would be:
    130 {{{
     130{{{#!ini
    131131[trac]
    132132repository_type = svn
     
    134134}}}
    135135
    136 == Directory Structure ==
     136== Directory Structure
    137137
    138138An environment directory will usually consist of the following files and directories: