~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to doc/en/user-guide/http_smart_server.txt

  • Committer: Patrick Regan
  • Date: 2009-12-02 20:34:07 UTC
  • mto: (4852.3.3 2.1.0b4-doc-updates)
  • mto: This revision was merged to the branch mainline in revision 4856.
  • Revision ID: patrick.rubbs.regan@gmail.com-20091202203407-fjd0mshgn3j3foel
Removed trailing whitespace from files in doc directory

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
    LoadModule fastcgi_module /usr/lib/apache2/modules/mod_fastcgi.so
32
32
    FastCgiIpcDir /var/lib/apache2/fastcgi
33
 
    
 
33
 
34
34
In our example, we're already serving `/srv/example.com/www/code` at
35
35
`http://example.com/code`, so our existing Apache configuration would look
36
36
like::
51
51
        RewriteBase /code
52
52
        RewriteRule ^(.*/|)\.bzr/smart$ /srv/example.com/scripts/bzr-smart.fcgi
53
53
    </Directory>
54
 
    
 
54
 
55
55
    # bzr-smart.fcgi isn't under the DocumentRoot, so Alias it into the URL
56
56
    # namespace so it can be executed.
57
57
    Alias /srv/example.com/scripts/bzr-smart.fcgi /srv/example.com/scripts/bzr-smart.fcgi
61
61
            SetHandler fastcgi-script
62
62
        </Files>
63
63
    </Directory>
64
 
    
 
64
 
65
65
This instructs Apache to hand requests for any URL ending with `/.bzr/smart`
66
66
inside `/code` to a Bazaar smart server via FastCGI.
67
67
 
136
136
        prefix='/code/',
137
137
        path_var='REQUEST_URI',
138
138
        readonly=True,
139
 
        load_plugins=True, 
 
139
        load_plugins=True,
140
140
        enable_logging=True)
141
141
 
142
142
    fcgi.WSGIServer(smart_server_app).run()
143
 
        
 
143
 
144
144
The `fcgi` module can be found at http://svn.saddi.com/py-lib/trunk/fcgi.py.  It
145
145
is part of flup_.
146
146
 
162
162
        prefix='/code/',
163
163
        path_var='REQUEST_URI',
164
164
        readonly=True,
165
 
        load_plugins=True, 
 
165
        load_plugins=True,
166
166
        enable_logging=True)
167
167
 
168
168
    def handler(request):
169
169
        """Handle a single request."""
170
170
        wsgi_server = modpywsgi.WSGIServer(smart_server_app)
171
171
        return wsgi_server.run(request)
172
 
        
 
172
 
173
173
The `modpywsgi` module can be found at
174
174
http://dev.pocoo.org/projects/pocoo/browser/pocoo/wrappers/modpy.py. It is
175
175
part of pocoo_. You sould make sure you place modpywsgi.py in the same
232
232
writable server, and plain HTTP allow read-only access.
233
233
 
234
234
 
235
 
.. 
 
235
..
236
236
   vim: ft=rst tw=74 et