Setting up Apache and Subversion on JeOS (Ubuntu)

I'll be honest, I don't have much linux experience. I've always liked the idea of Linux and a command line driven OS but as soon as I see the GUI I tend point and click, which means I don't learn anything new. Then comes along JeOS (Just enough OS, pronounced as "juice") from Ubuntu which doesn't give you a GUI, it just gives you the bare minimum to run a server. It's designed for VM's and perfect for running a Subversion server on your local machine in the background. The specs are:

  • Less than 100Mb ISO image
  • Less than 300Mb installed footprint
  • Specialised -virtual Kernel 2.6.24
  • Optimised for VMWare ESX, VMWare Server and KVM
  • Intel or AMD x86 architecture
  • Minimum memory 128M
  • No graphical environment preloaded as it is aimed at server virtual appliance

So with JeOS and VMWare Fusion armed I was ready to setup a light-weight Subversion and Apache server. Below documents what I did to get a single SVN repository up and running. Im not installing Trac or SSL with this just so you know. I might try and cover them later, along with multiple repositories.

Setting up JeOS with VMWare fusion is no different than setting up any other VM so I won't go over that here. I'll assume that you can do that, and have done that and now at the command prompt.

Obviously because there is no GUI supplied all commands have to be run from the Command Line/Terminal. This also means editing txt files from the terminal too. If you've never used VIMM you might want to have the following URL handy

First things first, lets make sure your install is up-to-date.$ sudo apt-get update

We're going to get curl to help with HTML checking later$ sudo apt-get install curl

We need vim to edit some files (If you need help with Vi check out$ sudo apt-get install vim

Install Apache $ sudo apt-get install apache2 This command will not only install Apache, but will start it up as well. You can check that its running by using CURL and the following command $ curl http://localhost You should see something like:

It works!

To view this from this from outside of the VM i.e. your host machine, you need to get the IP address which you can do with the following command.$ ifconfig eth0In the response look for inet addr. You should then be able to hit the IP address from your host machine and see "It works!" on your screen.

Install SVN$ sudo apt-get install subversion

Install LibApach2$ sudo apt-get install libapache2-svn

Note: For neatness we could of written the above to lines as$ sudo apt-get install subversion libapache2-svn

Create SVN folders$ sudo mkdir /var/svn$ sudo mkdir /var/svn/MyFirstRepos

Set up SVN folders$ sudo svnadmin create /var/svn/MyFirstRepos$ sudo chown -R www-data /var/svn/MyFirstRepos

Create a password fileReplace {your name here} with your name i.e. andysudo htpasswd -cm /etc/apache2/dav_svn.passwd {your name here}You'll be asked to enter a password. Do so, hit return until complete.

No we configure Apache by editing the following file with Vim that we installed at the beginningsudo vim /etc/apache2/mods-enabled/dav_svn.confThe file needs to look like this. To achieve this all you really need to do is remove the comments "#" DAV svn SVNPath /var/svn/MyFirstRepos AuthType Basic AuthName "Subversion Repository" AuthUserFile /etc/apache2/dav_svn.passwd Require valid-user

Restart Apache$ sudo /etc/init.d/apache2 restart

Thats it, you're done. You can get to your repository via your hosts browser by going to http://{your VM IP}/svn. You should get a username/password dialog which to enter the details you created in.

The final size of my VM is 1.02GB, but with no graphical UI it is only using 25MB of real memory, so leaving it running on a low end machine, which is what I intend will be easy.

comments powered by Disqus