Edgewall Software

Changes between Version 376 and Version 377 of TracInstall


Ignore:
Timestamp:
Aug 24, 2014, 1:48:40 PM (10 years ago)
Author:
Ryan J Ollos
Comment:

Use new style markup and syntax highlighting.

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"
    32
    43 '''NOTE: the information in this page applies to Trac 1.0, the current version of Trac. \\
    54 For installing previous Trac versions, please refer to [[wiki:0.12/TracInstall]] (for Trac 0.12)'''
    65}}}
    7 = Trac Installation Guide for 1.0 =
     6
     7= Trac Installation Guide for 1.0
    88[[TracGuideToc]]
    99[[TranslatedPages]]
     
    1919[[PageOutline(2-3,Installation Steps,inline)]]
    2020
    21 == Dependencies ==
     21== Dependencies
    2222=== Mandatory Dependencies
    2323To install Trac, the following software packages must be installed:
     
    3838[http://code.google.com/p/pysqlite/downloads/list google code], where you'll find the Windows
    3939installers or the `tar.gz` archive for building from source:
    40 {{{
     40{{{#!sh
    4141$ tar xvfz <version>.tar.gz
    4242$ cd <version>
     
    7474=== Optional Dependencies
    7575
    76 ==== Version Control System ====
    77 
    78 ===== Subversion =====
     76==== Version Control System
     77
     78===== Subversion
    7979 * [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.
    8080
     
    8787
    8888
    89 ===== Others =====
     89===== Others
    9090
    9191Support for other version control systems is provided via third-parties. See [trac:PluginList] and [trac:VersionControlSystem].
    9292
    93 ==== Web Server ====
     93==== Web Server
    9494A web server is optional because Trac is shipped with a server included, see the [#RunningtheStandaloneServer Running the Standalone Server] section below.
    9595
     
    106106   
    107107
    108 ==== Other Python Packages ====
     108==== Other Python Packages
    109109
    110110 * [http://babel.edgewall.org Babel], version >= 0.9.5,
     
    126126
    127127
    128 == Installing Trac ==
     128== Installing Trac
    129129=== Using `easy_install`
    130130One way to install Trac is using [http://pypi.python.org/pypi/setuptools setuptools].
     
    134134
    135135 - Install Trac 1.0:
    136    {{{
     136   {{{#!sh
    137137   easy_install Trac==1.0
    138138   }}}
    139139 - Install latest development version:
    140    {{{
     140   {{{#!sh
    141141   easy_install Trac==dev
    142142   }}}
     
    153153
    154154 -
    155 {{{
     155 {{{#!sh
    156156pip install trac psycopg2
    157157}}}
    158158or
    159159 -
    160 {{{
     160 {{{#!sh
    161161pip install trac mysql-python
    162162}}}
     
    177177You 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).
    178178
    179 {{{
     179{{{#!sh
    180180$ python ./setup.py install
    181181}}}
     
    189189
    190190If 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
    192192$ python ./setup.py install
    193193}}}
    194194Alternatively, 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`).
    195195
    196 === Advanced Options ===
     196=== Advanced Options
    197197
    198198To install Trac to a custom location, or find out about other advanced installation options, run:
    199 {{{
     199{{{#!sh
    200200easy_install --help
    201201}}}
     
    204204
    205205Specifically, you might be interested in:
    206 {{{
     206{{{#!sh
    207207easy_install --prefix=/path/to/installdir
    208208}}}
    209209or, if installing Trac on a Mac OS X system:
    210 {{{
     210{{{#!sh
    211211easy_install --prefix=/usr/local --install-dir=/Library/Python/2.5/site-packages
    212212}}}
     
    216216
    217217
    218 == Creating a Project Environment ==
     218== Creating a Project Environment
    219219
    220220A [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.
    221221
    222222A new environment is created using [wiki:TracAdmin trac-admin]:
    223 {{{
     223{{{#!sh
    224224$ trac-admin /path/to/myproject initenv
    225225}}}
     
    237237
    238238Finally, 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
    240240$ chown -R apache.apache /path/to/myproject
    241241}}}
     
    250250== Deploying Trac
    251251
    252 === Running the Standalone Server ===
     252=== Running the Standalone Server
    253253
    254254After having created a Trac environment, you can easily try the web interface by running the standalone server [wiki:TracStandalone tracd]:
    255 {{{
     255{{{#!sh
    256256$ tracd --port 8000 /path/to/myproject
    257257}}}
    258258
    259259Then, 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
    261261$ tracd -s --port 8000 /path/to/myproject
    262262}}}
     
    275275
    276276
    277 === Running Trac on a Web Server ===
     277=== Running Trac on a Web Server
    278278
    279279Trac provides various options for connecting to a "real" web server:
     
    285285Trac 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.
    286286
    287 ==== Generating the Trac cgi-bin directory ==== #cgi-bin
     287==== Generating the Trac cgi-bin directory #cgi-bin
    288288
    289289In 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].
    290290
    291291There 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
    293293mkdir -p /usr/share/trac/projects/my-project
    294294trac-admin /usr/share/trac/projects/my-project initenv
     
    299299
    300300
    301 ==== Mapping Static Resources ====
     301==== Mapping Static Resources
    302302
    303303Out 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).
     
    315315 - `<plugins>/` - one directory for each resource directory managed by the plugins enabled for this environment
    316316
    317 ===== Example: Apache and `ScriptAlias` ===== #ScriptAlias-example
     317===== Example: Apache and `ScriptAlias` #ScriptAlias-example
    318318
    319319Assuming the deployment has been done this way:
    320 {{{
     320{{{#!sh
    321321$ trac-admin /var/trac/env deploy /path/to/trac/htdocs/common
    322322}}}
    323323
    324324Add 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
    326326Alias /trac/chrome/common /path/to/trac/htdocs/common
    327327Alias /trac/chrome/site /path/to/trac/htdocs/site
     
    334334
    335335If using mod_python, you might want to add this too (otherwise, the alias will be ignored):
    336 {{{
     336{{{#!apache
    337337<Location "/trac/chrome/common/">
    338338  SetHandler None
     
    343343
    344344Similarly, 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
    346346Alias /trac/chrome/site /path/to/projectenv/htdocs
    347347
     
    353353
    354354Alternatively 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
    356356[trac]
    357357htdocs_location = http://static.example.org/trac-common/
     
    360360
    361361Of 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
    363363$ ln -s /path/to/trac/htdocs/common /var/www/static.example.org/trac-common
    364364}}}
    365365
    366366
    367 ==== Setting up the Plugin Cache ====
     367==== Setting up the Plugin Cache
    368368
    369369Some 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.
    370370
    371 == Configuring Authentication ==
     371== Configuring Authentication
    372372
    373373Trac 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.
     
    384384== Granting admin rights to the admin user
    385385Grant admin rights to user admin:
    386 {{{
     386{{{#!sh
    387387$ trac-admin /path/to/myproject permission add admin TRAC_ADMIN
    388388}}}
     
    397397The 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.
    398398
    399 {{{
     399{{{#!ini
    400400tracopt.versioncontrol.svn.* = enabled
    401401}}}
    402402
    403 {{{
     403{{{#!ini
    404404tracopt.versioncontrol.git.* = enabled
    405405}}}
     
    407407After enabling the components, repositories can be configured through the "Repositories" admin panel or by editing [TracIni#repositories-section trac.ini].
    408408
    409 === Automatic reference to the SVN changesets in Trac tickets ===
     409=== Automatic reference to the SVN changesets in Trac tickets
    410410
    411411You 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:
     
    414414
    415415This 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
    417417tracopt.ticket.commit_updater.* = enabled
    418418}}}
    419419For more information, see the documentation of the `CommitTicketUpdater` component in the "Plugins" admin panel.
    420420
    421 === Using Trac ===
     421=== Using Trac
    422422
    423423Once 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.