Edgewall Software

Changes between Version 24 and Version 25 of TracOnWindowsIis6


Ignore:
Timestamp:
Oct 27, 2006, 8:02:17 PM (18 years ago)
Author:
markus
Comment:

Various updates for milestone:0.10

Legend:

Unmodified
Added
Removed
Modified
  • TracOnWindowsIis6

    v24 v25  
    1 == Windows Installation Instructions for Subversion w/Trac 0.9.4 ==
     1== Windows Installation Instructions for Subversion w/ Trac 0.10 ==
    22
    33For::
    44 * Windows Server 2003 SP1
    55 * IIS 6
    6  * Trac 0.9.4
    7 
    8 There are some documented issues regarding running Trac on Microsoft's Internet Information Server (IIS), however it does work (albeit slowly). Refer to the following issues for details: #692 #693 and #697.
    9 
    10 
    11 ----
     6 * Trac 0.10
     7
     8
    129Note 1: Before continuing to set up Trac to run using IIS6, be warned that python running under IIS6 is painfully slow. It is recommended that the use of [source:trunk/README.tracd#latest tracd] be used for performance reasons. See http://lazutkin.com/blog/2006/feb/18/setting-tools-windows/ -> Section "Trac" -> Step 4. This results in a ''significant'' performance boost over CGI.
    1310----
    1411Note 2: This example installs to F: (for extra points, then goes DarkReign hard with a separate application pool and so on.)
    1512----
    16 Note 3: If you want to use Trac 0.10 please take a look [http://groups.google.com/group/trac-users/browse_thread/thread/98dbacece22365e2/1385d5e1e43a938c?lnk=gst&q=IIS&rnum=1#1385d5e1e43a938c here]. Do not make the modifications described in this article.
    17 ----
     13
    1814
    1915=== Arm Yourself ===
     
    2218
    2319=== Install Subversion Pre-Requisites ===
    24 2. Download and Install Python (Get version 2.3.5, because v2.4 doesn't have appropriate SVN plugins available).
    25   http://www.python.org/download/releases/2.3.5/
     202. Download and Install Python (Get version 2.4.4, because v2.5 doesn't have appropriate SVN plugins available).
     21  http://www.python.org/download/releases/2.4.4/
    2622 
    2723  Add F:\Python23 to path
     
    3531  http://subversion.tigris.org (remember to get the python bindings as well)
    3632
    37 5. Install docutils
     335. Install docutils (optional for WikiRestructuredText)
    3834  http://docutils.sourceforge.net/
    3935{{{
     
    114110=== Install Trac Prerequisites ===
    11511117. Install Subversion Python Bindings
    116   (Get from same download page as Subversion - http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91. Currently only supports Python 2.3 - NOT 2.4)
     112  (Get from same download page as Subversion - http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91. Currently only supports Python 2.3 and Python 2.4 - NOT 2.5)
    117113  [[br]]Copy libsvn and svn directories to F:\Python23\Lib
    118114
     
    140136{{{
    141137try:
    142     from trac.web import cgi_frontend
    143138    # PATCH IIS6 - start
    144139    import os
    145     os.environ['TRAC_ENV'] = 'F:\\tracsvn\\Trac.db'
     140    os.environ['TRAC_ENV'] = "F:/tracsvn"
    146141    # PATCH IIS6 - end
     142    from trac.web import cgi_frontend
    147143    cgi_frontend.run()
    148 except Exception, e:
    149 }}}
    150 
    151 The TRAC_ENV line is important as IIS6 won't pass this environment variable to the script when it runs.
     144except SystemExit:
     145}}}
     146
     147The TRAC_ENV line is important as IIS6 won't pass this environment variable to the script when it runs.
     148In case you're going to make use of plugins, also add `os.environ['PYTHON_EGG_CACHE'] = "F:/path/to/eggcache"`.
    152149
    15315023. Fix Python file - api.py
    154151
    155 In [F:\Python23\Lib\site-packages\trac\web\api.py], in the [redirect] function on the Request class, replace the entire function with:
    156 {{{
    157     def redirect(self, url):
    158         """Send a redirect to the client, forwarding to the specified URL. The
    159         `url` may be relative or absolute, relative URLs will be translated
    160         appropriately.
    161         """
    162         base_url = '%s://%s' % ("http", os.getenv('SERVER_NAME'))
    163         if self.session:
    164             self.session.save() # has to be done before the redirect is sent
    165         self.send_response(302)
    166         if not url.startswith('http://') and not url.startswith('https://'):
    167             # Make sure the URL is absolute
    168             url = absolute_url(self, url)
    169         self.send_header('Location', base_url + url)
    170         self.send_header('Content-Type', 'text/plain')
    171         self.send_header('Pragma', 'no-cache')
    172         self.send_header('Cache-control', 'no-cache')
    173         self.send_header('Expires', 'Fri, 01 Jan 1999 00:00:00 GMT')
    174         self._send_cookie_headers()
    175         self.end_headers()
    176 
    177         if self.method != 'HEAD':
    178             self.write('Redirecting...')
    179 
    180         raise RequestDone
    181 }}}
    182 
    183 
    184 24. Fix Python file - cgi_frontend.py
    185 
    186 In [F:\Python23\Lib\site-packages\trac\web\cgi_frontend.py], class CGIRequest, change the real_cgi_start function  where it says :
    187 {{{
    188         self.path_info = self.__environ.get('PATH_INFO', '')
    189 }}}
    190 
    191   Change this to:
    192 {{{
    193 
    194         # IIS 6 Change
    195         self.path_info = self.__environ.get('PATH_INFO', '')
    196         self.path_info = self.path_info.replace(os.getenv('SCRIPT_NAME'),"")
    197         # End IIS 6 Change
    198 
     152In [F:\Python23\Lib\site-packages\trac\web\api.py], change [source:/tags/trac-0.10/trac/web/api.py@4070#L217 "line 217"] to:
     153{{{
     154path_info = property(fget=lambda self: self.environ.get('PATH_INFO','').decode('utf-8').replace(self.environ.get('SCRIPT_NAME', ''), ''),
     155                     doc='Path inside the application')
     156}}}
     157
     158
     15924. Fix Python file - main.py
     160
     161In [F:\Python23\Lib\site-packages\trac\web\main.py], change [source:/tags/trac-0.10/trac/web/main.py@4070#L315 "line 315"] to:
     162{{{
     163path_info = environ.get('PATH_INFO', '').replace(environ.get('SCRIPT_NAME', ''), '').lstrip('/').split('/')
    199164}}}
    200165
     
    20517025. Run trac-admin
    206171{{{
    207 f:\Python23\Scripts> python trac-admin f:/tracsvn/trac.db
     172f:\Python23\Scripts> python trac-admin f:/tracsvn/
    208173}}}
    209174
     
    213178
    214179{{{
    215 Trac [f:/tracsvn/trac.db]> initdb
     180Trac [f:/tracsvn]> initdb
    216181}}}
    217182or
    218183{{{
    219 Trac [f:/tracsvn/trac.db]> initenv
     184Trac [f:/tracsvn]> initenv
    220185}}}
    221186{{{
     
    232197If you get an error here stating that libdb42.dll was not found, copy ''[SVN PATH]''\bin\libdb42.dll to ''[PYTHON PATH]''\lib\libsvn\, then try again.
    233198
    234 27. (BUG) Load Wiki
    235 {{{
    236 Trac [f:/tracsvn/trac.db]> wiki load f:/python23/share/trac/wiki-default
    237 }}}
    238 
    239 28. Add administrative permissions (the below adds all permissions for 'admin' user)
    240 {{{
    241 Trac [f:/tracsvn/trac.db]> permission add admin TRAC_ADMIN
     19927. Add administrative permissions (the below adds all permissions for 'admin' user)
     200{{{
     201Trac [f:/tracsvn]> permission add admin TRAC_ADMIN
    242202}}}
    243203
     
    249209
    250210=== Finally... ===
    251 29. Install Subversion clients as necessary (try [http://rapidsvn.tigris.org RapidSVN] & [http://tortoisesvn.tigris.org/ TortoiseSVN])
    252 
    253 30. Don't forget to lock down the security on the box!
    254 
    255 31. Now go get a *real* drink
     21128. Install Subversion clients as necessary (try [http://rapidsvn.tigris.org RapidSVN] & [http://tortoisesvn.tigris.org/ TortoiseSVN])
     212
     21329. Don't forget to lock down the security on the box!
     214
     21530. Now go get a *real* drink
     216
     217----
     218See also:  TracGuide, TracCgi, TracFastCgi, TracUpgrade, TracPermissions, #692, #693, #697