Changes between Version 53 and Version 54 of TracEnvironment
- Timestamp:
- Oct 23, 2014, 7:33:53 AM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracEnvironment
v53 v54 1 1 ** 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 3 3 4 4 Trac uses a directory structure and a database for storing project data. The directory is referred to as the “environment”. 5 5 6 == Creating an Environment ==6 == Creating an Environment 7 7 8 8 A new Trac environment is created using [TracAdmin#initenv trac-admin's initenv]: 9 {{{ 9 {{{#!sh 10 10 $ trac-admin /path/to/myproject initenv 11 11 }}} … … 31 31 - 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. 32 32 33 == Database Connection Strings ==33 == Database Connection Strings 34 34 35 35 Since version 0.9, Trac supports both [http://sqlite.org/ SQLite] and … … 42 42 Note that if the username or password of the connection string (if applicable) contains the `:`, `/` or `@` characters, they need to be URL encoded. 43 43 44 === SQLite Connection String ===44 === SQLite Connection String 45 45 The connection string for an SQLite database is: 46 46 {{{ … … 49 49 where `db/trac.db` is the path to the database file within the Trac environment. 50 50 51 === PostgreSQL Connection String ===51 === PostgreSQL Connection String 52 52 If you want to use PostgreSQL or MySQL instead, you'll have to use a 53 53 different connection string. For example, to connect to a PostgreSQL … … 78 78 See the [http://www.postgresql.org/docs/ PostgreSQL documentation] for detailed instructions on how to administer [http://postgresql.org PostgreSQL]. 79 79 Generally, the following is sufficient to create a database user named `tracuser`, and a database named `trac`. 80 {{{ 81 createuser -U postgres -E -P tracuser82 createdb -U postgres -O tracuser -E UTF8 trac80 {{{#!sh 81 $ createuser -U postgres -E -P tracuser 82 $ createdb -U postgres -O tracuser -E UTF8 trac 83 83 }}} 84 84 When 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. 85 85 86 86 Under 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' 90 90 }}} 91 91 … … 95 95 }}} 96 96 97 === MySQL Connection String ===97 === MySQL Connection String 98 98 99 99 The 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 … … 104 104 }}} 105 105 106 == Source Code Repository ==106 == Source Code Repository 107 107 108 108 Since 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`). … … 110 110 In 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. 111 111 You can also explicitly disable the `trac.versioncontrol.*` components (which are otherwise still loaded) 112 {{{ 112 {{{#!ini 113 113 [components] 114 114 trac.versioncontrol.* = disabled … … 121 121 122 122 Example of a configuration for a Subversion repository used as the default repository: 123 {{{ 123 {{{#!ini 124 124 [trac] 125 125 repository_type = svn … … 128 128 129 129 The configuration for a scoped Subversion repository would be: 130 {{{ 130 {{{#!ini 131 131 [trac] 132 132 repository_type = svn … … 134 134 }}} 135 135 136 == Directory Structure ==136 == Directory Structure 137 137 138 138 An environment directory will usually consist of the following files and directories: