I host my Bazaar repositories via WebDAV. Note that this is not the preferred method because repacking involves lots of traffic (SSH or smart server does not have this problem). That is why I run "bzr pack" via cron at night time for all repos. WebDAV is a good solution if you don't want to open up another port, or want to use the authentication methods of Apache like I do. It is the easiest solution in my opinion.
Create the file /etc/apache2/conf.d/bzr-repos
(name does not matter, but any file in conf.d is included automatically):
# This assumes you have your repos in /var/bzr-repos which should be owned
# (or at least read-and-writable) by the user www-data
Alias /bzr /var/bzr-repos
<Directory /var/bzr-repos>
DAV On
Options Indexes
# The bzr.webdav plugin for http(s)+webdav transport
# only works with this option:
DirectorySlash Off
</Directory>
<Location /bzr>
# Put SSLRequireSSL here if you want
Order deny,allow
Deny from all
</Location>
Then you can add single repositories like so:
# Repo stored in /var/bzr-repos/my-repo-name
<Location /bzr/my-repo-name>
Order allow,deny
Allow from all
# If you want authentication (I guess so, or do you want everyone to
# be able to push and pull?)
AuthType Basic
AuthName "My repository"
AuthUserFile /etc/apache2/my-passwords.passwd
Require user my-username
</Location>
Don't forget to restart Apache then. You might have to enable the DAV module (a2enmod dav dav_fs
).
In order to use the repository, use the URL "http+webdav://example.com/bzr/my-repo-name/" (or https+webdav://
for HTTPS).