Click to search Andy Jarrett.co.uk RSS feed

Loading Twitter

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 www.gnulamp.com/vi.html

First things first, lets make sure your install is up-to-date.

view plain print about
1$ sudo apt-get update

We're going to get curl to help with HTML checking later

view plain print about
1$ sudo apt-get install curl

We need vim to edit some files (If you need help with Vi check out http://www.gnulamp.com/vi.html)

view plain print about
1$ sudo apt-get install vim

Install Apache

view plain print about
1$ 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
view plain print about
1$ curl http://localhost
You should see something like:
view plain print about
1<html><body><h1>It works!</h1></body></html>

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.

view plain print about
1$ ifconfig eth0
In 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

view plain print about
1$ sudo apt-get install subversion

Install LibApach2

view plain print about
1$ sudo apt-get install libapache2-svn

Note: For neatness we could of written the above to lines as

view plain print about
1$ sudo apt-get install subversion libapache2-svn

Create SVN folders

view plain print about
1$ sudo mkdir /var/svn
2$ sudo mkdir /var/svn/MyFirstRepos

Set up SVN folders

view plain print about
1$ sudo svnadmin create /var/svn/MyFirstRepos
2$ sudo chown -R www-data /var/svn/MyFirstRepos

Create a password file Replace {your name here} with your name i.e. andy

view plain print about
1sudo 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 beginning

view plain print about
1sudo vim /etc/apache2/mods-enabled/dav_svn.conf
The file needs to look like this. To achieve this all you really need to do is remove the comments "#"
view plain print about
1<Location /svn>
2 DAV svn
3 SVNPath /var/svn/MyFirstRepos
4
5 AuthType Basic
6 AuthName "Subversion Repository"
7 AuthUserFile /etc/apache2/dav_svn.passwd
8 Require valid-user
9</Location>

Restart Apache

view plain print about
1$ 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 Comments (4) | Print Print | Send Send | 4744 Views

>> JeOS (Just enough OS, pronounced as "juice")

No, it's not.

If they want to call it "juice" then they should name it something that actually attempts to use the right letters.
Don't shoot the messenger :)
Aww, but it's so much fun! ;)

Just wondering - you didn't mention any specific motivations for doing all this in a VM?
I've got a low-end Mac mini which really cannot spare memory. The idea was to have a small footprint SVN server running on it and JeOS seemed to fit the bill
BlogCFC by Raymond Camden + Twitter @AndyJ + ColdFusion jobs + Contact Me + Snippets/Downloads + RSS .