| 22 | |
| 23 | = Requirements = |
| 24 | |
| 25 | To install Trac, the following software packages must be installed: |
| 26 | |
| 27 | * Python, version >= 2.3. |
| 28 | * setuptools, version >= 0.6 |
| 29 | * Genshi, version >= 0.5 |
| 30 | * Optionally, Subversion, version >= 1.1.x and the Subversion SWIG Python |
| 31 | bindings (not PySVN, that's something different). |
| 32 | * One of the following Python bindings, depending on the database used: |
| 33 | * pysqlite version 2.x for SQLite 3.x (is part of the standard library |
| 34 | starting with Python 2.5) |
| 35 | * psycopg2 version 2.0.x for the PostgreSQL database |
| 36 | * MySQLdb, version 1.2.2 for the MySQL database |
| 37 | * A web server capable of executing CGI/FastCGI scripts, or Apache HTTPD with |
| 38 | mod_python or mod_wsgi. (Trac also comes with a standalone server, tracd) |
| 39 | |
| 40 | Any of the above python library can usually be installed using easy_install, |
| 41 | which itself can be installed using the following bootstrap script: |
| 42 | |
| 43 | $ wget http://peak.telecommunity.com/dist/ez_setup.py |
| 44 | |
| 45 | $ python ez_setup.py |
| 46 | |
| 47 | After that, you can do for example: easy_install Genshi |
| 48 | |
| 49 | If you're using Python 2.3 or 2.4 and need pysqlite, you can download from |
| 50 | http://code.google.com/p/pysqlite/downloads/list the Windows installers or the |
| 51 | tar.gz archive for building from source: |
| 52 | |
| 53 | $ tar xvfz <version>.tar.gz |
| 54 | |
| 55 | $ cd <version> |
| 56 | |
| 57 | $ python setup.py build_static install |
| 58 | |
| 59 | That way, the latest SQLite version will be downloaded and built into the |
| 60 | bindings. |
| 61 | |
| 62 | |
| 63 | = Installing Trac = |
| 64 | --------------- |
| 65 | The command: |
| 66 | |
| 67 | $ python ./setup.py install |
| 68 | |
| 69 | will byte-compile the python source code and install it in the |
| 70 | site-packages directory of your python installation. The directories cgi-bin, |
| 71 | templates, htdocs and wiki-default are all copied to ``$prefix/share/trac/``. |
| 72 | |
| 73 | The script will also install the trac-admin command-line tool, used to create |
| 74 | and maintain project environments. Trac-admin is the command center of Trac. |
| 75 | |
| 76 | Note: you'll need root permissions or equivalent for this step. |
| 77 | |
| 78 | To install Trac in a different location, or use other advanced installation |
| 79 | options, run: |
| 80 | |
| 81 | $ python ./setup.py --help |
| 82 | |
| 83 | |
| 84 | = Installing Trac on Windows = |
| 85 | |
| 86 | |
| 87 | If you downloaded the Trac installer (the .exe file), installing is simply a |
| 88 | matter of running the installer. After running the installer, configuration |
| 89 | and installation is the same as for other platforms. |
| 90 | |
| 91 | |
| 92 | Creating a Project Environment |
| 93 | ------------------------------ |
| 94 | A Trac environment is the backend storage format where Trac stores information |
| 95 | like wiki pages, tickets, reports, settings, etc. A Trac environment consists |
| 96 | of the environment configuration file (trac.ini), custom templates, log files, |
| 97 | and more. |
| 98 | |
| 99 | A new Trac environment is created with trac-admin: |
| 100 | |
| 101 | $ trac-admin /path/to/projectenv initenv |
| 102 | |
| 103 | Note: The user account under which the web server is run needs write permission |
| 104 | to the environment directory and all the files inside. |
| 105 | |
| 106 | trac-admin will prompt you for the name of the project, where your subversion |
| 107 | repository is located, what database you want to use, etc. |
| 108 | |
| 109 | |
| 110 | = Running the Standalone Server = |
| 111 | |
| 112 | After having created a Trac environment, you can easily try the web interface |
| 113 | by running the standalone server tracd: |
| 114 | |
| 115 | $ tracd --port 8000 /path/to/projectenv |
| 116 | |
| 117 | Then, fire up a browser and visit http://localhost:8000/. You should get a |
| 118 | simple listing of all environments that tracd knows about. Follow the link |
| 119 | to the environment you just created, and you should see Trac in action. |
| 120 | |
| 121 | |
| 122 | = Running Trac on a Web Server = |
| 123 | |
| 124 | Trac provides three options for connecting to a "real" web server: CGI, FastCGI |
| 125 | and mod_python. For decent performance, it is recommended that you use either |
| 126 | FastCGI or mod_python. |
| 127 | |
| 128 | Please refer to the TracInstall page for details on these setups. You can find |
| 129 | it either in the wiki of the Trac project you just created, or on the main Trac |
| 130 | site. |
| 131 | |
| 132 | |
| 133 | = Using Trac = |
| 134 | |
| 135 | Once you have your Trac site up and running, you should be able to browse your |
| 136 | subversion repository, create tickets, view the timeline, etc. |
| 137 | |
| 138 | Keep in mind that anonymous (not logged in) users can by default access most |
| 139 | but not all of the features. You will need to configure authentication and |
| 140 | grant additional permissions to authenticated users to see the full set of |
| 141 | features. |
| 142 | |
| 143 | For further documentation, see the TracGuide wiki page. |
| 144 | |
| 145 | |
| 146 | |
| 147 | |