123
The next configuration permit read and write the repository with apache
125
123
First, configure mod_wsgi, e.g. enabling the mod with a2enmod wsgi.
127
In our example, we're already serving `/srv/example.com/www/code` at
128
`http://example.com/code`, if you want apache authentication you need add
131
# This has the same structure as svn in apache
135
AuthUserFile /srv/example.com/conf/auth.passwd
141
124
We need to change it to handle all requests for URLs ending in `.bzr/smart`. It
155
138
This instructs Apache to hand requests for any URL ending with `/.bzr/smart`
156
inside `/code` to a Bazaar smart server via WSGI.
139
inside `/code` to a Bazaar smart server via WSGI, and any other URL inside
140
`/code` to be served directly by Apache.
158
142
Refer to the mod_wsgi_ documentation for further information.
276
260
.. _WSGI standard: http://www.python.org/dev/peps/pep-0333/
279
Pushing over ``bzr+http://``
280
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
263
Pushing over the http smart server
264
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
282
266
It is possible to allow pushing data over the http smart server. The
283
267
easiest way to do this, is to just supply ``readonly=False`` to the
284
268
``wsgi.make_app()`` call. But be careful, because the smart protocol does
285
269
not contain any Authentication. So if you enable write support, you will
286
270
want to restrict access to ``.bzr/smart`` URLs to restrict who can
287
actually write data on your system. At this time, it is not possible to
288
allow some people to have read-only access and others to have read-write
289
access to the same urls. Because at the HTTP layer (which is doing the
290
Authenticating), everything is just a POST request. However, it would
291
certainly be possible to have HTTPS require authentication and use a
292
writable server, and plain HTTP allow read-only access.
294
If you trying to push with the protocol bzr+https and receive the next
297
bzr: ERROR: Connection error: curl connection error (server certificate verification failed.
298
CAfile:/etc/ssl/certs/ca-certificates.crt CRLfile: none)
300
You can probably uninstall pycurl or check the `bug 82086`_ or use
301
https+urllib if you put the RewriteRule directive in your Virtual Host.
271
actually write data on your system, e.g. in apache it looks like::
276
AuthUserFile /srv/example.com/conf/auth.passwd
282
At this time, it is not possible to allow some people to have read-only
283
access and others to have read-write access to the same urls. Because at
284
the HTTP layer (which is doing the Authenticating), everything is just a
285
POST request. However, it would certainly be possible to have HTTPS
286
require authentication and use a writable server, and plain HTTP allow
289
If bzr gives an error like this when accessing your HTTPS site::
291
bzr: ERROR: Connection error: curl connection error (server certificate verification failed.
292
CAfile:/etc/ssl/certs/ca-certificates.crt CRLfile: none)
294
You can workaround it by using ``https+urllib`` rather than ``http`` in your
295
URL, or by uninstalling pycurl. See `bug 82086`_ for more details.
303
297
.. _bug 82086: https://bugs.launchpad.net/bzr/+bug/82086