Edgewall Software

Changes between Initial Version and Version 1 of 0.10/TracOnWindows


Ignore:
Timestamp:
Dec 14, 2007, 12:50:25 PM (16 years ago)
Author:
Christian Boos
Comment:

Copied from TracOnWindows@211

Legend:

Unmodified
Added
Removed
Modified
  • 0.10/TracOnWindows

    v1 v1  
     1[[PageOutline(2-3)]]
     2= Trac on Windows =
     3
     4== Install Python ==
     5
     6Trac is written in [http://python.org Python], so you will first need to install Python.
     7
     8The recommended version of Python at this time is 2.4.4.  Many of Trac's dependencies are not available on Windows for Python 2.5, so that version is not yet recommended (but see [wiki:TracOnWindows/Python2.5 a workaround]).
     9
     10Download and run the Python MSI installer:
     11[http://www.python.org/ftp/python/2.4.4/python-2.4.4.msi python-2.4.4.msi]
     12
     13Then add the path to the directory where you chose to install Python to your PATH environment variable.  This is important to be able to run the Python executable from any directory in the command line.
     14
     15== Method 1: Experimental All-In-One Installer ==
     16
     17''Note: I don't believe that this method works at all. I believe that it was authored when the latest version of pysqlite was compatible with python 2.4.4. At this time the latest version of pysqlite does NOT seem to work with 2.4.4. So when using this approach you end up with a trac installation that fails. You have to back out of all of this and then try method 2 below, which worked for me.''
     18
     19This installation script only requires a Python 2.4 installation and will download and install the basic Trac dependencies and optionally the Subversion libraries. It does not always succeed - see the section Troubleshooting below - if you have problems, try Method 3.
     20
     21  1. Download and double-click this script to install Trac: [attachment:trac-0.10.3-win32-install.py?format=raw trac-0.10.3-win32-install.py]
     22  1. Download and run the installer for the Subversion command line tools: [http://subversion.tigris.org/files/documents/15/38369/svn-1.4.4-setup.exe svn-1.4.4-setup.exe] (only if you actually need to interface Trac with Subversion of course; since Trac 0.10, Subversion is not a requirement anymore)
     23  1. Once that's done you can skip ahead to [#GettingStarted Getting Started].
     24
     25,,If your network uses a web proxy server, you may have problems with the first step. You could try setting the HTTP_PROXY environment variable to refer to the proxy server. You can set this variable through Control Panel > System > Advanced > Environment Variables, or by using a command prompt from which you then run the script. In the latter example, you would "`SET HTTP_PROXY=http://your.proxy.server:port`" [enter] and then "`trac-0.10.3-win32-install.py`" [enter].,,
     26
     27
     28== Method 2: Using Installers ==
     29
     30You need to download and install the following packages:
     31|| Mandatory Packages ||  ||
     32|| '''[milestone:0.10.4 Trac 0.10.4]''' || [http://ftp.edgewall.com/pub/trac/trac-0.10.4.win32.exe trac-0.10.4.win32.exe] (works for Python 2.4 and 2.3) ||
     33|| '''ClearSilver''' || [http://www.clearsilver.net/downloads/win32/clearsilver-0.9.14.win32-py2.4.exe  clearsilver-0.9.14.win32-py2.4.exe] (or the [http://www.clearsilver.net/downloads/win32/clearsilver-0.9.14.win32-py2.3.exe Python 2.3 version]) ||
     34|| Optional Packages || (see notes below) ||
     35|| ''[TracSubversion Subversion]'' || [http://subversion.tigris.org/files/documents/15/38214/svn-python-1.4.4.win32-py2.4.exe svn-python-1.4.4.win32-py2.4.exe] (or the [http://subversion.tigris.org/files/documents/15/38213/svn-python-1.4.4.win32-py2.3.exe Python 2.3 version]) ||
     36|| ''PySqlite'' ||  [http://initd.org/pub/software/pysqlite/releases/2.3/2.3.4/pysqlite-2.3.4.win32-py2.4.exe pysqlite-2.3.4.win32-py2.4.exe] (or the [http://initd.org/pub/software/pysqlite/releases/2.3/2.3.4/pysqlite-2.3.4.win32-py2.3.exe Python 2.3 version]) ||
     37
     38Notes:
     39 - You don't necessarily need Subversion. You can use Trac with other [VersioningSystemBackend versioning system backends] or none at all
     40 - You need at least one [DatabaseBackend database backend]. If you don't want to use SQLite, see the TracOnWindows/Advanced instructions for other options.
     41
     42If you want to install plugins (WebAdmin and SpamFilter highly recommended!), you also need to install Setuptools manually (see below).
     43
     44
     45== Method 3: Manual Installation ==
     46
     47If you don't use the ''All-In-One Installer'', you'll have to download and install a few packages manually. This approach has a few more manual steps than the previous ones, but it is almost certain to work and you will know your installation much better at the end than with the more automated approaches. Total install time should be about 20 - 30 minutes if you have a speedy Internet connection.
     48
     49=== Setuptools ===
     50
     51[http://peak.telecommunity.com/DevCenter/setuptools Setuptools] makes installation of Python software easier by automatically downloading and installing Python packages from the internet.  It is also used to find and load [wiki:TracPlugins Trac's plugins].
     52
     53Download the setuptools installer: [http://peak.telecommunity.com/dist/ez_setup.py ez_setup.py]
     54
     55When the download completes double-click the "ez_setup.py" file from your download folder to install setuptools.
     56
     57=== The command line ===
     58
     59You'll need to open a Windows command line to install some of the necessary software:
     60
     61 1. Click "Start" > "Run..." (or press Win+R)
     62 1. Type "cmd" and click "Ok" - this opens the Windows command console
     63 1. Type "cd c:\Python24\Scripts"
     64
     65You should now be in the folder "C:\Python24\Scripts" where you can run the "easy_install" command to install the required software.
     66
     67=== Install ClearSilver ===
     68
     69Install the [http://www.clearsilver.net/ ClearSilver] template language:
     70{{{
     71easy_install -f http://clearsilver.net/downloads clearsilver==0.9.14
     72}}}
     73
     74=== Install PySQLite ===
     75
     76Install the [http://pysqlite.org PySqlite] database driver:
     77{{{
     78easy_install pysqlite
     79}}}
     80
     81If you want to use another database than SQLite, you need to read the TracOnWindows/Advanced instructions.
     82
     83Note: When installing PySQLite this way, you may see the following error:
     84
     85>Error: Setup script exited with error: Python was built with version 7.1
     86>of Visual Studio, and extensions need to be built with the same version
     87>of the compiler, but it isn't installed.
     88
     89If so, try installing PySQLite with the Windows executable installer referenced earlier:
     90
     91|| ''PySqlite'' ||  [http://initd.org/pub/software/pysqlite/releases/2.3/2.3.2/pysqlite-2.3.2.win32-py2.4.exe pysqlite-2.3.2.win32-py2.4.exe] (or the [http://initd.org/pub/software/pysqlite/releases/2.3/2.3.2/pysqlite-2.3.2.win32-py2.3.exe Python 2.3 version]) ||
     92
     93Download the installer pysqlite-2.3.2.win32-py2.4.exe to your usual download directory.
     94
     95When it has finished downloading, double-click on it to run the installer. The installer window will appear, labeled '''Setup pysqlite-2.3.2'''.
     96
     97On the first window of the installation dialog, click Next to begin the installation process.
     98
     99On the second window, confirm the Python install directory. If you have followed the instructions above, it will be "c:\python24\". The default install directory will show as "c:\python24\Lib\site-packages\". Accept the defaults or change them to match your own directory structure. Click Next to proceed.
     100
     101The next window in the dialog gives you a chance to cancel or continue. To continue, click Next.
     102
     103On the next window, the installer shows you installation progress as files are written to the target locations. When the processing is complete, click Finish. If you check the contents of c:\python24\Lib\site-packages\ directory, you should see the directory '''pysqlite2''', which contains the database scripts.
     104
     105=== Install Subversion (optional) === #Subversion
     106====  ==== #svntools
     107Trac can integrate with the [http://subversion.tigris.org Subversion] version control software.  Follow these steps if you'd like to use Trac with Subversion.  You can learn more about how they can integrate from the wiki: TracSubversion.
     108
     109This document covers using the Subversion command line tools, but you can also use the [http://tortoisesvn.net/ TortoiseSVN] Windows GUI.
     110
     111Download and run the installer for the Subversion command line tools:
     112[http://subversion.tigris.org/files/documents/15/35379/svn-1.4.2-setup.exe svn-1.4.2-setup.exe]
     113
     114The installation begins by displaying a small dialog titled '''Setup'''. It asks you whether you wish to continue. Click Yes.
     115
     116A larger window appears, titled '''Setup - Subversion'''. The first window of the dialog says "Welcome to the Subversion Setup Wizard". Click Next. Click "I accept the agreement" and then click Next. On the next window, read the important information and click Next.
     117
     118Select your destination directory for the Subversion installation. Click Next. You will then have the option of installing a Subversion menu item on the Start Menu, and a selection of places to put Subversion icons. Click Next. Finally you are ready to install. Click Next and the files will be copied to your selected destination. A couple more windows follow the install process, and then you're done.
     119
     120====  ==== #svnbindings
     121Go back to your command line to install the Subversion Python library:
     122{{{
     123easy_install -Z http://subversion.tigris.org/downloads/svn-python-1.4.2.win32-py2.4.exe
     124}}}
     125
     126'''Note:''' the "-Z" option is necessary when installing Subversion so that it is "unzipped".  Trac will not be able to access Subversion if it is zipped.
     127
     128The installation process will begin with "Downloading http://subversion.tigris.org/downloads/svn-python-1.4.2.win32-py2.4.exe" and -- if successful -- ends with "Processing dependencies for svn-python==1.4.2".
     129
     130=== Install Trac ===
     131
     132Download and run the latest stable Trac Windows installer:
     133[http://ftp.edgewall.com/pub/trac/trac-0.10.win32.exe trac-0.10.3.win32.exe]
     134
     135'''Note:''' do '''not''' run easy_install on the Trac installer.  This is not currently supported and Trac will not work correctly when installed this way.
     136
     137When you run the installer, it displays a window titled '''Setup Trac 0.10'''. On the first window of the installation dialog, click Next to get started. Confirm your Python directory and your intended installation directory. Click Next. Click Next again to start the installation. When the process is over, click Finish to complete the installation.
     138
     139== Method 4: All-In-One Step-by-Step Installation Guide ==
     140
     141This points to an [http://community.sgdotnet.org/blogs/blackinkbottles_ink/archive/2006/12/18/Using-Trac-to-improve-the-efficiency-of-product-development-and-project-management.aspx external guide] including setup of Subversion, Apache and other dependencies with detailed steps from scratch. It also contains some recommended installation paths and the corresponding brief but sufficent configurations in various configuration files covered (eg httpd.conf of Apache).
     142
     143----
     144
     145== Getting Started ==
     146
     147Ok, now that Trac and all its requirements have been installed you can create your first project and try it out.
     148
     149This example will create the projects in "C:\projects".  This is a good default location, but you can put them in another drive or folder if you prefer.
     150
     151Back to the command line:
     152{{{
     153md c:\projects
     154cd c:\projects
     155}}}
     156
     157'''Optional:''' if you're using Trac with Subversion you can create a new repository for your source code:
     158{{{
     159md c:\projects\svn
     160svnadmin create c:\projects\svn\my-project
     161}}}
     162
     163This step causes Subversion to create a subdirectory (c:\projects\svn\my-project) containing the basics of a Subversion project.
     164
     165=== Initialize a new Trac project environment: ===
     166
     167First go to the 'Scripts' folder in your Python install directory (e.g. "\Python24\Scripts"), and add the '.py' extension onto the files 'tracd' and 'trac-admin' if this is missing.  Then, type the following at the command line:
     168
     169{{{
     170md c:\projects\trac
     171c:\Python24\Scripts\trac-admin.py c:\projects\trac\my-project initenv
     172}}}
     173
     174Follow the interactive prompts to input information about your project.  If you are unsure what to put you can simply press "Enter" to accept the default value.
     175
     176{{{
     177Project Name [My Project]>
     178
     179Database connecting string [sqlite:db/trac.db]>
     180
     181Repository type [svn]>
     182
     183Path to repository [/path/to/repos]>
     184
     185Template directory [C:\Python24\share\trac\templates]>
     186}}}
     187
     188After this response, the script will say "Creating and Initializing Project". A large number of messages will scroll, finishing with "Congratulations!".
     189
     190'''Note for Subversion users:''' when asked for the "Path to repository" input the folder of the repository you just created:
     191{{{
     192Path to repository [/path/to/repos]> c:/projects/svn/my-project
     193}}}
     194
     195'''Note:''' be sure to include the full path, including the drive letter.
     196
     197== Try it out ==
     198
     199Trac includes a standalone webserver called [wiki:TracStandalone tracd].  You can also use Trac with other webservers, but you should first try tracd to make sure everything's set up and working correctly:
     200
     201From the command line, and in the [Python Install]\Scripts directory:
     202{{{
     203tracd.py -p 8000 c:\projects\trac\my-project
     204}}}
     205
     206
     207Open your browser to http://localhost:8000 to test out your new Trac project. You should see the title "Welcome to Trac 0.10" in your browser, and in the command window from which you just launched '''tracd''' there will be a series of status log messages. These messages will continue to update as you move around the Trac site. When you are done, return to the command window from which you launched tracd and press Ctrl+Break to stop tracd.
     208
     209== Troubleshooting ==
     210
     211==== Unsupported version control system "svn" ====
     212
     213The Subversion library is not installed properly.  Be sure you used the "-Z" option with easy_install when [#svnbindings installing] the Subversion bindings.
     214
     215==== Error: Setup script exited with error: Python was built with version 7.1 of Visual Studio, and extensions need to be built with the same version of the compiler, but it isn't installed. ====
     216
     217From [http://www.mail-archive.com/trac-dev@googlegroups.com/msg00997.html]
     218
     219> The problem is that the pre-built Windows binaries for PySQLite are
     220> currently not detected by setuptools, so it is trying to download and
     221> compile the sources which requires a build environment.  Unfortunately
     222> this is not particularly common or easy on Windows.  I have reported
     223> the problem to the PySQLite developers, so hopefully they will
     224> addresss this soon: http://initd.org/tracker/pysqlite/ticket/191
     225
     226
     227It appears you can successfully install Trac by following a combination of Method 3: Manual Installation and Method 2: Using Installers, above. The critical step for installing PySQLite is to use the self-installing EXE version, which does not trigger the bogus compile step. As noted above, download and execute the appropriate file:
     228
     229
     230|| ''PySqlite'' ||  [http://initd.org/pub/software/pysqlite/releases/2.3/2.3.2/pysqlite-2.3.2.win32-py2.4.exe pysqlite-2.3.2.win32-py2.4.exe] (or the [http://initd.org/pub/software/pysqlite/releases/2.3/2.3.2/pysqlite-2.3.2.win32-py2.3.exe Python 2.3 version]) ||
     231
     232
     233
     234----
     235See also: the TracOnWindows/Advanced instructions, TracOnWindows/Rewrite for discussing improvements to this page and ["0.9/TracOnWindows"] for the previous version of this document.