# Changes between Version 4 and Version 5 of TracInstall

Ignore:
Timestamp:
Apr 18, 2013 10:02:31 AM (9 years ago)
Comment:

--

### Legend:

Unmodified
 v4 = Trac Installation Guide for 0.12 = = Trac Installation Guide for 1.0 = [[TracGuideToc]] Trac 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. Since 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. If 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]. What 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. Since 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 have installed the optional package [#OtherPythonPackages Babel]. Pay attention to the extra steps for localization support in the [#InstallingTrac Installing Trac] section below. Lacking Babel, you will only get the default english version, as usual. If you're interested in contributing new translations for other languages or enhance the existing translations, then please have a look at [[trac:TracL10N]]. What 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: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. [[PageOutline(2-3,Installation Steps,inline)]] To install Trac, the following software packages must be installed: * [http://www.python.org/ Python], version >= 2.4 and < 3.0 //(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)// * [http://peak.telecommunity.com/DevCenter/setuptools setuptools], version >= 0.6 * [http://genshi.edgewall.org/wiki/Download Genshi], version >= 0.6 (but < 0.7dev, i.e. don't use Genshi trunk) * [http://www.python.org/ Python], version >= 2.5 and < 3.0 (note that we dropped the support for Python 2.4 in this release) * [http://peak.telecommunity.com/DevCenter/setuptools setuptools], version >= 0.6, or better yet, [http://pypi.python.org/pypi/distribute distribute] * [http://genshi.edgewall.org/wiki/Download Genshi], version >= 0.6 (unreleased version 0.7dev should work as well) You also need a database system and the corresponding python bindings. ==== For the SQLite database #ForSQLite If you're using Python 2.5 or 2.6, you already have everything you need. If you're using Python 2.4 and need pysqlite, you can download from [http://code.google.com/p/pysqlite/downloads/list google code] the Windows installers or the tar.gz archive for building from source: As you must be using Python 2.5, 2.6 or 2.7, you already have the SQLite database bindings bundled with the standard distribution of Python (the sqlite3 module). However, if you'd like, you can download the latest and greatest version of [[trac:Pysqlite]] from [http://code.google.com/p/pysqlite/downloads/list google code], where you'll find the Windows installers or the tar.gz archive for building from source: {{{ $tar xvfz .tar.gz }}} This will extract the SQLite code and build the bindings. To install SQLite, your system may require the development headers. Without these you will get various GCC related errors when attempting to build: {{{$ apt-get install libsqlite3-dev }}} SQLite 2.x is no longer supported, and neither is !PySqlite 1.1.x. A known bug !PySqlite versions 2.5.2-4 prohibits upgrade of trac databases This will download the latest SQLite code and build the bindings. SQLite 2.x is no longer supported. A known bug PySqlite versions 2.5.2-4 prohibits upgrade of trac databases from 0.11.x to 0.12. Please use versions 2.5.5 and newer or 2.5.1 and older. See [trac:#9434] for more detail. See additional information in [trac:PySqlite]. older. See #9434 for more detail. See additional information in [trac:PySqlite PySqlite]. ==== For the PostgreSQL database #ForPostgreSQL ===== Subversion ===== [http://subversion.apache.org/ Subversion] 1.5.x or 1.6.x and the '''''corresponding''''' Python bindings. There 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. Older 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). * [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. There 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. TracSubversion points you to [http://alagazam.net Algazam], which works for me under Python 2.6.) Note that Trac '''doesn't''' use [http://pysvn.tigris.org/ PySVN], neither does it work yet with the newer ctype-style bindings. '''Please note:''' if using Subversion, Trac must be installed on the '''same machine'''. Remote repositories are currently [trac:#493 not supported]. '''Please note:''' if using Subversion, Trac must be installed on the '''same machine'''. Remote repositories are currently [trac:ticket:493 not supported]. ===== Others ===== Support for other version control systems is provided via third-parties. See [trac:PluginList] and [trac:VersioningSystemBackend]. Support for other version control systems is provided via third-parties. See [trac:PluginList] and [trac:VersionControlSystem]. ==== Web Server ==== Alternatively you configure Trac to run in any of the following environments. * [http://httpd.apache.org/ Apache] with - [http://code.google.com/p/modwsgi/ mod_wsgi], see [wiki:TracModWSGI] (preferred) - //[http://modpython.org/ mod_python 3.3.1], see TracModPython (deprecated)// * any [http://www.fastcgi.com/ FastCGI]-capable web server, see TracFastCgi * any [http://tomcat.apache.org/connectors-doc/ajp/ajpv13a.html AJP]-capable web server, see [trac:TracOnWindowsIisAjp] * IIS with [http://code.google.com/p/isapi-wsgi/ Isapi-wsgi], see [trac:TracOnWindowsIisIsapi] * //as a last resort, a CGI-capable web server (see TracCgi), but usage of Trac as a cgi script is highly discouraged, better use one of the previous options.// - [http://code.google.com/p/modwsgi/ mod_wsgi], see [wiki:TracModWSGI] and http://code.google.com/p/modwsgi/wiki/IntegrationWithTrac - [http://modpython.org/ mod_python 3.3.1], deprecated: see TracModPython) * a [http://www.fastcgi.com/ FastCGI]-capable web server (see TracFastCgi) * an [http://tomcat.apache.org/connectors-doc/ajp/ajpv13a.html AJP]-capable web server (see [trac:TracOnWindowsIisAjp TracOnWindowsIisAjp]) * a CGI-capable web server (see TracCgi), '''but usage of Trac as a cgi script is highly discouraged''', better use one of the previous options. ==== Other Python Packages ==== * [http://babel.edgewall.org Babel], version 0.9.5, needed for localization support[[BR]] ''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. * [http://babel.edgewall.org Babel], version >= 0.9.5, needed for localization support (unreleased version 1.0dev should work as well) * [http://docutils.sourceforge.net/ docutils], version >= 0.3.9 for WikiRestructuredText. A few examples: - first install of the latest stable version Trac 0.12.2, with i18n support: - install Trac 1.0: {{{ easy_install Babel==0.9.5 easy_install Trac easy_install Trac==1.0 }}} ''It's very important to run the two easy_install commands separately, otherwise the message catalogs won't be generated.'' - upgrade to the latest stable version of Trac: (NOT YET ENABLED) - install latest development version 1.0dev: {{{ easy_install -U Trac easy_install Trac==dev }}} - upgrade to the latest trunk development version (0.13dev): {{{ easy_install -U Trac==dev }}} For upgrades, reading the TracUpgrade page is mandatory, of course. Note that in this case you won't have the possibility to run a localized version of Trac; either use a released version or install from source === Using pip 'pip' is an easy_install replacement that is very useful to quickly install python packages. To get a trac installation up and running in less than 5 minutes: Assuming you want to have your entire pip installation in /opt/user/trac - {{{ pip -E /opt/user/trac install trac psycopg2 }}} or - {{{ pip -E /opt/user/trac install trac mysql-python }}} Make sure your OS specific headers are available for pip to automatically build PostgreSQL (libpq-dev) or MySQL (libmysqlclient-dev) bindings. pip 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. 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) Additionally, you can install several trac plugins (listed [http://pypi.python.org/pypi?:action=search&term=trac&submit=search here]) through pip. === From source If 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]]. Be 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]. Once you've unpacked the Trac archive or performed the checkout, move in the top-level folder and do: Of course, using 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), or you can get the source directly from the repository (see Trac:SubversionRepository for details). {{{ \$ python ./setup.py install }}} You'll need root permissions or equivalent for this step. ''You'll need root permissions or equivalent for this step.'' This will byte-compile the python source code and install it as an .egg file or folder in the site-packages directory === Advanced Options === ==== Custom location with easy_install To install Trac to a custom location, or find out about other advanced installation options, run: {{{ The 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. ==== Using pip 'pip' is an easy_install replacement that is very useful to quickly install python packages. To get a trac installation up and running in less than 5 minutes: Assuming you want to have your entire pip installation in /opt/user/trac: - {{{ pip -E /opt/user/trac install trac psycopg2 }}} or - {{{ pip -E /opt/user/trac install trac mysql-python }}} Make sure your OS specific headers are available for pip to automatically build PostgreSQL (libpq-dev) or MySQL (libmysqlclient-dev) bindings. pip 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 . 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) Additionally, you can install several trac plugins (listed [http://pypi.python.org/pypi?:action=search&term=trac&submit=search here]) through pip.