Äîêóìåíò âçÿò èç êýøà ïîèñêîâîé ìàøèíû. Àäðåñ îðèãèíàëüíîãî äîêóìåíòà : http://kodomo.cmm.msu.ru/trac/tanchiki/wiki/TracInstall?action=diff&version=2
Äàòà èçìåíåíèÿ: Unknown
Äàòà èíäåêñèðîâàíèÿ: Mon Apr 11 21:01:08 2016
Êîäèðîâêà: IBM-866

Ïîèñêîâûå ñëîâà: guide 8.0
TracInstall (diff) òÀÓ Tanchiki

Changes between Version 1 and Version 2 of TracInstall


Ignore:
Timestamp:
08/21/13 19:46:14 (3 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TracInstall

    v1 v2 ˆà
    1ˆà= Trac Installation Guide for 0.11 = ˆà
    ˆà1= Trac Installation Guide for 0.12 = ˆà
    22[[TracGuideToc]]ˆà
    33ˆà
    4ˆàˆà
    5ˆàTrac is written in the Python programming language and needs a database, [http://sqlite.org/ SQLite], [http://postgresql.org/ PostgreSQL], [http://mysql.com/ MySQL]. For HTML rendering, Trac uses the [http://genshi.edgewall.org Genshi] templating system.ˆà
    6ˆàˆà
    7ˆàWhat follows are generic instructions for installing and setting up Trac and its requirements. While you can find instructions for installing Trac on specific systems at TracInstallPlatforms on the main Trac site, please be sure to '''first read through these general instructions''' to get a good understanding of the tasks involved.ˆà
    8ˆàˆà
    9ˆàSee TracUpgrade for instructions on how to upgrade an existing installation.ˆà
    10ˆàˆà
    11ˆàˆà
    12ˆà== Quick Install a Released Version ==ˆà
    13ˆàFor a quick install, first make sure you have [http://python.org/download Python] (2.3-2.6) and [http://peak.telecommunity.com/DevCenter/EasyInstall#installing-easy-install easy_install].ˆà
    14ˆàˆà
    15ˆàThen enter (''omitting 'sudo' if not applicable'')ˆà
    16ˆà{{{ˆà
    17ˆàsudo easy_install Tracˆà
    18ˆà}}}ˆà
    19ˆàto install Trac, SQLite, and Genshi.ˆà
    20ˆàˆà
    21ˆàˆà
    22ˆà== Requirements ==ˆà
    23ˆàThe hardware requirements for running Trac obviously depend on the expected data volume (number of wiki pages, tickets, revisions) and traffic. Very small projects will run fine with a 500MHz processor and 128MB RAM using SQLite. In general, the more RAM, the better. A fast hard disk also helps.ˆà
    24ˆàˆà
    ˆà4Trac is written in the Python programming language and needs a database, [http://sqlite.org/ SQLite], [http://www.postgresql.org/ PostgreSQL], or [http://mysql.com/ MySQL]. For HTML rendering, Trac uses the [http://genshi.edgewall.org Genshi] templating system.ˆà
    ˆà5ˆà
    ˆà6Since version 0.12, Trac can also be localized, and there's probably a translation available for your language. If you want to be able to use the Trac interface in other languages, then make sure you **first** have installed the optional package [#OtherPythonPackages Babel]. Lacking Babel, you will only get the default English version, as usual. If you install Babel later on, you will need to re-install Trac.ˆà
    ˆà7ˆà
    ˆà8If you're interested in contributing new translations for other languages or enhance the existing translations, then please have a look at [trac:wiki:TracL10N TracL10N].ˆà
    ˆà9ˆà
    ˆà10What follows are generic instructions for installing and setting up Trac and its requirements. While you may find instructions for installing Trac on specific systems at [trac:wiki:TracInstallPlatforms TracInstallPlatforms] on the main Trac site, please be sure to '''first read through these general instructions''' to get a good understanding of the tasks involved.ˆà
    ˆà11ˆà
    ˆà12[[PageOutline(2-3,Installation Steps,inline)]]ˆà
    ˆà13ˆà
    ˆà14== Dependencies ==ˆà
    ˆà15=== Mandatory Dependenciesˆà
    2516To install Trac, the following software packages must be installed:ˆà
    2617ˆà
    27ˆà * [http://www.python.org/ Python], version >=2.3 (<3.0)ˆà
    28ˆà   * if using mod_python together with xml-related things, use python-2.5. expat is namespaced there and does not cause apache to crash any more(see [http://www.dscpl.com.au/wiki/ModPython/Articles/ExpatCausingApacheCrash here] for details).ˆà
    29ˆà   * For RPM-based systems you might also need the `python-devel` and `python-xml` packages.ˆà
    30ˆà   * See instructions in [trac:wiki:TracOnWindows/Python2.5 TracOnWindows/Python2.5]ˆà
    31ˆà * [wiki:setuptools], version >= 0.6ˆà
    32ˆà * [http://genshi.edgewall.org/wiki/Download Genshi], version >= 0.5 (was version >= 0.4.1 on previous 0.11 release candidates)ˆà
    33ˆà * You also need a database system and the corresponding python drivers for it.ˆà
    34ˆà   The database can be either SQLite, PostgreSQL or MySQL.ˆà
    35ˆà * Optional if some plugins require it: [http://www.clearsilver.net/ ClearSilver]ˆà
    36ˆàˆà
    37ˆà==== For SQLite ====ˆà
    ˆà18 * [http://www.python.org/ Python], version >= 2.4 and < 3.0ˆà
    ˆà19   //(note that we dropped the support for Python 2.3 in this release and that this will be the last Trac release supporting Python 2.4)//ˆà
    ˆà20 * [http://peak.telecommunity.com/DevCenter/setuptools setuptools], version >= 0.6ˆà
    ˆà21 * [http://genshi.edgewall.org/wiki/Download Genshi], version >= 0.6 (but < 0.7dev, i.e. don't use Genshi trunk)ˆà
    ˆà22ˆà
    ˆà23You also need a database system and the corresponding python bindings.ˆà
    ˆà24The database can be either SQLite, PostgreSQL or MySQL.ˆà
    ˆà25ˆà
    ˆà26==== For the SQLite database #ForSQLiteˆà
    3827ˆà
    3928If you're using Python 2.5 or 2.6, you already have everything you need.ˆà
    4029ˆà
    41ˆàIf you're using Python 2.3 or 2.4 and need pysqlite, you can download from ˆà
    42ˆà[http://code.google.com/p/pysqlite/downloads/list google code] the Windowsˆà
    43ˆàinstallers or the tar.gz archive for building from source: ˆà
    ˆà30If you're using Python 2.4 and need pysqlite, you can download from ˆà
    ˆà31[http://code.google.com/p/pysqlite/downloads/list google code] the Windows installers or the tar.gz archive for building from source: ˆà
    4432{{{ˆà
    4533$ tar xvfz <version>.tar.gz ˆà
    òÀæ òÀæ ˆà
    4836}}}ˆà
    4937 ˆà
    50ˆàThat way, the latest SQLite version will be downloaded and built into the ˆà
    51ˆàbindings. ˆà
    52ˆàˆà
    53ˆàIf you're still using SQLite 2.x, you'll need pysqlite 1.0.x, although this ˆà
    54ˆàpackage is not easy to find anymore. For SQLite 3.x, try not to useˆà
    55ˆàpysqlite 1.1.x, which has been deprecated in favor of pysqlite 2.x.ˆà
    56ˆàˆà
    57ˆàSee additional information in [trac:PySqlite PySqlite].ˆà
    58ˆàˆà
    59ˆà==== For PostgreSQL ====ˆà
    60ˆàˆà
    61ˆà * [http://www.postgresql.org/ PostgreSQL]ˆà
    62ˆà * [http://initd.org/projects/psycopg2 psycopg2]ˆà
    63ˆà * See [trac:wiki:DatabaseBackend#Postgresql DatabaseBackend]ˆà
    64ˆàˆà
    65ˆà'''Warning''': PostgreSQL 8.3 uses a strict type checking mechanism. To use Trac with the 8.3 Version of PostgreSQL, you will need [http://trac.edgewall.org/changeset/6512 trac-0.11] or later.ˆà
    66ˆàˆà
    67ˆà==== For MySQL ====ˆà
    68ˆàˆà
    69ˆà * [http://mysql.com/ MySQL], version 4.1 or later ([http://askmonty.org/wiki/index.php/MariaDB MariaDB] might work as well)ˆà
    70ˆà * [http://sf.net/projects/mysql-python MySQLdb], version 1.2.1 or laterˆà
    71ˆàˆà
    72ˆàSee [trac:MySqlDb MySqlDb] for more detailed information.ˆà
    73ˆàIt is ''very'' important to read carefully that page before creating the database.ˆà
    74ˆàˆà
    75ˆà== Optional Requirements ==ˆà
    ˆà38This will extract the SQLite code and build the bindings. ˆà
    ˆà39ˆà
    ˆà40To install SQLite, your system may require the development headers. Without these you will get various GCC related errors when attempting to build:ˆà
    ˆà41ˆà
    ˆà42{{{ˆà
    ˆà43$ apt-get install libsqlite3-devˆà
    ˆà44}}}ˆà
    ˆà45ˆà
    ˆà46SQLite 2.x is no longer supported, and neither is !PySqlite 1.1.x.ˆà
    ˆà47ˆà
    ˆà48A known bug !PySqlite versions 2.5.2-4 prohibits upgrade of trac databasesˆà
    ˆà49from 0.11.x to 0.12. Please use versions 2.5.5 and newer or 2.5.1 andˆà
    ˆà50older. See [trac:#9434] for more detail.ˆà
    ˆà51ˆà
    ˆà52See additional information in [trac:PySqlite].ˆà
    ˆà53ˆà
    ˆà54==== For the PostgreSQL database #ForPostgreSQLˆà
    ˆà55ˆà
    ˆà56You need to install the database and its Python bindings:ˆà
    ˆà57 * [http://www.postgresql.org/ PostgreSQL], version 8.0 or laterˆà
    ˆà58 * [http://pypi.python.org/pypi/psycopg2 psycopg2]ˆà
    ˆà59ˆà
    ˆà60See [trac:DatabaseBackend#Postgresql DatabaseBackend] for details.ˆà
    ˆà61ˆà
    ˆà62ˆà
    ˆà63==== For the MySQL database #ForMySQLˆà
    ˆà64ˆà
    ˆà65Trac can now work quite well with MySQL, provided you follow the guidelines.ˆà
    ˆà66ˆà
    ˆà67 * [http://mysql.com/ MySQL], version 5.0 or laterˆà
    ˆà68 * [http://sf.net/projects/mysql-python MySQLdb], version 1.2.2 or laterˆà
    ˆà69ˆà
    ˆà70It is '''very''' important to read carefully the  [trac:MySqlDb] page before creating the database.ˆà
    ˆà71ˆà
    ˆà72=== Optional Dependenciesˆà
    7673ˆà
    7774==== Version Control System ====ˆà
    7875ˆà
    79ˆà'''Please note:''' if using Subversion, Trac must be installed on the '''same machine'''. Remote repositories are currently not supported (although Windows UNC paths such as {{{\\machine_name\path\to\svn}}} do work).ˆà
    80ˆàˆà
    81ˆà * [http://subversion.tigris.org/ Subversion], version >= 1.0. (versions recommended: 1.2.4, 1.3.2 or 1.4.2) and the '''''corresponding''''' Python bindings. For troubleshooting, check [trac:TracSubversion TracSubversion]ˆà
    82ˆà   * Trac uses the [http://svnbook.red-bean.com/svnbook-1.1/ch08s02.html#svn-ch-8-sect-2.3 SWIG] bindings included in the Subversion distribution, '''not''' [http://pysvn.tigris.org/ PySVN] (which is sometimes confused with the standard SWIG bindings).ˆà
    83ˆà   * If Subversion was already installed without the SWIG bindings, on Unix you'll need to re-`configure` Subversion and `make swig-py`, `make install-swig-py`.ˆà
    84ˆà   * There are [http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91 pre-compiled bindings] available for win32. ˆà
    85ˆà * Support for other version control systems is provided via third-parties. See [trac:PluginList PluginList] and [trac:VersioningSystemBackend VersioningSystemBackend].ˆà
    ˆà76===== Subversion =====ˆà
    ˆà77ˆà
    ˆà78[http://subversion.apache.org/ Subversion] 1.5.x or 1.6.x and the '''''corresponding''''' Python bindings. ˆà
    ˆà79ˆà
    ˆà80There are [http://subversion.apache.org/packages.html pre-compiled SWIG bindings] available for various platforms. See also the TracSubversion page for details about Windows packages.ˆà
    ˆà81ˆà
    ˆà82Older versions starting from 1.4.0, etc. should still work. For troubleshooting information, check the [trac:TracSubversion#Troubleshooting TracSubversion] page. Versions prior to 1.4.0 won't probably work since trac uses svn core functionality (e.g. svn_path_canonicalize) that is not implemented in the python swig wrapper in svn <= 1.3.x (although it exists in the svn lib itself).ˆà
    ˆà83ˆà
    ˆà84Note that Trac '''doesn't''' use [http://pysvn.tigris.org/ PySVN], neither does it work yet with the newer `ctype`-style bindings. ˆà
    ˆà85ˆà
    ˆà86'''Please note:''' if using Subversion, Trac must be installed on the '''same machine'''. Remote repositories are currently [trac:#493 not supported].ˆà
    ˆà87ˆà
    ˆà88ˆà
    ˆà89===== Others =====ˆà
    ˆà90ˆà
    ˆà91Support for other version control systems is provided via third-parties. See [trac:PluginList] and [trac:VersionControlSystem].ˆà
    8692ˆà
    8793==== Web Server ====ˆà
    88ˆà * A CGI-capable web server (see TracCgi), orˆà
    89ˆà * a [http://www.fastcgi.com/ FastCGI]-capable web server (see TracFastCgi), orˆà
    90ˆà * an [http://tomcat.apache.org/connectors-doc/ajp/ajpv13a.html AJP]-capable web server (see [trac:TracOnWindowsIisAjp TracOnWindowsIisAjp]), orˆà
    91ˆà * [http://httpd.apache.org/ Apache] with [http://code.google.com/p/modwsgi/ mod_wsgi] (see [wiki:TracModWSGI] or http://code.google.com/p/modwsgi/wiki/IntegrationWithTrac) orˆà
    92ˆà    * This should work with Apache 1.3, 2.0 or 2.2 and promises to deliver more performance than using mod_python. A little less mature than mod_python.ˆà
    93ˆà * [http://httpd.apache.org/ Apache] with [http://www.modpython.org/ mod_python 3.1.3+] (see TracModPython)ˆà
    94ˆà    * When installing mod_python the development versions of Python and Apache are required (actually the libraries and header files)ˆà
    95ˆàˆà
    96ˆàFor those stuck with Apache 1.3, it is also possible to get Trac working with [http://www.modpython.org/ mod_python 2.7] (see [trac:wiki:TracModPython2.7 TracModPython2.7]). This guide hasn't been updated since 0.84, so it may or may not work.ˆà
    97ˆàˆà
    98ˆà==== Other Python Utilities ====ˆà
    99ˆà * [http://docutils.sourceforge.net/ docutils], version >= 0.3.9 for WikiRestructuredText.ˆà
    100ˆà * [http://pygments.pocoo.org Pygments] for '''syntax highlighting''', although [http://silvercity.sourceforge.net/ SilverCity] >= 0.9.7 and/or [http://gnu.org/software/enscript/enscript.html GNU Enscript] are also possible. Refer to TracSyntaxColoring for details.ˆà
    101ˆà * [http://pytz.sf.net pytz] to get a complete list of time zones, otherwise Trac will fall back on a shorter list from an internal time zone implementation.ˆà
    102ˆàˆà
    103ˆà'''Attention''': The various available versions of these dependencies are not necessarily interchangable, so please pay attention to the version numbers above. If you are having trouble getting Trac to work please double-check all the dependencies before asking for help on the [trac:MailingList MailingList] or [trac:IrcChannel IrcChannel].ˆà
    ˆà94A web server is optional because Trac is shipped with a server included, see the [#RunningtheStandaloneServer Running the Standalone Server ] section below.ˆà
    ˆà95ˆà
    ˆà96Alternatively you configure Trac to run in any of the following environments.ˆà
    ˆà97 * [http://httpd.apache.org/ Apache] with ˆà
    ˆà98   - [http://code.google.com/p/modwsgi/ mod_wsgi], see [wiki:TracModWSGI] (preferred)ˆà
    ˆà99   - //[http://modpython.org/ mod_python 3.3.1], see TracModPython (deprecated)//ˆà
    ˆà100 * any [http://www.fastcgi.com/ FastCGI]-capable web server, see TracFastCgiˆà
    ˆà101 * any [http://tomcat.apache.org/connectors-doc/ajp/ajpv13a.html AJP]-capable webˆà
    ˆà102   server, see [trac:TracOnWindowsIisAjp]ˆà
    ˆà103 * IIS with [http://code.google.com/p/isapi-wsgi/ Isapi-wsgi], see [trac:TracOnWindowsIisIsapi]ˆà
    ˆà104 * //as a last resort, a CGI-capable web server (see TracCgi), but usage of Trac as a cgi script ˆà
    ˆà105   is highly discouraged, better use one of the previous options.//ˆà
    ˆà106   ˆà
    ˆà107ˆà
    ˆà108==== Other Python Packages ====ˆà
    ˆà109ˆà
    ˆà110 * [http://babel.edgewall.org Babel], version 0.9.5, ˆà
    ˆà111   needed for localization support[[BR]]ˆà
    ˆà112   ''Note: '' If you want to be able to use the Trac interface in other languages, then make sure you first have installed the optional package Babel. Lacking Babel, you will only get the default english version, as usual. If you install Babel later on, you will need to re-install Trac. ˆà
    ˆà113 * [http://docutils.sourceforge.net/ docutils], version >= 0.3.9 ˆà
    ˆà114   for WikiRestructuredText.ˆà
    ˆà115 * [http://pygments.pocoo.org Pygments] for ˆà
    ˆà116   [wiki:TracSyntaxColoring syntax highlighting].ˆà
    ˆà117   [http://silvercity.sourceforge.net/ SilverCity] and/or ˆà
    ˆà118   [http://gnu.org/software/enscript/enscript.html Enscript] may still be usedˆà
    ˆà119   but are deprecated and you really should be using Pygments.ˆà
    ˆà120 * [http://pytz.sf.net pytz] to get a complete list of time zones,ˆà
    ˆà121   otherwise Trac will fall back on a shorter list from ˆà
    ˆà122   an internal time zone implementation.ˆà
    ˆà123ˆà
    ˆà124'''Attention''': The various available versions of these dependencies are not necessarily interchangable, so please pay attention to the version numbers above. If you are having trouble getting Trac to work please double-check all the dependencies before asking for help on the [trac:MailingList] or [trac:IrcChannel].ˆà
    104125ˆà
    105126Please 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'' (there are even some pages that are still talking about Trac 0.8!).ˆà
    106127ˆà
    ˆà128ˆà
    107129== Installing Trac ==ˆà
    108ˆàˆà
    109ˆàOne way to install Trac is using `setuptools`.ˆà
    110ˆàWith setuptools you can install Trac from the subversion repository; for example,ˆà
    111ˆàto install release version 0.11 do:ˆà
    112ˆà{{{ˆà
    113ˆàeasy_install http://svn.edgewall.org/repos/trac/tags/trac-0.11ˆà
    114ˆà}}}ˆà
    115ˆàˆà
    116ˆàBut of course the python-typical setup at the top of the source directory also works:ˆà
    ˆà130=== Using `easy_install`ˆà
    ˆà131One way to install Trac is using [http://pypi.python.org/pypi/setuptools setuptools].ˆà
    ˆà132With setuptools you can install Trac from the subversion repository; ˆà
    ˆà133ˆà
    ˆà134A few examples:ˆà
    ˆà135ˆà
    ˆà136 - first install of the latest stable version Trac 0.12.3, with i18n support:ˆà
    ˆà137   {{{ˆà
    ˆà138   easy_install Babel==0.9.5ˆà
    ˆà139   easy_install Trac==0.12ˆà
    ˆà140   }}}ˆà
    ˆà141   ''It's very important to run the two `easy_install` commands separately, otherwise the message catalogs won't be generated.''ˆà
    ˆà142ˆà
    ˆà143 - upgrade to the latest stable version of Trac:ˆà
    ˆà144   {{{ˆà
    ˆà145   easy_install -U Tracˆà
    ˆà146   }}}ˆà
    ˆà147ˆà
    ˆà148 - upgrade to the latest trunk development version:ˆà
    ˆà149   {{{ˆà
    ˆà150   easy_install -U Trac==devˆà
    ˆà151   }}}ˆà
    ˆà152ˆà
    ˆà153For upgrades, reading the TracUpgrade page is mandatory, of course.ˆà
    ˆà154ˆà
    ˆà155=== From sourceˆà
    ˆà156If you want more control, you can download the source in archive form, or do a checkout from one of the official [[Trac:TracRepositories|source code repositories]].ˆà
    ˆà157ˆà
    ˆà158Be sure to have the prerequisites already installed. You can also obtain the Genshi and Babel source packages from http://www.edgewall.org and follow for them a similar installation procedure, or you can just `easy_install` those, see [#Usingeasy_install above].ˆà
    ˆà159ˆà
    ˆà160Once you've unpacked the Trac archive or performed the checkout, move in the top-level folder and do:ˆà
    117161{{{ˆà
    118162$ python ./setup.py installˆà
    119163}}}ˆà
    120164ˆà
    121ˆà''Note: you'll need root permissions or equivalent for this step.''ˆà
    ˆà165You'll need root permissions or equivalent for this step.ˆà
    122166ˆà
    123167This will byte-compile the python source code and install it as an .egg file or folder in the `site-packages` directoryˆà
    òÀæ òÀæ ˆà
    126170The script will also install the [wiki:TracAdmin trac-admin] command-line tool, used to create and maintain [wiki:TracEnvironment project environments], as well as the [wiki:TracStandalone tracd] standalone server.ˆà
    127171ˆà
    128ˆà==== Advanced Options ====ˆà
    ˆà172If 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):ˆà
    ˆà173{{{ˆà
    ˆà174$ python ./setup.py installˆà
    ˆà175}}}ˆà
    ˆà176Alternatively, you can do a `bdist_egg` and copy the .egg from dist/ to the place of your choice, or you can create a Windows installer (`bdist_wininst`).ˆà
    ˆà177ˆà
    ˆà178=== Advanced Options ===ˆà
    ˆà179ˆà
    ˆà180==== Custom location with `easy_install`ˆà
    129181ˆà
    130182To install Trac to a custom location, or find out about other advanced installation options, run:ˆà
    òÀæ òÀæ ˆà
    143195easy_install --prefix=/usr/local --install-dir=/Library/Python/2.5/site-packagesˆà
    144196}}}ˆà
    ˆà197Note: 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.6/site-packages }}} by defaultˆà
    145198ˆà
    146199The 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.ˆà
    147200ˆà
    ˆà201==== Using `pip`ˆà
    ˆà202'pip' is an easy_install replacement that is very useful to quickly install python packages.ˆà
    ˆà203To get a trac installation up and running in less than 5 minutes:ˆà
    ˆà204ˆà
    ˆà205Assuming you want to have your entire pip installation in /opt/user/trac:ˆà
    ˆà206ˆà
    ˆà207 - ˆà
    ˆà208{{{ˆà
    ˆà209pip -E /opt/user/trac install trac psycopg2 ˆà
    ˆà210}}}ˆà
    ˆà211orˆà
    ˆà212 - ˆà
    ˆà213{{{ˆà
    ˆà214pip -E /opt/user/trac install trac mysql-python ˆà
    ˆà215}}}ˆà
    ˆà216ˆà
    ˆà217Make sure your OS specific headers are available for pip to automatically build PostgreSQL (libpq-dev) or MySQL (libmysqlclient-dev) bindings.ˆà
    ˆà218ˆà
    ˆà219pip will automatically resolve all dependencies (like Genshi, pygments, etc.) and download the latest packages on pypi.python.org and create a self contained installation in /opt/user/trac .ˆà
    ˆà220ˆà
    ˆà221All 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)ˆà
    ˆà222ˆà
    ˆà223Additionally, you can install several trac plugins (listed [http://pypi.python.org/pypi?:action=search&term=trac&submit=search here]) through pip.ˆà
    ˆà224ˆà
    ˆà225ˆà
    ˆà226ˆà
    148227== Creating a Project Environment ==ˆà
    149228ˆà
    150ˆàA [wiki: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 configuration file and various other files and directories.ˆà
    ˆà229A [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.ˆà
    151230ˆà
    152231A new environment is created using [wiki:TracAdmin trac-admin]:ˆà
    òÀæ òÀæ ˆà
    155234}}}ˆà
    156235ˆà
    157ˆà[wiki:TracAdmin trac-admin] will prompt you for the information it needs to create the environment, such as the name of the project, the type and the path to an existing [wiki:TracEnvironment#SourceCodeRepository source code repository], the [wiki:TracEnvironment#DatabaseConnectionStrings database connection string], and so on. If you're not sure what to specify for one of these options, just leave it blank to use the default value. The database connection string in particular will always work as long as you have SQLite installed. Leaving the path to the source code repository empty will disable any functionality related to version control, but you can always add that back when the basic system is running.ˆà
    158ˆàˆà
    159ˆàAlso note that the values you specify here can be changed later by directly editing the [wiki:TracIni] configuration file.ˆà
    160ˆàˆà
    161ˆà''Note: The user account under which the web server runs will require write permissions to the environment directory and all the files inside.  On Linux, with the web server running as user apache and group apache, enter:''ˆà
    162ˆàˆà
    163ˆà  chown -R apache.apache /path/to/myprojectˆà
    164ˆàˆà
    165ˆà== Running the Standalone Server ==ˆà
    ˆà236[TracAdmin trac-admin] will prompt you for the information it needs to create the environment, such as the name of the project and the [TracEnvironment#DatabaseConnectionStrings database connection string]. If you're not sure what to specify for one of these options, just press `<Enter>` to use the default value. ˆà
    ˆà237ˆà
    ˆà238Using the default database connection string in particular will always work as long as you have SQLite installed.ˆà
    ˆà239For the other [DatabaseBackend database backends] you should plan ahead and already have a database ready to use at this point.ˆà
    ˆà240ˆà
    ˆà241Since 0.12, Trac doesn't ask for a [TracEnvironment#SourceCodeRepository source code repository] anymore when creating an environment. Repositories can be [TracRepositoryAdmin added] afterward, or the version control support can be disabled completely if you don't need it.ˆà
    ˆà242ˆà
    ˆà243Also note that the values you specify here can be changed later by directly editing the [TracIni conf/trac.ini] configuration file.ˆà
    ˆà244ˆà
    ˆà245Finally, 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:ˆà
    ˆà246{{{ˆà
    ˆà247# chown -R apache.apache /path/to/myprojectˆà
    ˆà248}}}ˆà
    ˆà249ˆà
    ˆà250{{{#!div class=importantˆà
    ˆà251'''Warning:''' Please only use ASCII-characters for account name and project path, unicode characters are not supported there.ˆà
    ˆà252}}}ˆà
    ˆà253ˆà
    ˆà254ˆà
    ˆà255== Deploying Tracˆà
    ˆà256ˆà
    ˆà257=== Running the Standalone Server ===ˆà
    166258ˆà
    167259After having created a Trac environment, you can easily try the web interface by running the standalone server [wiki:TracStandalone tracd]:ˆà
    òÀæ òÀæ ˆà
    170262}}}ˆà
    171263ˆà
    172ˆà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:ˆà
    ˆà264Then, 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:ˆà
    173265{{{ˆà
    174266$ tracd -s --port 8000 /path/to/myprojectˆà
    175267}}}ˆà
    176268ˆà
    177ˆà== Running Trac on a Web Server ==ˆà
    178ˆàˆà
    179ˆàTrac provides three options for connecting to a "real" web server: [wiki:TracCgi CGI], [wiki:TracFastCgi FastCGI] and [wiki:TracModPython mod_python]. For decent performance, it is recommended that you use either FastCGI or mod_python.ˆà
    180ˆàˆà
    181ˆàIf you're not afraid of running newer code, you can also try running Trac on [wiki:TracModWSGI mod_wsgi]. This should deliver even better performance than mod_python, but the module isn't as extensively tested as mod_python.ˆà
    182ˆàˆà
    183ˆàTrac also supports [trac:TracOnWindowsIisAjp AJP] which may be your choice if you want to connect to IIS.ˆà
    184ˆàˆà
    185ˆà==== Generating the Trac cgi-bin directory ====ˆà
    186ˆàˆà
    187ˆàIn order for Trac to function properly with FastCGI or mod_python, you need to have a trac.cgi file. This is an executable which loads the appropriate Python code. It can be generated using the `deploy` option of [wiki:TracAdmin trac-admin].ˆà
    ˆà269=== Running Trac on a Web Server ===ˆà
    ˆà270ˆà
    ˆà271Trac provides various options for connecting to a "real" web server: ˆà
    ˆà272 - [wiki:TracFastCgi FastCGI]ˆà
    ˆà273 - [wiki:TracModWSGI mod_wsgi] ˆà
    ˆà274 - //[wiki:TracModPython mod_python] (no longer recommended, as mod_python is not actively maintained anymore)//ˆà
    ˆà275 - //[wiki:TracCgi CGI] (should not be used, as the performance is far from optimal)//ˆà
    ˆà276ˆà
    ˆà277Trac 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.ˆà
    ˆà278ˆà
    ˆà279==== Generating the Trac cgi-bin directory ==== #cgi-binˆà
    ˆà280ˆà
    ˆà281In 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].ˆà
    188282ˆà
    189283There 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:ˆà
    òÀæ òÀæ ˆà
    195289}}}ˆà
    196290ˆà
    ˆà291ˆà
    ˆà292==== Mapping Static Resources ====ˆà
    ˆà293ˆà
    ˆà294Out 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).ˆà
    ˆà295ˆà
    ˆà296Web 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.ˆà
    ˆà297ˆà
    ˆà298There 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.ˆà
    ˆà299ˆà
    ˆà300Note that in order to get those static resources on the filesystem, you need first to extract the relevant resources from Trac using the [TracAdmin trac-admin]` <environment> deploy` command:ˆà
    ˆà301[[TracAdminHelp(deploy)]]ˆà
    ˆà302ˆà
    ˆà303The target `<directory>` will then contain an `htdocs` directory with:ˆà
    ˆà304 - `site/` - a copy of the environment's directory `htdocs/` ˆà
    ˆà305 - `common/` - the static resources of Trac itselfˆà
    ˆà306 - `<plugins>/` - one directory for each resource directory managed by the plugins enabled for this environmentˆà
    ˆà307ˆà
    ˆà308===== Example: Apache and `ScriptAlias` ===== #ScriptAlias-exampleˆà
    ˆà309ˆà
    ˆà310Assuming the deployment has been done this way:ˆà
    ˆà311{{{ˆà
    ˆà312$ trac-admin /var/trac/env deploy /path/to/trac/htdocs/commonˆà
    ˆà313}}}ˆà
    ˆà314ˆà
    ˆà315Add 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:ˆà
    ˆà316{{{ˆà
    ˆà317Alias /trac/chrome/common /path/to/trac/htdocs/commonˆà
    ˆà318Alias /trac/chrome/site /path/to/trac/htdocs/siteˆà
    ˆà319ˆà
    ˆà320<Directory "/path/to/www/trac/htdocs">ˆà
    ˆà321  Order allow,denyˆà
    ˆà322  Allow from allˆà
    ˆà323</Directory>ˆà
    ˆà324}}}ˆà
    ˆà325ˆà
    ˆà326If using mod_python, you might want to add this too (otherwise, the alias will be ignored):ˆà
    ˆà327{{{ˆà
    ˆà328<Location "/trac/chrome/common/">ˆà
    ˆà329  SetHandler Noneˆà
    ˆà330</Location>ˆà
    ˆà331}}}ˆà
    ˆà332ˆà
    ˆà333Note that we mapped `/trac` part of the URL to the `trac.*cgi` script, and the path `/trac/chrome/common` is the path you have to append to that location to intercept requests to the static resources. ˆà
    ˆà334ˆà
    ˆà335Similarly, 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):ˆà
    ˆà336{{{ˆà
    ˆà337Alias /trac/chrome/site /path/to/projectenv/htdocsˆà
    ˆà338ˆà
    ˆà339<Directory "/path/to/projectenv/htdocs">ˆà
    ˆà340  Order allow,denyˆà
    ˆà341  Allow from allˆà
    ˆà342</Directory>ˆà
    ˆà343}}}ˆà
    ˆà344ˆà
    ˆà345Alternatively 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:ˆà
    ˆà346{{{ˆà
    ˆà347[trac]ˆà
    ˆà348htdocs_location = http://static.example.org/trac-common/ˆà
    ˆà349}}}ˆà
    ˆà350Note 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]).ˆà
    ˆà351ˆà
    ˆà352Of 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:ˆà
    ˆà353{{{ˆà
    ˆà354$ ln -s /path/to/trac/htdocs/common /var/www/static.example.org/trac-commonˆà
    ˆà355}}}ˆà
    ˆà356ˆà
    ˆà357ˆà
    197358==== Setting up the Plugin Cache ====ˆà
    198359ˆà
    199ˆà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.ˆà
    ˆà360Some 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.ˆà
    200361ˆà
    201362== Configuring Authentication ==ˆà
    202363ˆà
    203ˆàThe process of adding, removing, and configuring user accounts for authentication depends on the specific way you run Trac. The basic procedure is described in the [wiki:TracCgi#AddingAuthentication "Adding Authentication"] section on the TracCgi page. To learn how to setup authentication for the frontend you're using, please refer to one of the following pages:ˆà
    204ˆàˆà
    205ˆà * TracStandalone if you use the standalone server, `tracd`.ˆà
    206ˆà * TracCgi if you use the CGI or FastCGI methods.ˆà
    207ˆà * TracModPython if you use the mod_python method.ˆà
    208ˆàˆà
    209ˆà== Automatic reference to the SVN changesets in Trac tickets ==ˆà
    210ˆàˆà
    211ˆàYou can configure SVN to automatically add a reference to the changeset into the ticket comments, whenever files are committed to the repository. The description of the commit needs to contain one of the following formulas:ˆà
    212ˆà * '''Refs #123''' - to reference this changeset in #123 ticketˆà
    213ˆà * '''Fixes #123''' - to reference this changeset and close #123 ticket with the default status ''fixed''ˆà
    214ˆàˆà
    215ˆàAll you have to do is to edit the ''post-commit'' hook in your SVN repository and make it execute ''trac-post-commit-hook'' coming with Trac.ˆà
    216ˆàˆà
    217ˆàIf you are editing the ''post-commit'' hook for the first time you need to navigate to your SVN repository's hooks subfolder and rename existing there ''post-commit'' template:ˆà
    218ˆàˆà
    219ˆà{{{ˆà
    220ˆà$ cd /path/to/svn/repository/hooksˆà
    221ˆà$ mv post-commit.tmpl post-commitˆà
    222ˆà$ chmod 755 post-commitˆà
    223ˆà}}}ˆà
    224ˆàˆà
    225ˆàNext open it in any text editor and add a line with path to the Trac environment connected with this SVN repository and another line executing the ''trac-post-commit-hook'' script:ˆà
    226ˆàˆà
    227ˆà{{{ˆà
    228ˆàREPOS="$1"ˆà
    229ˆàREV="$2"ˆà
    230ˆàTRAC_ENV="/path/to/your/trac/project"ˆà
    231ˆàˆà
    232ˆà/usr/bin/python /usr/local/bin/trac-post-commit-hook -p "$TRAC_ENV" -r "$REV"ˆà
    233ˆà}}}ˆà
    234ˆàˆà
    235ˆàMake sure that ''trac-post-commit-hook'' exists in above path with execution permissions for the same user which SVN is running from. This script can be found in contrib subfolder of your Trac distribution and the latest version can be always downloaded from [source:trunk/contrib/trac-post-commit-hook].ˆà
    236ˆàˆà
    237ˆàˆà
    238ˆà== Platform-specifics installations ==ˆà
    239ˆàˆà
    240ˆà * See [trac:TracInstallPlatforms TracInstallPlatforms]ˆà
    241ˆà ˆà
    242ˆàˆà
    243ˆà== Using Trac ==ˆà
    244ˆàˆà
    245ˆàOnce you have your Trac site up and running, you should be able to browse your subversion repository, create tickets, view the timeline, etc.ˆà
    246ˆàˆà
    247ˆàKeep in mind that anonymous (not logged in) users can by default access most but not all of the features. You will need to configure authentication and grant additional [wiki:TracPermissions permissions] to authenticated users to see the full set of features.ˆà
    ˆà364Trac 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.ˆà
    ˆà365ˆà
    ˆà366The process of adding, removing, and configuring user accounts for authentication depends on the specific way you run Trac. ˆà
    ˆà367ˆà
    ˆà368Please refer to one of the following sections:ˆà
    ˆà369 * TracStandalone#UsingAuthentication if you use the standalone server, `tracd`.ˆà
    ˆà370 * [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`.ˆà
    ˆà371 * TracFastCgi if you're using another web server with FCGI support (Cherokee, Lighttpd, !LiteSpeed, nginx)ˆà
    ˆà372ˆà
    ˆà373== Granting admin rights to the admin userˆà
    ˆà374Grant admin rights to user admin:ˆà
    ˆà375{{{ˆà
    ˆà376$ trac-admin /path/to/myproject permission add admin TRAC_ADMINˆà
    ˆà377}}}ˆà
    ˆà378This user will have an "Admin" entry menu that will allow you to admin your trac project.ˆà
    ˆà379ˆà
    ˆà380== Finishing the installˆà
    ˆà381ˆà
    ˆà382=== Automatic reference to the SVN changesets in Trac tickets ===ˆà
    ˆà383ˆà
    ˆà384You 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:ˆà
    ˆà385 * '''`Refs #123`''' - to reference this changeset in `#123` ticketˆà
    ˆà386 * '''`Fixes #123`''' - to reference this changeset and close `#123` ticket with the default status ''fixed''ˆà
    ˆà387ˆà
    ˆà388This 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.ˆà
    ˆà389{{{ˆà
    ˆà390tracopt.ticket.commit_updater.* = enabledˆà
    ˆà391}}}ˆà
    ˆà392For more information, see the documentation of the `CommitTicketUpdater` component in the "Plugins" admin panel.ˆà
    ˆà393ˆà
    ˆà394=== Using Trac ===ˆà
    ˆà395ˆà
    ˆà396Once 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.ˆà
    ˆà397ˆà
    ˆà398Keep in mind that //anonymous// (not logged in) users can by default access only a few of the features, in particular they will have a read-only access to the resources. You will need to configure authentication and grant additional [wiki:TracPermissions permissions] to authenticated users to see the full set of features.ˆà
    248399ˆà
    249400'' Enjoy! ''ˆà
    òÀæ òÀæ ˆà
    252403ˆà
    253404----ˆà
    254ˆàSee also: [trac:TracInstallPlatforms TracInstallPlatforms], TracGuide, TracCgi, TracFastCgi, TracModPython, [wiki:TracModWSGI], TracUpgrade, TracPermissionsˆà
    255ˆàˆà
    ˆà405See also: [trac:TracInstallPlatforms TracInstallPlatforms], TracGuide, TracUpgrade, TracPermissionsˆà