Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Changes between Version 6 and Version 7 of ApacheIntegration


Ignore:
Timestamp:
04/29/06 14:53:32 (13 years ago)
Author:
anonymous
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ApacheIntegration

    v6 v7  
    1 Documentation on running apache as a frontend to a TurboGears server can be found at the [http://www.cherrypy.org/wiki/BehindApache "CherryPy Wiki"]. 
    2  
    3 One issue not addressed there is inconsistent character sets.  The default Kid templates used by turbogears specify a charset of utf-8.  The apache default charset, returned in the "Content-Type" header, is ISO-8859-1.  This inconsistency will cause errors during validation and incorrect rendering of some characters on the client.  Use this directive to override the apache default: 
    4  
    51{{{ 
    6   AddDefaultCharset utf-8 
     2#!html 
     3<br> 
     4<div style="display:block; padding: 4px; border: 2px solid red; color: #C00; font-weight:bold;"> 
     5Note: this entry was moved to TurboGears newsdoc (ApacheIntegration.html) 
     6</div> 
     7<br> 
    78}}} 
    8  
    9 You can also explicitly set the charset property in the content-type header from cherrypy 
    10  
    11 {{{ 
    12   cherrypy.response.headerMap["Content-Type"] += ";charset=utf-8" 
    13 }}} 
    14  
    15 that way, since a charset is specified, apache won't apply the default charset. 
    16  
    17  
    18 Note that you can't use _cpFilterList, you have to make the filter changes to the config file, like so: 
    19 {{{ 
    20 [/] 
    21 baseUrlFilter.on = True 
    22 baseUrlFilter.useXForwardedHost = True 
    23 }}} 
    24  
    25  
    26  
    27 ---- 
    28 '''Another Example''' 
    29  
    30 Karl Guertin wrote a step by step set of instructions in [http://tinyurl.com/cajr7 "this message"] on using VirtualPathFilter with Apache. 
    31  
    32 {{{ 
    33 1. Put the following lines in your prodcfg.py: 
    34 path("/") 
    35 baseUrlFilter.on = True 
    36 baseUrlFilter.useXForwardedHost = True 
    37 2. In your app directory 'python setup.py bdist_egg' to create an 
    38 installable egg file. 
    39 3. Copy the egg to your server and easy_install your_app_name 
    40 4. Create an apache virtual host containing the following rules: 
    41     RewriteEngine on 
    42     RewriteRule ^(.*) http://127.0.0.1:8000$1 [P] 
    43 5. Restart apache 
    44  
    45 There are other things you can optionally do and caveats, but the 
    46 above should work just fine. I'm not 100% sure on the syntax of the 
    47 first step, I've only deployed using the old .cfg format.  
    48 }}} 
    49  
    50 This page seemed like a logical place to capture these instructions. I haven't tried using this yet. 
    51