Setting Up A Source Control Server with Domino LDAP : Part 3

The next stage in the process is to let the Apache web server know about our new Mercurial scripts and folders. We’ll start by creating a brand new Apache configuration file for Mercurial and then add that into the default site for Apache. Again you can use pico in place of vi for any of the commands below. First we’ll create a folder to store the configuration file.

sudo mkdir /etc/apache2/hg

Then create the configuration file

sudo vi /etc/apache2/hg/hg.conf

and add the following lines to it…

WSGIScriptAliasMatch /hg /var/hg/hgweb.wsgi

order deny,all
allow from all

Now to add this to the current Apache configuration. I’m going to add it into the default Apache website that was created when Apache was installed. Lets open up the default site configuration file

sudo vi /etc/apache2/sites-available/default

and add the following line to the very end of the document after the line.

Include /etc/apache2/hg/hg.conf

Save the file. We can now test to see if everything is working correctly so far by restarting Apache and trying to hit the Mercurial server’s directory. here’s how you restart the Apache server

sudo /etc/init.d/apache2 restart

Then open up a web browser and try to hit http://server.ip.address/hg If you don;t know the server’s IP address then you can type ip addr and it will show it to you on the eth0 line of the results.

In the next stage we will link Apache to our Domino LDAP server.

Tagged with: , , , , ,
Posted in Uncategorized

Setting Up A Source Control Server with Domino LDAP : Part 2

It’s time to start up your Ubuntu server again and log in using the credentials that you were using in the last part of the series. Once your up and running we are going to setup the Mercurial WSGI script so that Apache will be able to use it later. We’ll start by copying the basic script file to the right location.

sudo cp hg-stable/contrib/hgweb.wsgi /var/hg

Next we will edit that file to tell it where to find it’s configuration files. I like to use vi as a text editor on linux but it is not the easiest to use. If you prefer you can use pico instead by typing ‘pico’ in place of ‘vi’ in all the commands from this point forward.

sudo vi /var/hg/hgweb.wsgi

In this file look fo the line that starts with ‘config =’ and change it as follows.

config = “/var/hg/hgweb.config”

Once you have made the changes and saved the file we need to tell Linux that this is an executable script using the command

sudo chmod u+x /var/hg/hgweb.wsgi

That’s the script ready to go but it’s currently pointing to a file that doesn’t exist so lets create it now using

vi hgweb.config

and add these lines to the file…

[paths]

[web]
baseurl = /hg

[hooks]
changegroup =
changegroup.mod_wsgi = touch /var/hg/hgweb.wsgi

Save the file and exit your text editor. We created the file in our working directory so now we need to move it to the /var/hg directory so that the script can find it. We will use a small variation n the sudo command so that it is created with the correct rights for Apache to be able to access it.

sudo -u www-data cp hgweb.config /var/hg

In the next step we will point Apache to these new files and get our Mercurial server up and running with no authentication. In the mean time…

sudo shutdown -h now

Tagged with: , , , , ,
Posted in Uncategorized

Setting Up A Source Control Server with Domino LDAP : Part 1

The first thing that you will need to do is download Ubuntu Server. For my testing I have been using Ubuntu 10.10 but this should all work perfectly with Ubuntu 10.04 LTS if your corporate policy dictates you only use LTS releases. You will then need to install Ubuntu Server onto a machine of your choice. I won’t go into the actual installation here but a basic installation should do the trick. For my testing I was installing it into a virtual Machine on my Mac using Parallels with just 512Mb ram. If your setting up a system for a lot of developers then you may need a better machine then that.

Once Ubuntu is installed it will start up with a nice simple text login screen. Ubuntu Server does not have a graphical User Interface but if you need to use one a quick google will tell you how to use apt-get to install one. I prefer not having a GUI on a linux server as it just takes up too many system resources.

Log into your new server with the username and password that you specified during the install and you will be placed in your home directory. All the commands that are used in the setup procedure have been keyed around this directory so there is no need to change directory. This is going to be our working directory.

Lets start by making sure Ubuntu is up to date with all updates and security patches. Type the following commands and follow the prompts to update your system.

sudo apt-get update
sudo apt-get dist-upgrade

Once both these commands have completed it is time to start installing the software that we need to get our server fully up and running. This following command will use apt-get to install Apache, Mercurial, the Apache WSGI module, PHP and unzip. PHP and unzip are used in a later part of the series but there is no harm in installing them now.

sudo apt-get install apache2 libapache2-mod-wsgi php5 mercurial unzip

Once this command is complete all the software that we require has been downloaded and installed. We also need to grab a file from the Mercurial source so lets get that downloaded now. This is downloaded by using Mercurial using the ‘hg clone’ command.

hg clone http://selenic.com/repo/hg-stable

The Mercurial source has now been downloaded and put into a folder called hg-stable that has been created in our working directory.

Next we are going to create the folder structure that our Mercurial server will use to store its configuration and repositories and then change the ownership of the folder structure to www-data. This will allow the Apache web server to use the folder later when we tell it where the folder is.

sudo mkdir -p /var/hg/repos
sudo chown -R www-data:www-data /var/hg

In the next part I will show you how to set up the Mercurial WSGI script and configuration and I’ll link it to the Apache server so that you will be able to see the repositories in a web browser. Till then you can shut down your Ubuntu server using the command

sudo shutdown -h now

Tagged with: , , , , ,
Posted in Uncategorized

Setting Up A Source Control Server with Domino LDAP : Introduction

Like many developers out there I was quite excited when I heard that IBM had released a plugin for Domino Designer that would allow it to interact with Source Control Management servers like SubVersion, GIT and Mercurial to name but a few. It works by creating a on-disk version of the NFS and then you can link that on-disk version to your SCM server using one of the many SCM plugins available for Eclipse.

I tried it out and created my on-disk projects but I didn’t have an SCM server to link it to. OpenNTF has a subVersion server but getting login details for it hit a brick wall because I’d have to request that somebody create a username password for me. I did manage to create a Google Code project and got Mercurial talking to that where I could upload my source code but that is a public server and probably not advisable to use it in a corporate environment where your source code needs to be kept private.

So I decided I’d look into running my own private SCM server, something that I’d be able to use in my corporate environment and give access to the other developers on the team ( that is the real reason behind SCM servers, team based development )

Tagged with: , , , , ,
Posted in Uncategorized
Archives