Posts Tagged SVN

Ubuntu Home Server (UHS)

I've recently set up a home server using Ubuntu. I thought it might be useful for me to record my experience and any problems / pitfalls / useful tidbits of information I found along the way. It's not been a particularly arduous process, but hopefully this might help someone out in the future.

The hardware I used was a semi-home build; I bought the Intel D525MW motherboard, which has an integrated dual-core Atom 1.66GHz processor, and fitted it into a case along with some RAM and a hard drive. The processing power on the motherboard should be more than enough for what we're asking it to do (see below), and it's low power so that means we can leave it on all the time, and it's passively cooled too. The other advantage is that it's mini-ITX, so nice and small to fit under the stairs where it's going to live. I fitted the board into a cheap no-name mini-ITX case which actually turned out to be decent quality, and added 2Gb Kingston RAM. The hard drive is a Western Digital Caviar Green (low power) 1Tb from a previous NAS setup. There's no DVD drive (what's the point nowadays, really?), and I'm using onboard video and sound.

My mini-ITX home server, prior to being shoved into the cupboard. Copyright Haydn Williams 2011

My mini-ITX home server, prior to being shoved into the cupboard. Copyright Haydn Williams 2011

The software I installed was obviously customised to fit our needs / requirements. I chose Ubuntu as the operating system, because a Mac was too expensive, a Hackintosh was too complicated in terms of finding 100% compatible hardware, and Windows Home Server was discounted for reasons I can't remember right now, but were definitely valid and unresolved. I have a little bit of experience with Linux, but never in an admin role and I've never used Ubuntu before. I have used the Terminal in Mac OS and Linux before, so have some basic competence in that area. I certainly wouldn't class myself as a 'guru' though, so if you're not a Linux whizz then don't worry – if I can manage it, I'm sure you can!

In terms of applications installed, we needed the server to carry out a number of roles:

  • File server (including Bonjour for Macs on the network)
  • DLNA server
  • NTP
  • Web server (including WordPress)
  • Repository / eventually CruiseControl
  • Time Machine backups

I've therefore split the software section up into a number of posts on this blog, all starting with the letters 'UHS':

  1. Installing and Updating Ubuntu
  2. Admin tools
  3. Hardware monitoring
  4. Samba file server
  5. Apache, MySQL, PHP (LAMP) web server + WordPress
  6. SSH and Subversion (SVN)
  7. DLNA media server
  8. Time Machine backups
  9. Network Time Protocol (NTP) server
  10. Calendar (iCal) server

Tags: , , , , , , , , , , , , , , , ,

UHS6 – SSH & Subversion (SVN)

SSH

SSH lets you remotely access your computer, or other computers, using a command-line interface. Installing SSH really is a breeze:

sudo apt-get install ssh

It was so quick and easy I even had to check it had actually been done!

>which ssh

The binary did exist and I was able to log into the machine without any problems. Almost too simple! You'll probably want to increase the security of your setup a bit by using hosts.allow and hosts.deny files. These live in /etc and consist of rules that determine which hosts should be allowed to connect to certain services on your machine. My hosts.deny has the following:

ALL: ALL

and my hosts.allow has this:

127.0.0.1
SSHD: 192.168.1.23

This results in all connections from all IP addresses being denied, except for SSH from one specific machine on the local network. Note that the hosts.* files will only work on services started as daemons, not standalone, and these services must support TCP Wrappers (which are what make hosts.* work). This page, and another, revealed the following command to determine whether a particular daemon has support for TCP Wrappers; it basically checks whether the daemon depends on the relevant library, libwrap.so.0:

ldd /usr/sbin/smbd | grep wrap

Running the above command doesn't give any result, so smbd – the Samba server daemon – isn't affected by hosts.* (see my other post for rudimentary details on securing Samba). There are plenty of pages which delve into more detail about more complex rules for hosts.*, or you could just:

man hosts.allow
man hosts.deny

 

Subversion

Subversion (SVN) was no more difficult:

sudo apt-get install subversion subversion-tools

The first chance I got to test SVN as a client was when installing WordPress, which is covered in a different post. To test the server side of things, I just created a repository:

sudo svnadmin create /var/svn

Everything went swimmingly, so further setup will take place at a later date. There are a number of good guides online that will take you further with Subversion, which is beyond the scope of this post.

Tags: , , , , , , , , , , ,

Eclipse Ganymede / PHP / SVN

The Eclipse Foundation yesterday released the latest version of the Eclipse IDE, named Ganymede (press release). This is the first attempt at synchronising the release of a new version of the IDE with new versions of plug-ins and 23 of the ~90 registered plug-ins have managed to come up with new releases alongside the main IDE.

Eclipse Ganymede splash screen

I use Eclipse for a few different things, including writing in Java, HTML, JavaScript, PHP and LaTeX. I downloaded and installed the JEE version of Eclipse, which obviously supports Java straight out of the box, along with HTML and Javascript (which you can now format automatically). However, in the Europa release of Eclipse I use the PDT project plug-in to support coding with PHP. The PDT set of tools isn't included by default with Ganymede. Unfortunately, the current release doesn't work on Ganymede, and there are no plans to release a new version until 15 September 2008. That means I'm going to have to stick with Europa for PHP until then, and I'm inclined to just use it for everything, rather than have two versions of Eclipse going on my machine. EDIT: Sasha has posted a comment linking to this page on the PDT Wiki, which details how you can get Ganymede playing nicely with the current version of PDT.

I haven't even tried to installed TeXlipse yet! EDIT: v1.2.0 of Texlipse installed OK, and will highlight syntax and show document outlines correctly. However, I've not been able to make it compile anything. A colleague at work had the same problem with Texlipse and Europa, while I never did, so this might be machine-specific.

First impressions of Ganymede are pretty good anyway, with the main exciting feature being built-in SVN support through the bundled Subversive plug-in. Well, to a degree at least. Before I could connect to our repository here at work, I had to install an SVN Connector from the following update URL in Eclipse:

http://www.polarion.org/projects/subversive/download/eclipse/2.0/update-site/

I initially tried the JavaHL connector, but then actually read the documentation on this page, which states that JavaHL is "win32 only". So, I subsequently installed the SVNKit 1.4.something release (1.5.0 is available, but is an RC not a full version) and everything worked fine.

New view of Subversion repository through Subversive

First impressions of Subversive are good, with the software automatically knowing which folders are trunks, branches, tags, etc., and setting icons accordingly. I've not yet done any merging, but there seem to be big GUI improvements there over the previous SVN plug-in I was using (Subclipse). Subversive seems to be playing fine with our SVN server in general.

There's a good summary of the changes in Java on the Eclipse help site. For example, "Code clean up on save" lets you perform certain actions each time a file is saved, such as formatting the code, and removing trailing whitespace. There have been loads of improvements to Content Assist (the bit that tries to auto-complete code for you), which I won't detail here, but they're worth looking at. There's now a "Template for adding JUnit 4 test methods", although I've not tried it yet. In fact, there's so many improvements I'm going to just give you that same link again, and urge you to check it out.

So overall, Ganymede seems pretty good, and there are definitely some features in there which I think will prove useful. Roll on September and the availability of PHP in there, and I'll be a very happy bunny.

Tags: , , , , , , , , , , , , , , ,