close Warning: Can't synchronize with repository "(default)" (/common/SVN/crkit does not appear to be a Subversion repository.). Look in the Trac log for more information.

Changes between Version 3 and Version 4 of TracInstall


Ignore:
Timestamp:
Jan 30, 2019, 11:46:21 PM (5 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TracInstall

    v3 v4  
    1 = Trac Installation Guide for 1.2
     1= Trac Installation Guide for 1.1
    22[[TracGuideToc]]
    33
     
    7575Alternatively you can configure Trac to run in any of the following environments:
    7676 * [http://httpd.apache.org/ Apache] with
    77   * [https://github.com/GrahamDumpleton/mod_wsgi mod_wsgi], see [wiki:TracModWSGI] and [http://code.google.com/p/modwsgi/wiki/IntegrationWithTrac ModWSGI IntegrationWithTrac].
    78   * [http://modpython.org/ mod_python 3.5.0], see TracModPython
     77   - [https://github.com/GrahamDumpleton/mod_wsgi mod_wsgi], see [wiki:TracModWSGI] and
     78     [http://code.google.com/p/modwsgi/wiki/IntegrationWithTrac ModWSGI IntegrationWithTrac].
     79   - [http://modpython.org/ mod_python 3.5.0], see TracModPython
    7980 * a [http://www.fastcgi.com/ FastCGI]-capable web server (see TracFastCgi)
    8081 * an [http://tomcat.apache.org/connectors-doc/ajp/ajpv13a.html AJP]-capable web
     
    137138Assuming you want to have your entire pip installation in `/opt/user/trac`
    138139
     140 -
    139141 {{{#!sh
    140 $ pip install trac psycopg2
     142pip install trac psycopg2
    141143}}}
    142144or
     145 -
    143146 {{{#!sh
    144 $ pip install trac mysql-python
     147pip install trac mysql-python
    145148}}}
    146149
     
    183186To install Trac to a custom location, or find out about other advanced installation options, run:
    184187{{{#!sh
    185 $ easy_install --help
     188easy_install --help
    186189}}}
    187190
     
    190193Specifically, you might be interested in:
    191194{{{#!sh
    192 $ easy_install --prefix=/path/to/installdir
     195easy_install --prefix=/path/to/installdir
    193196}}}
    194197or, if installing Trac on a Mac OS X system:
    195198{{{#!sh
    196 $ easy_install --prefix=/usr/local --install-dir=/Library/Python/2.6/site-packages
     199easy_install --prefix=/usr/local --install-dir=/Library/Python/2.6/site-packages
    197200}}}
    198201
     
    212215}}}
    213216
    214 You will be prompted for the information needed to create the environment: the name of the project and the [TracEnvironment#DatabaseConnectionStrings database connection string]. If you're not sure what to specify for any of these options, just press `<Enter>` to use the default value.
     217[TracAdmin trac-admin] will prompt you for the information it needs to create the environment: the name of the project and the [TracEnvironment#DatabaseConnectionStrings database connection string]. If you're not sure what to specify for any of these options, just press `<Enter>` to use the default value.
    215218
    216219Using the default database connection string will always work as long as you have SQLite installed. For the other [trac:DatabaseBackend database backends] you should plan ahead and already have a database ready to use at this point.
     
    271274 - [wiki:TracModWSGI Apache with mod_wsgi]
    272275 - [TracModPython Apache with mod_python]
    273  - [TracCgi CGI] //(should not be used, as the performance is far from optimal)//
     276 - //[TracCgi CGI] (should not be used, as the performance is far from optimal)//
    274277
    275278Trac 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.
     
    277280==== Generating the Trac cgi-bin directory #cgi-bin
    278281
    279 Application scripts for CGI, FastCGI and mod-wsgi can be generated using the [TracAdmin trac-admin] `deploy` command:
     282In 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 [TracAdmin trac-admin].
     283
     284There is, however, a bit of a chicken-and-egg problem. The [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:
     285{{{#!sh
     286mkdir -p /usr/share/trac/projects/my-project
     287trac-admin /usr/share/trac/projects/my-project initenv
     288trac-admin /usr/share/trac/projects/my-project deploy /tmp/deploy
     289mv /tmp/deploy/* /usr/share/trac
     290}}}
     291Don't forget to check that the web server has the execution right on scripts in the `/usr/share/trac/cgi-bin` directory.
     292
     293==== Mapping Static Resources
     294
     295Without additional configuration, Trac will handle requests for static resources such as stylesheets and images. For anything other than a TracStandalone deployment, this is not optimal as the web server can be set up to directly serve the static resources. For CGI setup, this is '''highly undesirable''' as it causes abysmal performance.
     296
     297Web servers such as [http://httpd.apache.org/ Apache] allow you to create //Aliases// to resources, giving them a virtual URL that doesn't necessarily reflect their location on the file system. We can map requests for static resources directly to directories on the file system, to avoid Trac processing the requests.
     298
     299There are two primary URL paths for static resources: `/chrome/common` and `/chrome/site`. Plugins can add their own resources, usually accessible at the `/chrome/<plugin>` path.
     300
     301A single `/chrome` alias can used if the static resources are extracted for all plugins. This means that the `deploy` command must be executed after installing or updating a plugin that provides static resources, or after modifying resources in the `$env/htdocs` directory. This is probably appropriate for most installations but may not be what you want if, for example, you wish to upload plugins through the //Plugins// administration page.
     302
     303The resources are extracted using the [TracAdmin trac-admin]` <environment> deploy` command:
    280304[[TracAdminHelp(deploy)]]
    281305
    282 Grant the web server execution right on scripts in the `cgi-bin` directory.
    283 
    284 For example, the following yields a typical directory structure:
    285 {{{#!sh
    286 $ mkdir -p /var/trac
    287 $ trac-admin /var/trac/<project> initenv
    288 $ trac-admin /var/trac/<project> deploy /var/www
    289 $ ls /var/www
    290 cgi-bin htdocs
    291 $ chmod ugo+x /var/www/cgi-bin/*
    292 }}}
    293 
    294 ==== Mapping Static Resources
    295 
    296 Without additional configuration, Trac will handle requests for static resources such as stylesheets and images. For anything other than a TracStandalone deployment, this is not optimal as the web server can be set up to directly serve the static resources. For CGI setup, this is '''highly undesirable''' as it causes abysmal performance.
    297 
    298 Web servers such as [http://httpd.apache.org/ Apache] allow you to create //Aliases// to resources, giving them a virtual URL that doesn't necessarily reflect their location on the file system. We can map requests for static resources directly to directories on the file system, to avoid Trac processing the requests.
    299 
    300 There are two primary URL paths for static resources: `/chrome/common` and `/chrome/site`. Plugins can add their own resources, usually accessible at the `/chrome/<plugin>` path.
    301 
    302 A single `/chrome` alias can used if the static resources are extracted for all plugins. This means that the `deploy` command (discussed in the previous section) must be executed after installing or updating a plugin that provides static resources, or after modifying resources in the `$env/htdocs` directory. This is probably appropriate for most installations but may not be what you want if, for example, you wish to upload plugins through the //Plugins// administration page.
    303 
    304 The `deploy` command creates an `htdocs` directory with:
     306The target `<directory>` will contain an `htdocs` directory with:
    305307 - `common/` - the static resources of Trac
    306308 - `site/` - a copy of the environment's `htdocs/` directory
     
    320322Assuming the deployment has been done this way:
    321323{{{#!sh
    322 $ trac-admin /var/trac/<project> deploy /var/www
     324$ trac-admin /var/trac/env deploy /path/to/shared/trac
    323325}}}
    324326
     
    364366}}}
    365367
    366 Another alternative to aliasing `/trac/chrome/common` is having Trac generate direct links for those static resources (and only those), using the [TracIni#trac-section htdocs_location] configuration setting:
     368Another alternative to aliasing `/trac/chrome/common` is having Trac generate direct links for those static resources (and only those), using the [[TracIni#trac-section| [trac] htdocs_location]] configuration setting:
    367369{{{#!ini
    368370[trac]
     
    377379}}}
    378380
    379 ==== Setting up the Plugin Cache #egg-cache
     381==== Setting up the Plugin Cache
    380382
    381383Some 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.
    382 
    383 If you setup hook scripts that call Trac, such as the Subversion post-commit hook script provided in the `/contrib` directory, make sure you define the `PYTHON_EGG_CACHE` environment variable within these scripts as well.
    384384
    385385== Configuring Authentication