~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to doc/http_smart_server.txt

  • Committer: Andrew Bennetts
  • Date: 2007-03-26 06:24:01 UTC
  • mto: This revision was merged to the branch mainline in revision 2376.
  • Revision ID: andrew.bennetts@canonical.com-20070326062401-k3nbefzje5332jaf
Deal with review comments from Robert:

  * Add my name to the NEWS file
  * Move the test case to a new module in branch_implementations
  * Remove revision_history cruft from identitymap and test_identitymap
  * Improve some docstrings

Also, this fixes a bug where revision_history was not returning a copy of the
cached data, allowing the cache to be corrupted.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
===========================
1
2
Serving Bazaar with FastCGI
2
3
===========================
3
4
 
 
5
**This feature is EXPERIMENTAL and is NOT SECURE.  It will allow access to
 
6
arbitrary files on your server.**
 
7
 
4
8
This document describes one way to set up a Bazaar HTTP smart server,
5
9
using Apache 2.0 and FastCGI or mod_python.
6
10
 
7
 
For more information on the smart server, and other ways to configure it
8
 
see the main `smart server documentation`_.
9
 
 
10
 
.. _smart server documentation: #running-a-smart-server
11
 
 
12
11
Example
13
 
-------
 
12
=======
14
13
 
15
14
You have a webserver already publishing `/srv/example.com/www/code` as
16
15
`http://example.com/code/...` with plain HTTP.  It contains bzr branches and
46
45
 
47
46
    Alias /code /srv/example.com/www/code
48
47
    <Directory /srv/example.com/www/code>
49
 
        Options Indexes FollowSymLinks
 
48
        Options Indexes, FollowSymLinks
50
49
        RewriteEngine On
51
50
        RewriteBase /code
52
51
        RewriteRule ^(.*/|)\.bzr/smart$ /srv/example.com/scripts/bzr-smart.fcgi
102
101
This instructs Apache to hand requests for any URL ending with `/.bzr/smart`
103
102
inside `/code` to a Bazaar smart server via mod_python.
104
103
 
105
 
NOTE: If you don't have bzrlib in your PATH, you will be need to change the
106
 
following line::
107
 
 
108
 
            PythonPath "sys.path+['/srv/example.com/scripts']"
109
 
 
110
 
To::
111
 
 
112
 
            PythonPath "['/path/to/bzr']+sys.path+['/srv/example.com/scripts']"
113
 
 
114
 
 
115
104
Refer to the mod_python_ documentation for further information.
116
105
 
117
106
.. _mod_python: http://www.modpython.org/
168
157
        
169
158
The `modpywsgi` module can be found at http://trac.pocoo.org/wiki/ModPyWsgi.  It
170
159
is part of pocoo_.
171
 
You sould make sure you place modpywsgi.py in the same directory as
172
 
bzr-smart.py (ie. /srv/example.com/scripts/).
173
160
 
174
161
.. _pocoo: http://trac.pocoo.org/wiki/
175
162
 
186
173
 
187
174
 
188
175
Advanced configuration
189
 
----------------------
 
176
======================
190
177
 
191
178
Because the Bazaar HTTP smart server is a WSGI application, it can be used with
192
179
any 3rd-party WSGI middleware or server that conforms the WSGI standard.  The
213
200
 
214
201
 
215
202
Pushing over ``bzr+http://``
216
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
203
----------------------------
217
204
 
218
205
It is possible to allow pushing data over the http smart server. The
219
206
easiest way to do this, is to just supply ``readonly=False`` to the