Changes between Version 407 and Version 408 of TracInstall
- Timestamp:
- Apr 26, 2015, 12:02:23 AM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracInstall
v407 v408 1 1 = Trac Installation Guide for 1.0 2 2 3 [[TracGuideToc]] 3 4 [[TranslatedPages]] … … 14 15 15 16 == Dependencies 17 16 18 === Mandatory Dependencies 19 17 20 To install Trac, the following software packages must be installed: 18 21 … … 45 48 * [http://sf.net/projects/mysql-python MySQLdb], version 1.2.2 or later 46 49 47 Given the caveats and known issues surrounding MySQL, read carefully the [trac:MySqlDb] page before creating the database. 50 Given the caveats and known issues surrounding MySQL, read the [trac:MySqlDb] page before creating the database. 51 52 The drop-in replacements [https://mariadb.org/ MariaDB] and [http://www.percona.com/ Percona] are also known to work instead of MySQL (see [trac:TracDev/ApiChanges/1.1]). 48 53 49 54 === Optional Dependencies … … 52 57 53 58 ===== Subversion 54 * [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.59 * [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. 55 60 56 61 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. [trac:TracSubversion] points you to [http://alagazam.net Alagazam], which works for me under Python 2.6.) … … 58 63 Note that Trac '''doesn't''' use [http://pysvn.tigris.org/ PySVN], neither does it work yet with the newer `ctype`-style bindings. 59 64 60 ''' Please note:''' if using Subversion, Trac must be installed on the '''same machine'''. Remote repositories are currently [trac:ticket:493 not supported].65 '''Note:''' if using Subversion, Trac must be installed on the '''same machine'''. Remote repositories are currently [trac:ticket:493 not supported]. 61 66 62 67 ===== Git … … 70 75 71 76 ==== Web Server 72 A web server is optional because Trac is shipped with a server included, see the [#RunningtheStandaloneServer Running the Standalone Server] section below. 77 78 A web server is optional because Trac has a server included, see the [#RunningtheStandaloneServer Running the Standalone Server] section below. 73 79 74 80 Alternatively you can configure Trac to run in any of the following environments: … … 81 87 server (see [trac:TracOnWindowsIisAjp TracOnWindowsIisAjp]) 82 88 * a FastCGI and FastCGI-to-WSGI gateway (see [trac:TracOnWindowsIisWfastcgi]) 83 * a CGI-capable web server (see TracCgi), '''but usage of Trac as a cgi script84 is highly discouraged ''', better use one of the previous options.89 * a CGI-capable web server (see TracCgi), but usage of Trac as a cgi script 90 is highly discouraged, better use one of the previous options. 85 91 86 87 92 ==== Other Python Packages 88 93 … … 104 109 }}} 105 110 106 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''.111 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. 107 112 108 113 == Installing Trac … … 111 116 112 117 === Using `easy_install` 113 Trac can be installed from PyPI or the Subversion repository using [http://pypi.python.org/pypi/setuptools setuptools]. 114 115 A few examples: 118 119 Trac can be installed from [https://pypi.python.org/pypi PyPI] or the Subversion repository using [pypi:setuptools setuptools]. 120 121 A few command-line examples: 116 122 117 123 - Install Trac 1.0: … … 124 130 }}} 125 131 Note that in this case you won't have the possibility to run a localized version of Trac; 126 either use a released version or install from source 132 either use a released version or install from source. 127 133 128 134 More information can be found on the [trac:setuptools] page. … … 133 139 134 140 === Using `pip` 135 'pip' is an easy_install replacement that is very useful to quickly install python packages. 141 142 'pip' is an easy_install replacement that is very useful to quickly install Python packages. 136 143 To get a Trac installation up and running in less than 5 minutes: 137 144 138 Assuming you want to have your entire pip installation in `/opt/user/trac` 145 Assuming you want to have your entire pip installation in `/opt/user/trac`: 139 146 140 147 - … … 142 149 pip install trac psycopg2 143 150 }}} 144 or 151 or: 145 152 - 146 153 {{{#!sh … … 152 159 pip 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`. 153 160 154 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) 161 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). 155 162 156 163 Additionally, you can install several Trac plugins (listed [https://pypi.python.org/pypi?:action=browse&show=all&c=516 here]) through pip. 157 164 158 165 === From source 166 159 167 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`) from the [trac:TracDownload] page, or you can get the source directly from the repository. See [trac:TracRepositories#OfficialSubversionrepository TracRepositories] for details. 160 168 161 169 {{{#!sh 162 $python ./setup.py install163 }}} 164 165 ''You will need root permissions or equivalent for this step.'' 170 python ./setup.py install 171 }}} 172 173 You will need root permissions or equivalent for this step. 166 174 167 175 This will byte-compile the Python source code and install it as an .egg file or folder in the `site-packages` directory … … 170 178 If 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): 171 179 {{{#!sh 172 $ python ./setup.py install 173 }}} 180 python ./setup.py install 181 }}} 182 174 183 Alternatively, 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`). 175 184 … … 195 204 easy_install --prefix=/path/to/installdir 196 205 }}} 206 197 207 or, if installing Trac on a Mac OS X system: 198 208 {{{#!sh 199 209 easy_install --prefix=/usr/local --install-dir=/Library/Python/2.5/site-packages 200 210 }}} 201 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. 211 212 '''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. 202 213 203 214 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. … … 209 220 A new environment is created using [TracAdmin trac-admin]: 210 221 {{{#!sh 211 $trac-admin /path/to/myproject initenv222 trac-admin /path/to/myproject initenv 212 223 }}} 213 224 … … 227 238 Finally, 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: 228 239 {{{#!sh 229 $chown -R apache.apache /path/to/myproject230 }}} 231 232 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).240 chown -R apache.apache /path/to/myproject 241 }}} 242 243 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). 233 244 234 245 {{{#!div class=important … … 242 253 After having created a Trac environment, you can easily try the web interface by running the standalone server [TracStandalone tracd]: 243 254 {{{#!sh 244 $tracd --port 8000 /path/to/myproject255 tracd --port 8000 /path/to/myproject 245 256 }}} 246 257 247 258 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: 248 259 {{{#!sh 249 $tracd -s --port 8000 /path/to/myproject260 tracd -s --port 8000 /path/to/myproject 250 261 }}} 251 262 … … 260 271 Alternatively, the variable can be set in the shell before executing `tracd`: 261 272 {{{#!sh 262 $PKG_RESOURCES_CACHE_ZIP_MANIFESTS=1 tracd --port 8000 /path/to/myproject273 PKG_RESOURCES_CACHE_ZIP_MANIFESTS=1 tracd --port 8000 /path/to/myproject 263 274 }}} 264 275 }}} … … 270 281 - [wiki:TracModWSGI mod_wsgi] 271 282 - [TracModPython mod_python] 272 - //[TracCgi CGI] (should not be used, as the performance is far from optimal)//283 - [TracCgi CGI]: should not be used, as this degrades performance 273 284 274 285 Trac 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. … … 285 296 mv /tmp/deploy/* /usr/share/trac 286 297 }}} 298 287 299 Don't forget to check that the web server has the execution right on scripts in the `/usr/share/trac/cgi-bin` directory. 288 300 289 301 ==== Mapping Static Resources 290 302 291 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).292 293 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.303 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''' as it causes poor performance. 304 305 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. 294 306 295 307 There 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. … … 307 319 Assuming the deployment has been done this way: 308 320 {{{#!sh 309 $trac-admin /var/trac/env deploy /path/to/shared/trac321 trac-admin /var/trac/env deploy /path/to/shared/trac 310 322 }}} 311 323 … … 321 333 }}} 322 334 323 If using mod_python, you might want to add this too (otherwise, the alias will be ignored):335 If using mod_python, you might want to add this too, otherwise the alias will be ignored: 324 336 {{{#!apache 325 337 <Location "/trac/chrome/common/"> … … 345 357 htdocs_location = http://static.example.org/trac-common/ 346 358 }}} 347 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]). 359 360 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]. 348 361 349 362 Of 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: 350 363 {{{#!sh 351 $ln -s /path/to/trac/htdocs/common /var/www/static.example.org/trac-common364 ln -s /path/to/trac/htdocs/common /var/www/static.example.org/trac-common 352 365 }}} 353 366 … … 365 378 * TracStandalone#UsingAuthentication if you use the standalone server, `tracd`. 366 379 * [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`. 367 * TracFastCgi if you 're using another web server with FCGI support (Cherokee, Lighttpd, !LiteSpeed, nginx)380 * TracFastCgi if you are using another web server with FCGI support, such as Cherokee, Lighttpd, !LiteSpeed, nginx. 368 381 369 382 The following document also contains some useful information for beginners: [trac:TracAuthenticationIntroduction]. 370 383 371 384 == Granting admin rights to the admin user 385 372 386 Grant admin rights to user admin: 373 387 {{{#!sh 374 $ trac-admin /path/to/myproject permission add admin TRAC_ADMIN 375 }}} 388 trac-admin /path/to/myproject permission add admin TRAC_ADMIN 389 }}} 390 376 391 This user will have an "Admin" entry menu that will allow you to administrate your Trac project. 377 392 … … 382 397 Support 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. 383 398 384 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 .399 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: 385 400 386 401 {{{#!ini 402 [components] 387 403 tracopt.versioncontrol.svn.* = enabled 388 404 }}} 389 405 390 406 {{{#!ini 407 [components] 391 408 tracopt.versioncontrol.git.* = enabled 392 409 }}}