Home | Blog | Twitter @AndyJ | Contact Me | Snippets/Downloads | RSS

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 plainprintabout
 $ sudo apt-get update

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

   view plainprintabout
 $ 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 plainprintabout
 $ sudo apt-get install vim

Install Apache

   view plainprintabout
 $ 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 plainprintabout
 $ curl http://localhost
You should see something like:
   view plainprintabout
 <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 plainprintabout
 $ 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 plainprintabout
 $ sudo apt-get install subversion

Install LibApach2

   view plainprintabout
 $ sudo apt-get install libapache2-svn

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

   view plainprintabout
 $ sudo apt-get install subversion libapache2-svn

Create SVN folders

   view plainprintabout
 $ sudo mkdir /var/svn
 $ sudo mkdir /var/svn/MyFirstRepos

Set up SVN folders

   view plainprintabout
 $ sudo svnadmin create /var/svn/MyFirstRepos
 $ sudo chown -R www-data /var/svn/MyFirstRepos

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

   view plainprintabout
 sudo 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 plainprintabout
 sudo 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 plainprintabout
 <Location /svn>
  DAV svn
  SVNPath /var/svn/MyFirstRepos
 
  AuthType Basic
  AuthName "Subversion Repository"
  AuthUserFile /etc/apache2/dav_svn.passwd
  Require valid-user
 </Location>

Restart Apache

   view plainprintabout
 $ 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.

TweetBacks
Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Peter Boughton's Gravatar >> 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.
# Posted By Peter Boughton | 8/26/08 4:21 AM
Andy Jarrett's Gravatar Don't shoot the messenger :)
# Posted By Andy Jarrett | 8/26/08 4:33 AM
Peter Boughton's Gravatar Aww, but it's so much fun! ;)

Just wondering - you didn't mention any specific motivations for doing all this in a VM?
# Posted By Peter Boughton | 8/26/08 1:34 PM
Andy Jarrett's Gravatar 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
# Posted By Andy Jarrett | 8/26/08 2:02 PM
BlogCFC / created by Raymond Camden / running version 5.9.5.003 / Contact AndyJarrett.com / Pet Rescue SOS www.redgiraffes.co.uk