Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

How do you set up a Bazaar server on Ubuntu server? I have home server running Ubuntu Server 12.04 LTS I want to use as a Bazaar central server. How do I do that? (create repository (if not the same), open ports for listening, create users...).

Edited

I found a blog that has stuff needed for a server to be started. But... How do you limit rights for users? Give some users rights to upload, others - download and etc.

Here is the blog: http://zeth.net/post/366/

share|improve this question
add comment

3 Answers

Here is a blog in which some guy talks about setting up a Bazaar server as they didn't want to publish their code (just like me): http://zeth.net/post/366/

Firstly, they made a new user for Bazaar (to keep everything nice and clean):

$ sudo useradd -m bzruser

After the user was set up, they simply created a regular repository there:

$ sudo su bzruser
$ mkdir -p /home/bzruser/repository/group/project/trunk
$ cd /home/bzruser/repository/group/project/trunk
$ bzr init

When the repo is created, you simply start the server by using

$ bzr server --directory=/home/bzruser/repository

Which starts listening to port 4155 (though it can be changed using --port option).

Of course, directory hierarchy is up to you, the admin, as well as stuff like making the server start on boot, but it's a different story. Bazaar server is up and running ;)

share|improve this answer
    
After doing everything just as you described have the following problem: –  Tomasz Bocheński Feb 4 '13 at 6:10
    
damian@damian-desktop:~/Pulpit$ bzr checkout bzr+ssh://testpxe.servebeer.com/home/tomasz/bzr/test1 testowy-projekt1 bzr: ERROR: Permission denied: "/home/tomasz/bzr/test1/.bzr/branch-format": : [Errno 13] Permission denied: u'/home/tomasz/bzr/test1/.bzr/branch-format' damian@damian-desktop:~/Pulpit$ –  Tomasz Bocheński Feb 4 '13 at 6:19
add comment

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).

share|improve this answer
add comment

Bazaar in five minutes

If you follow this nice and short tutorial you will be able to create a local Bazaar branch, commit your code, and push it to any location including Launchpad (not really in five minutes but certainly in minutes rather than hours):

A complete tutorial for advanced Bazaar usage can be found here:

Bazaar User Guide

share|improve this answer
    
I don't want to publish my code. I want to make my own central server for Bazaar. A private Bazaar server or whatever it's called. –  Pius May 7 '12 at 9:18
    
Well, I couldn't find it there but I found a blog that does show what commands are used for the server to be started. –  Pius May 7 '12 at 9:44
    
I edited it into my first post. I will make it as an Answer. –  Pius May 7 '12 at 10:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.