Changes between Version 24 and Version 25 of TracOnWindowsIis6
- Timestamp:
- Oct 27, 2006, 8:02:17 PM (18 years ago)
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 == 2 2 3 3 For:: 4 4 * Windows Server 2003 SP1 5 5 * 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 12 9 Note 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. 13 10 ---- 14 11 Note 2: This example installs to F: (for extra points, then goes DarkReign hard with a separate application pool and so on.) 15 12 ---- 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 18 14 19 15 === Arm Yourself === … … 22 18 23 19 === Install Subversion Pre-Requisites === 24 2. Download and Install Python (Get version 2. 3.5, because v2.4doesn't have appropriate SVN plugins available).25 http://www.python.org/download/releases/2. 3.5/20 2. 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/ 26 22 27 23 Add F:\Python23 to path … … 35 31 http://subversion.tigris.org (remember to get the python bindings as well) 36 32 37 5. Install docutils 33 5. Install docutils (optional for WikiRestructuredText) 38 34 http://docutils.sourceforge.net/ 39 35 {{{ … … 114 110 === Install Trac Prerequisites === 115 111 17. 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) 117 113 [[br]]Copy libsvn and svn directories to F:\Python23\Lib 118 114 … … 140 136 {{{ 141 137 try: 142 from trac.web import cgi_frontend143 138 # PATCH IIS6 - start 144 139 import os 145 os.environ['TRAC_ENV'] = 'F:\\tracsvn\\Trac.db'140 os.environ['TRAC_ENV'] = "F:/tracsvn" 146 141 # PATCH IIS6 - end 142 from trac.web import cgi_frontend 147 143 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. 144 except SystemExit: 145 }}} 146 147 The TRAC_ENV line is important as IIS6 won't pass this environment variable to the script when it runs. 148 In case you're going to make use of plugins, also add `os.environ['PYTHON_EGG_CACHE'] = "F:/path/to/eggcache"`. 152 149 153 150 23. Fix Python file - api.py 154 151 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 152 In [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 {{{ 154 path_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 159 24. Fix Python file - main.py 160 161 In [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 {{{ 163 path_info = environ.get('PATH_INFO', '').replace(environ.get('SCRIPT_NAME', ''), '').lstrip('/').split('/') 199 164 }}} 200 165 … … 205 170 25. Run trac-admin 206 171 {{{ 207 f:\Python23\Scripts> python trac-admin f:/tracsvn/ trac.db172 f:\Python23\Scripts> python trac-admin f:/tracsvn/ 208 173 }}} 209 174 … … 213 178 214 179 {{{ 215 Trac [f:/tracsvn /trac.db]> initdb180 Trac [f:/tracsvn]> initdb 216 181 }}} 217 182 or 218 183 {{{ 219 Trac [f:/tracsvn /trac.db]> initenv184 Trac [f:/tracsvn]> initenv 220 185 }}} 221 186 {{{ … … 232 197 If 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. 233 198 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 199 27. Add administrative permissions (the below adds all permissions for 'admin' user) 200 {{{ 201 Trac [f:/tracsvn]> permission add admin TRAC_ADMIN 242 202 }}} 243 203 … … 249 209 250 210 === 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 211 28. Install Subversion clients as necessary (try [http://rapidsvn.tigris.org RapidSVN] & [http://tortoisesvn.tigris.org/ TortoiseSVN]) 212 213 29. Don't forget to lock down the security on the box! 214 215 30. Now go get a *real* drink 216 217 ---- 218 See also: TracGuide, TracCgi, TracFastCgi, TracUpgrade, TracPermissions, #692, #693, #697