Ubuntu Server Setup (Media Server and SVN)
Once the OS was installed and the hard drives were setup and sharing correctly across the network, it was just a case of installing the remaining bits of software I needed.
I have tried a few different media servers and always find myself coming back to the same one – Plex.
It works smoothly, has a nice UI, is well supported and can be accessed from all of my devices via apps or a browser… perfect.
To install Plex you need to first install Avahi. This is needed to advertise the necessary services (similar to Apple’s Bonjour), and is installed using:
sudo apt-get install avahi-daemon
In order to install Plex properly you need to add a record to the
apt-get sources file. Open it up like so:
sudo nano /etc/apt/sources.list
and add the following line to the end of the file (a relevant comment is also a good idea):
deb http://www.plexapp.com/repo lucid main
With that done run the usual
sudo apt-get update
and then install Plex using
sudo apt-get install plexmediaserver
It is easiest to access the media server through a browser so hit this URL, add your files to the libraries and you are good to go.
It can take a little while for Plex to add/organize your media (especially if you have a lot of it) but you can still play with the settings while it does this in the background.
I know there are many fights between Git and Subversion fan boys when it comes to the right version control system, but I was brought up using SVN so that is the one I prefer. I do use Git where required, it has it’s place, but just not for my everyday coding.
Installing the SVN packages was simple via apt-get:
sudo apt-get install subversion subversion-tools libapache2-svn
This will install the SVN base package as well as some additional tools and Apache modules. That should give you all you need to get Subversion it up and running.
I already have a current SVN directory in place but if you do not then add it like so (with whatever path you require):
sudo mkdir /home/svn
For each new SVN repository – add a project folder:
sudo mkdir /home/svn/test_project
create the new repo:
sudo svnadmin create /home/svn/test_project
add the initial directory structure:
sudo mkdir trunk tags branches
and import the above folders:
sudo svn import /home/svn/test_project/trunk file:///home/svn/test_project/trunk sudo svn import /home/svn/test_project/tags file:///home/svn/test_project/tags sudo svn import /home/svn/test_project/branches file:///home/svn/test_project/branches
In order to access your SVN repositories you must update the permissions on
/home/svn so that they are owned by the same user:group as Apache, allowing it access, like so:
sudo chown -R www-data:www-data /home/svn
The first thing you need to do when configuring Apache for SVN is enable the ‘dav_svn’ module if it isn’t already, do so like this:
sudo a2enmod dav_svn
With that done we need to open up the Apache config file:
sudo nano /etc/apache2/apache2.conf
and add the following to the bottom:
<Location /svn> DAV svn SVNParentPath /home/svn <LimitExcept GET PROPFIND OPTIONS REPORT> AuthType Basic AuthName "Subversion Repository" AuthUserFile /etc/svn-auth Require valid-user </LimitExcept> </Location>
This tells Apache what the SVN path is and also enables some basic authentication. In order to complete the process we just need to create a file containing the authentication data. Enter the command:
sudo htpasswd -m -c /etc/svn-auth username
and input your required password twice. If you want to add a new SVN user to
/etc/svn-auth just omit the
-c like so:
sudo htpasswd -m /etc/svn-auth username
this will edit the current file instead of creating a new one. Now just restart Apache with:
sudo service apache2 restart
and that’s it, you are good to go!
I hope these posts helped someone who was stuck in the same situation as me. Either way I am pretty sure I will need this info at some point in the future!
Take it easy…