Changes between Version 5 and Version 6 of TracInstall


Ignore:
Timestamp:
17/07/2015 11:41:31 (9 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TracInstall

    v5 v6  
    11= Trac Installation Guide for 1.0
     2
    23[[TracGuideToc]]
    34
     
    1314
    1415== Dependencies
     16
    1517=== Mandatory Dependencies
     18
    1619To install Trac, the following software packages must be installed:
    1720
     
    4144Trac works well with MySQL, provided you follow the guidelines:
    4245
    43  * [http://mysql.com/ MySQL], version 5.0 or later
     46 * [http://mysql.com/ MySQL] or [http://mariadb.org/ MariaDB], version 5.0 or later
    4447 * [http://sf.net/projects/mysql-python MySQLdb], version 1.2.2 or later
    4548
    46 Given the caveats and known issues surrounding MySQL, read carefully the [trac:MySqlDb] page before creating the database.
     49Given the caveats and known issues surrounding MySQL, read the [trac:MySqlDb] page before creating the database.
    4750
    4851=== Optional Dependencies
     
    5154
    5255===== Subversion
    53  * [http://subversion.apache.org/ Subversion], 1.5.x or later and the '''''corresponding''''' Python bindings. Older versions starting from 1.0, like 1.2.4, 1.3.2 or 1.4.2, etc. may still work. For troubleshooting information, check the [trac:TracSubversion#Troubleshooting TracSubversion] page.
     56 * [http://subversion.apache.org/ Subversion], 1.5.x or later and the '''corresponding''' Python bindings. Older versions starting from 1.0, like 1.2.4, 1.3.2 or 1.4.2, etc. may still work. For troubleshooting information, check the [trac:TracSubversion#Troubleshooting TracSubversion] page.
    5457
    5558There are [http://subversion.apache.org/packages.html pre-compiled SWIG bindings] available for various platforms. (Good luck finding precompiled SWIG bindings for any Windows package at that listing. [trac:TracSubversion] points you to [http://alagazam.net Alagazam], which works for me under Python 2.6.)
     
    5760Note that Trac '''doesn't''' use [http://pysvn.tigris.org/ PySVN], neither does it work yet with the newer `ctype`-style bindings.
    5861
    59 '''Please note:''' if using Subversion, Trac must be installed on the '''same machine'''. Remote repositories are currently [trac:ticket:493 not supported].
     62'''Note:''' if using Subversion, Trac must be installed on the '''same machine'''. Remote repositories are currently [trac:ticket:493 not supported].
    6063
    6164===== Git
     
    6972
    7073==== Web Server
    71 A web server is optional because Trac is shipped with a server included, see the [#RunningtheStandaloneServer Running the Standalone Server] section below.
     74
     75A web server is optional because Trac has a server included, see the [#RunningtheStandaloneServer Running the Standalone Server] section below.
    7276
    7377Alternatively you can configure Trac to run in any of the following environments:
     
    8084   server (see [trac:TracOnWindowsIisAjp TracOnWindowsIisAjp])
    8185 * a FastCGI and FastCGI-to-WSGI gateway (see [trac:TracOnWindowsIisWfastcgi])
    82  * a CGI-capable web server (see TracCgi), '''but usage of Trac as a cgi script
    83    is highly discouraged''', better use one of the previous options.
     86 * a CGI-capable web server (see TracCgi), but //usage of Trac as a cgi script
     87   is highly discouraged//, better use one of the previous options.
    8488   
    85 
    8689==== Other Python Packages
    8790
     
    103106}}}
    104107
    105 Please refer to the documentation of these packages to find out how they are best installed. In addition, most of the [trac:TracInstallPlatforms platform-specific instructions] also describe the installation of the dependencies. Keep in mind however that the information there ''probably concern older versions of Trac than the one you're installing''.
     108Please refer to the documentation of these packages to find out how they are best installed. In addition, most of the [trac:TracInstallPlatforms platform-specific instructions] also describe the installation of the dependencies. Keep in mind however that the information there probably concern older versions of Trac than the one you're installing.
    106109
    107110== Installing Trac
     
    110113
    111114=== Using `easy_install`
    112 Trac can be installed from PyPI or the Subversion repository using [http://pypi.python.org/pypi/setuptools setuptools].
    113 
    114 A few examples:
     115
     116Trac can be installed from [https://pypi.python.org/pypi/Trac PyPI] or the Subversion repository using [pypi:setuptools setuptools].
     117
     118A few command-line examples:
    115119
    116120 - Install Trac 1.0:
    117    {{{#!sh
    118   easy_install Trac==1.0
    119    }}}
     121 {{{#!sh
     122$ easy_install Trac==1.0
     123}}}
    120124 - Install latest development version:
    121    {{{#!sh
    122   easy_install Trac==dev
    123    }}}
     125 {{{#!sh
     126$ easy_install Trac==dev
     127}}}
    124128   Note that in this case you won't have the possibility to run a localized version of Trac;
    125    either use a released version or install from source 
     129   either use a released version or install from source.
    126130
    127131More information can be found on the [trac:setuptools] page.
     
    132136
    133137=== Using `pip`
    134 'pip' is an easy_install replacement that is very useful to quickly install python packages.
     138
     139'pip' is an easy_install replacement that is very useful to quickly install Python packages.
    135140To get a Trac installation up and running in less than 5 minutes:
    136141
    137 Assuming you want to have your entire pip installation in `/opt/user/trac`
     142Assuming you want to have your entire pip installation in `/opt/user/trac`:
    138143
    139144 -
    140145 {{{#!sh
    141 pip install trac psycopg2
    142 }}}
    143 or
     146$ pip install trac psycopg2
     147}}}
     148or:
    144149 -
    145150 {{{#!sh
    146 pip install trac mysql-python
     151$ pip install trac mysql-python
    147152}}}
    148153
     
    151156pip will automatically resolve all dependencies (like Genshi, pygments, etc.), download the latest packages from pypi.python.org and create a self contained installation in `/opt/user/trac`.
    152157
    153 All commands (`tracd`, `trac-admin`) are available in `/opt/user/trac/bin`. This can also be leveraged for `mod_python` (using `PythonHandler` directive) and `mod_wsgi` (using `WSGIDaemonProcess` directive)
     158All commands (`tracd`, `trac-admin`) are available in `/opt/user/trac/bin`. This can also be leveraged for `mod_python` (using `PythonHandler` directive) and `mod_wsgi` (using `WSGIDaemonProcess` directive).
    154159
    155160Additionally, you can install several Trac plugins (listed [https://pypi.python.org/pypi?:action=browse&show=all&c=516 here]) through pip.
    156161
    157162=== From source
     163
    158164Using the python-typical setup at the top of the source directory also works. You can obtain the source for a .tar.gz or .zip file corresponding to a release (e.g. `Trac-1.0.tar.gz`) from the [trac:TracDownload] page, or you can get the source directly from the repository. See [trac:TracRepositories#OfficialSubversionrepository TracRepositories] for details.
    159165
     
    162168}}}
    163169
    164 ''You will need root permissions or equivalent for this step.''
     170You will need root permissions or equivalent for this step.
    165171
    166172This will byte-compile the Python source code and install it as an .egg file or folder in the `site-packages` directory
     
    171177$ python ./setup.py install
    172178}}}
     179
    173180Alternatively, 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`).
    174181
     
    185192To install Trac to a custom location, or find out about other advanced installation options, run:
    186193{{{#!sh
    187 easy_install --help
     194$ easy_install --help
    188195}}}
    189196
     
    192199Specifically, you might be interested in:
    193200{{{#!sh
    194 easy_install --prefix=/path/to/installdir
    195 }}}
     201$ easy_install --prefix=/path/to/installdir
     202}}}
     203
    196204or, if installing Trac on a Mac OS X system:
    197205{{{#!sh
    198 easy_install --prefix=/usr/local --install-dir=/Library/Python/2.5/site-packages
    199 }}}
    200 Note: If installing on Mac OS X 10.6 running {{{ easy_install http://svn.edgewall.org/repos/trac/trunk }}} will install into {{{ /usr/local }}} and {{{ /Library/Python/2.5/site-packages }}} by default.
     206$ easy_install --prefix=/usr/local --install-dir=/Library/Python/2.5/site-packages
     207}}}
     208
     209'''Note''': If installing on Mac OS X 10.6 running {{{ easy_install http://svn.edgewall.org/repos/trac/trunk }}} will install into {{{ /usr/local }}} and {{{ /Library/Python/2.5/site-packages }}} by default.
    201210
    202211The above will place your `tracd` and `trac-admin` commands into `/usr/local/bin` and will install the Trac libraries and dependencies into `/Library/Python/2.5/site-packages`, which is Apple's preferred location for third-party Python application installations.
     
    221230
    222231{{{#!div style="border: 1pt dotted; margin: 1em"
    223 **Filesystem Warning:** When selecting the location of your environment, make sure that the filesystem on which the environment directory resides supports sub-second timestamps (i.e. **not** `ext2` or `ext3` on Linux), as the modification time of the `conf/trac.ini` file will be monitored to decide whether an environment restart is needed or not. A too coarse-grained timestamp resolution may result in inconsistencies in Trac < 1.0.2. The best advice is to opt for a platform with sub-second timestamp resolution, regardless of the Trac version.
     232**Filesystem Warning:** When selecting the location of your environment, make sure that the filesystem on which the environment directory resides supports sub-second timestamps (i.e. **not** `ext2` or `ext3` on Linux, or HFS+ on OSX), as the modification time of the `conf/trac.ini` file will be monitored to decide whether an environment restart is needed or not. A too coarse-grained timestamp resolution may result in inconsistencies in Trac < 1.0.2. The best advice is to opt for a platform with sub-second timestamp resolution, regardless of the Trac version.
    224233}}}
    225234
     
    229238}}}
    230239
    231 The actual username and groupname of the apache server may not be exactly `apache`, and are specified in the Apache configuration file by the directives `User` and `Group` (if Apache `httpd` is what you use).
     240The actual username and groupname of the Apache server may not be exactly `apache`, and are specified in the Apache configuration file by the directives `User` and `Group` (if Apache `httpd` is what you use).
    232241
    233242{{{#!div class=important
     
    269278 - [wiki:TracModWSGI mod_wsgi]
    270279 - [TracModPython mod_python]
    271  - //[TracCgi CGI] (should not be used, as the performance is far from optimal)//
     280 - //[TracCgi CGI]: should not be used, as it degrades performance//
    272281
    273282Trac 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.
     
    279288There 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:
    280289{{{#!sh
    281 mkdir -p /usr/share/trac/projects/my-project
    282 trac-admin /usr/share/trac/projects/my-project initenv
    283 trac-admin /usr/share/trac/projects/my-project deploy /tmp/deploy
    284 mv /tmp/deploy/* /usr/share/trac
    285 }}}
     290$ mkdir -p /usr/share/trac/projects/my-project
     291$ trac-admin /usr/share/trac/projects/my-project initenv
     292$ trac-admin /usr/share/trac/projects/my-project deploy /tmp/deploy
     293$ mv /tmp/deploy/* /usr/share/trac
     294}}}
     295
    286296Don't forget to check that the web server has the execution right on scripts in the `/usr/share/trac/cgi-bin` directory.
    287297
    288298==== Mapping Static Resources
    289299
    290 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).
    291 
    292 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 the layout of the servers file system. We also can map requests for static resources directly to the directory on the file system, avoiding processing these requests by Trac itself.
     300Out 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''' as it causes abysmal performance.
     301
     302Web 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 the layout of the servers file system. We also can map requests for static resources directly to the directory on the file system, avoiding processing these requests by Trac itself.
    293303
    294304There are two primary URL paths for static resources - `/chrome/common` and `/chrome/site`. Plugins can add their own resources, usually accessible by `/chrome/<plugin>` path, so its important to override only known paths and not try to make universal `/chrome` alias for everything.
     
    320330}}}
    321331
    322 If using mod_python, you might want to add this too (otherwise, the alias will be ignored):
     332If using mod_python, you might want to add this too, otherwise the alias will be ignored:
    323333{{{#!apache
    324334<Location "/trac/chrome/common/">
     
    344354htdocs_location = http://static.example.org/trac-common/
    345355}}}
    346 Note that this makes it easy to have a dedicated domain serve those static resources (preferentially [http://code.google.com/speed/page-speed/docs/request.html#ServeFromCookielessDomain cookie-less]).
     356
     357Note that this makes it easy to have a dedicated domain serve those static resources, preferentially [http://code.google.com/speed/page-speed/docs/request.html#ServeFromCookielessDomain cookie-less].
    347358
    348359Of 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:
     
    364375 * TracStandalone#UsingAuthentication if you use the standalone server, `tracd`.
    365376 * [wiki:TracModWSGI#ConfiguringAuthentication TracModWSGI#ConfiguringAuthentication] if you use the Apache web server, with any of its front end: `mod_wsgi` of course, but the same instructions applies also for `mod_python`, `mod_fcgi` or `mod_fastcgi`.
    366  * TracFastCgi if you're using another web server with FCGI support (Cherokee, Lighttpd, !LiteSpeed, nginx)
     377 * TracFastCgi if you are using another web server with FCGI support, such as Cherokee, Lighttpd, !LiteSpeed, nginx.
    367378
    368379The following document also contains some useful information for beginners: [trac:TracAuthenticationIntroduction].
    369380
    370381== Granting admin rights to the admin user
     382
    371383Grant admin rights to user admin:
    372384{{{#!sh
    373385$ trac-admin /path/to/myproject permission add admin TRAC_ADMIN
    374386}}}
     387
    375388This user will have an "Admin" entry menu that will allow you to administrate your Trac project.
    376389
     
    381394Support for version control systems is provided by optional components in Trac and the components are disabled by default //(since 1.0)//. Subversion and Git must be explicitly enabled if you wish to use them. See TracRepositoryAdmin for more details.
    382395
    383 The version control systems are 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.
     396The version control systems are 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:
    384397
    385398{{{#!ini
     399[components]
    386400tracopt.versioncontrol.svn.* = enabled
    387401}}}
    388402
    389403{{{#!ini
     404[components]
    390405tracopt.versioncontrol.git.* = enabled
    391406}}}