~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to doc/http_smart_server.txt

  • Committer: Aaron Bentley
  • Date: 2007-02-06 14:52:16 UTC
  • mfrom: (2266 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2268.
  • Revision ID: abentley@panoramicfeedback.com-20070206145216-fcpi8o3ufvuzwbp9
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
===========================
1
2
Serving Bazaar with FastCGI
2
3
===========================
3
4
 
4
 
This document describes one way to set up a Bazaar HTTP smart server,
5
 
using Apache 2.0 and FastCGI or mod_python.
6
 
 
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
 
5
**This feature is EXPERIMENTAL and is NOT SECURE.  It will allow access to
 
6
arbitrary files on your server.**
 
7
 
 
8
This document describes one way to setup a Bazaar HTTP smart server, using
 
9
Apache 2.0 and FastCGI or mod_python.
11
10
 
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