Changes between Version 376 and Version 377 of TracInstall
- Timestamp:
- Aug 24, 2014, 1:48:40 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracInstall
v376 v377 1 {{{ 2 #!div style="margin-top: .5em; padding: 0 1em; background-color: #ffd; border:1px outset #ddc; text-align: center" 1 {{{#!div style="margin-top: .5em; padding: 0 1em; background-color: #ffd; border:1px outset #ddc; text-align: center" 3 2 4 3 '''NOTE: the information in this page applies to Trac 1.0, the current version of Trac. \\ 5 4 For installing previous Trac versions, please refer to [[wiki:0.12/TracInstall]] (for Trac 0.12)''' 6 5 }}} 7 = Trac Installation Guide for 1.0 = 6 7 = Trac Installation Guide for 1.0 8 8 [[TracGuideToc]] 9 9 [[TranslatedPages]] … … 19 19 [[PageOutline(2-3,Installation Steps,inline)]] 20 20 21 == Dependencies ==21 == Dependencies 22 22 === Mandatory Dependencies 23 23 To install Trac, the following software packages must be installed: … … 38 38 [http://code.google.com/p/pysqlite/downloads/list google code], where you'll find the Windows 39 39 installers or the `tar.gz` archive for building from source: 40 {{{ 40 {{{#!sh 41 41 $ tar xvfz <version>.tar.gz 42 42 $ cd <version> … … 74 74 === Optional Dependencies 75 75 76 ==== Version Control System ====77 78 ===== Subversion =====76 ==== Version Control System 77 78 ===== Subversion 79 79 * [http://subversion.apache.org/ Subversion], 1.5.x or 1.6.x and the '''''corresponding''''' Python bindings. Older versions starting from 1.0, like 1.2.4, 1.3.2 or 1.4.2, etc. should still work. For troubleshooting information, check the [trac:TracSubversion#Troubleshooting TracSubversion] page. 80 80 … … 87 87 88 88 89 ===== Others =====89 ===== Others 90 90 91 91 Support for other version control systems is provided via third-parties. See [trac:PluginList] and [trac:VersionControlSystem]. 92 92 93 ==== Web Server ====93 ==== Web Server 94 94 A web server is optional because Trac is shipped with a server included, see the [#RunningtheStandaloneServer Running the Standalone Server] section below. 95 95 … … 106 106 107 107 108 ==== Other Python Packages ====108 ==== Other Python Packages 109 109 110 110 * [http://babel.edgewall.org Babel], version >= 0.9.5, … … 126 126 127 127 128 == Installing Trac ==128 == Installing Trac 129 129 === Using `easy_install` 130 130 One way to install Trac is using [http://pypi.python.org/pypi/setuptools setuptools]. … … 134 134 135 135 - Install Trac 1.0: 136 {{{ 136 {{{#!sh 137 137 easy_install Trac==1.0 138 138 }}} 139 139 - Install latest development version: 140 {{{ 140 {{{#!sh 141 141 easy_install Trac==dev 142 142 }}} … … 153 153 154 154 - 155 {{{ 155 {{{#!sh 156 156 pip install trac psycopg2 157 157 }}} 158 158 or 159 159 - 160 {{{ 160 {{{#!sh 161 161 pip install trac mysql-python 162 162 }}} … … 177 177 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). 178 178 179 {{{ 179 {{{#!sh 180 180 $ python ./setup.py install 181 181 }}} … … 189 189 190 190 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): 191 {{{ 191 {{{#!sh 192 192 $ python ./setup.py install 193 193 }}} 194 194 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`). 195 195 196 === Advanced Options ===196 === Advanced Options 197 197 198 198 To install Trac to a custom location, or find out about other advanced installation options, run: 199 {{{ 199 {{{#!sh 200 200 easy_install --help 201 201 }}} … … 204 204 205 205 Specifically, you might be interested in: 206 {{{ 206 {{{#!sh 207 207 easy_install --prefix=/path/to/installdir 208 208 }}} 209 209 or, if installing Trac on a Mac OS X system: 210 {{{ 210 {{{#!sh 211 211 easy_install --prefix=/usr/local --install-dir=/Library/Python/2.5/site-packages 212 212 }}} … … 216 216 217 217 218 == Creating a Project Environment ==218 == Creating a Project Environment 219 219 220 220 A [TracEnvironment Trac environment] is the backend storage where Trac stores information like wiki pages, tickets, reports, settings, etc. An environment is basically a directory that contains a human-readable [TracIni configuration file], and various other files and directories. 221 221 222 222 A new environment is created using [wiki:TracAdmin trac-admin]: 223 {{{ 223 {{{#!sh 224 224 $ trac-admin /path/to/myproject initenv 225 225 }}} … … 237 237 238 238 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: 239 {{{ 239 {{{#!sh 240 240 $ chown -R apache.apache /path/to/myproject 241 241 }}} … … 250 250 == Deploying Trac 251 251 252 === Running the Standalone Server ===252 === Running the Standalone Server 253 253 254 254 After having created a Trac environment, you can easily try the web interface by running the standalone server [wiki:TracStandalone tracd]: 255 {{{ 255 {{{#!sh 256 256 $ tracd --port 8000 /path/to/myproject 257 257 }}} 258 258 259 259 Then, fire up a browser and visit `http://localhost:8000/`. You should get a simple listing of all environments that `tracd` knows about. Follow the link to the environment you just created, and you should see Trac in action. If you only plan on managing a single project with Trac you can have the standalone server skip the environment list by starting it like this: 260 {{{ 260 {{{#!sh 261 261 $ tracd -s --port 8000 /path/to/myproject 262 262 }}} … … 275 275 276 276 277 === Running Trac on a Web Server ===277 === Running Trac on a Web Server 278 278 279 279 Trac provides various options for connecting to a "real" web server: … … 285 285 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. 286 286 287 ==== Generating the Trac cgi-bin directory ====#cgi-bin287 ==== Generating the Trac cgi-bin directory #cgi-bin 288 288 289 289 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 [wiki:TracAdmin trac-admin]. 290 290 291 291 There is, however, a bit of a chicken-and-egg problem. The [wiki: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: 292 {{{ 292 {{{#!sh 293 293 mkdir -p /usr/share/trac/projects/my-project 294 294 trac-admin /usr/share/trac/projects/my-project initenv … … 299 299 300 300 301 ==== Mapping Static Resources ====301 ==== Mapping Static Resources 302 302 303 303 Out of the box, Trac will pass static resources such as style sheets or images through itself. For anything but a tracd only based deployment, this is far from optimal as the web server could be set up to directly serve those static resources (for CGI setup, this is '''highly undesirable''' and will cause abysmal performance). … … 315 315 - `<plugins>/` - one directory for each resource directory managed by the plugins enabled for this environment 316 316 317 ===== Example: Apache and `ScriptAlias` =====#ScriptAlias-example317 ===== Example: Apache and `ScriptAlias` #ScriptAlias-example 318 318 319 319 Assuming the deployment has been done this way: 320 {{{ 320 {{{#!sh 321 321 $ trac-admin /var/trac/env deploy /path/to/trac/htdocs/common 322 322 }}} 323 323 324 324 Add the following snippet to Apache configuration ''before'' the `ScriptAlias` or `WSGIScriptAlias` (which map all the other requests to the Trac application), changing paths to match your deployment: 325 {{{ 325 {{{#!apache 326 326 Alias /trac/chrome/common /path/to/trac/htdocs/common 327 327 Alias /trac/chrome/site /path/to/trac/htdocs/site … … 334 334 335 335 If using mod_python, you might want to add this too (otherwise, the alias will be ignored): 336 {{{ 336 {{{#!apache 337 337 <Location "/trac/chrome/common/"> 338 338 SetHandler None … … 343 343 344 344 Similarly, if you have static resources in a project's `htdocs` directory (which is referenced by `/trac/chrome/site` URL in themes), you can configure Apache to serve those resources (again, put this ''before'' the `ScriptAlias` or `WSGIScriptAlias` for the .*cgi scripts, and adjust names and locations to match your installation): 345 {{{ 345 {{{#!apache 346 346 Alias /trac/chrome/site /path/to/projectenv/htdocs 347 347 … … 353 353 354 354 Alternatively to aliasing `/trac/chrome/common`, you can tell Trac to generate direct links for those static resources (and only those), using the [[wiki:TracIni#trac-section| [trac] htdocs_location]] configuration setting: 355 {{{ 355 {{{#!ini 356 356 [trac] 357 357 htdocs_location = http://static.example.org/trac-common/ … … 360 360 361 361 Of course, you still need to make the Trac `htdocs/common` directory available through the web server at the specified URL, for example by copying (or linking) the directory into the document root of the web server: 362 {{{ 362 {{{#!sh 363 363 $ ln -s /path/to/trac/htdocs/common /var/www/static.example.org/trac-common 364 364 }}} 365 365 366 366 367 ==== Setting up the Plugin Cache ====367 ==== Setting up the Plugin Cache 368 368 369 369 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. 370 370 371 == Configuring Authentication ==371 == Configuring Authentication 372 372 373 373 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. … … 384 384 == Granting admin rights to the admin user 385 385 Grant admin rights to user admin: 386 {{{ 386 {{{#!sh 387 387 $ trac-admin /path/to/myproject permission add admin TRAC_ADMIN 388 388 }}} … … 397 397 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. 398 398 399 {{{ 399 {{{#!ini 400 400 tracopt.versioncontrol.svn.* = enabled 401 401 }}} 402 402 403 {{{ 403 {{{#!ini 404 404 tracopt.versioncontrol.git.* = enabled 405 405 }}} … … 407 407 After enabling the components, repositories can be configured through the "Repositories" admin panel or by editing [TracIni#repositories-section trac.ini]. 408 408 409 === Automatic reference to the SVN changesets in Trac tickets ===409 === Automatic reference to the SVN changesets in Trac tickets 410 410 411 411 You can configure SVN to automatically add a reference to the changeset into the ticket comments, whenever changes are committed to the repository. The description of the commit needs to contain one of the following formulas: … … 414 414 415 415 This functionality requires a post-commit hook to be installed as described in [wiki:TracRepositoryAdmin#ExplicitSync TracRepositoryAdmin], and enabling the optional commit updater components by adding the following line to the `[components]` section of your [wiki:TracIni#components-section trac.ini], or enabling the components in the "Plugins" admin panel. 416 {{{ 416 {{{#!ini 417 417 tracopt.ticket.commit_updater.* = enabled 418 418 }}} 419 419 For more information, see the documentation of the `CommitTicketUpdater` component in the "Plugins" admin panel. 420 420 421 === Using Trac ===421 === Using Trac 422 422 423 423 Once you have your Trac site up and running, you should be able to create tickets, view the timeline, browse your version control repository if configured, etc.