Sunday, 3 March 2013

The fruits of labour

They say a picture says a thousand words....

Sunday, 17 February 2013

Apache Virtual Hosts

I've been setting up a webserver recently and getting to the bottom of a few new Linux commands. I thought I'd use this blog to capture some of these commands to help myself in the future as well as others who may be trying similar things.

The first thing I have been doing is getting the most out of my VPS by setting up apache VirtualHosts which allows you to host multiple domains from one IP address.

To do this you need to modify the httpd_conf file. In this example I am going to imagine that I own three domains www.domain1.com, www.domain2.com and www.domain3.com. I am also going to use NamedHosts


  • sudo vi /etc/httpd/conf/httpd.conf
  • Go to the bottom of the file and add the following...


<VirtualHost*:80>  
   ServerName domain1.com  
   ServerAlias *.domain1.com  
   DocumentRoot /var/www/domain1/html  
   ErrorLog logs/domain1.com-error_log  
   CustomLog logs/domain1.com-access_log common  
 <VirtualHost>  






Lets break down exactly what is going on here

The opening line is saying grab any traffic on port 80 and check against this virtual host.

The next statement gives the server name that we want to route, in this case it is domain1.com. If the HTTP get request has a Host of domain1.com then we want to route the traffic. The ServerAlias field is acting as a sort of catch-all for subdomains, also routing these to the same location as domain1.com

    ServerName domain1.com
    ServerAlias *.domain1.com

The DocumentRoot directive indicates where the request should be routed to in order to find the site contents. In this case a directory within /var/www/domain1/. This is where you will create your website files such as index.html

    DocumentRoot /var/www/domain1/html

Finally we have a couple of directives to separate logs out for this particular domain into there own log files.

To configure domain2.com and domain3.com we just add extra vitual host definitions. The finished directives look as follows. One important point here is the ordering of the domains. The domain listed first becomes the default domain. If any unrecognised host traffic arrives at this apache server it will be routed to the defaul domain, in this example domain1. That is to say if I owned domain4.com and routed it to this server but I have yet to add a Virtual Host declaration, when someone tries to visit domain4.com it will be unmatched and revert to the default domain serving the contents of domain1.com.

 <VirtualHost*:80>  
   ServerName domain1.com  
   ServerAlias *.domain1.com  
   DocumentRoot /var/www/domain1/html  
   ErrorLog logs/domain1.com-error_log  
   CustomLog logs/domain1.com-access_log common  
 <VirtualHost>  
 <VirtualHost*:80>  
   ServerName domain2.com  
   ServerAlias *.domain2.com  
   DocumentRoot /var/www/domain2/html  
   ErrorLog logs/domain2.com-error_log  
   CustomLog logs/domain2.com-access_log common  
 <VirtualHost>  
 <VirtualHost*:80>  
   ServerName domain3.com  
   ServerAlias *.domain3.com  
   DocumentRoot /var/www/domain1/html  
   ErrorLog logs/domain3.com-error_log  
   CustomLog logs/domain3.com-access_log common  
 <VirtualHost>  

The next steps is to enable NameVirtualHost which is another parameter within the httpd.conf file. To do this simply find the following line in the file and uncomment the directive like so.

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80

Once we are done we need to save the file and restart apache. First we will test that the configuration is valid by issuing this command

/usr/sbin/httpd -S

Then issue the following command in your terminal. 

sudo /etc/init.d/httpd -restart

Apache is configured so the final steps will be to update your DNS records for your domains. This will be specific to your domain provider but essentially you will need to add the following for each domains DNS settings.

  • An A record redirecting * to your Apache servers IP address.
  • A CNAME entry redirecting www.domain1.com to domain1.com (I needed to do this you may not.)
After all is said and done you will be hosting 3 separate websites from one VPS using one IP Address.


Thursday, 27 December 2012

Degree confirmed - BSc Computing (Hons) 2.1

It has been a great Christmas break. I am feeling incredibly relaxed after a week off work and have eaten and drank far more than I should have. As a result this blog post nearly hasn't materialised but now that I have a minute I thought I would quickly document my results for my degree.

Around mid December I received an e-mail saying that the results for TM470 were available and I scored 77% (2.1). I was a little disappointed but the matter remains I was in no way able to get a 1st Class Honours degree with my current grade position, so even if I had managed a distinction it would have been to no avail. At the same time a prompt displayed on my Student home indicating that a qualification was to be offered to me which was my B29 Computing degree with corresponding classification. I promptly confirmed my acceptance of the qualification and was proud to be, for all intents and purposes, a graduate.

Just before Christmas I received some written notes about my project. These were minimal compared to typical feedback you might have come to expect from TMAs but gave me a good feel for how my work had gone. There was a sentence for each of the project goals and all in all my feedback was very positive indeed. The exception was my consideration of ethics which was practically non existent and clearly lost me some marks as well as my background reading being focussed heavily on technical implementation issues. It was good to see where I good have gone a little better though and to see that as a technical project it had been a huge success.

The actual degree is conferred upon you by the OU at a future date and you can attend a graduation ceremony of your choice to celebrate the conclusion of your studies. The graduation dates became available on 17th December 2012 and I am currently thinking of graduating at a ceremony towards the end of April 2013. The ceremony appears to be free for the graduate with a cost of £17.00 per additional guest. As far as I can see there are no upper limits to the number of guests you can bring but as only my wife and I intend to go I don't think I will be pushing any boundaries here anyway!

Graduation gowns are hired from a 3rd party vendor  www.edeandravenscroft.co.uk and hire of a gown costs £40.00. Interestingly OU graduates are not required to wear a mortar board so the option is not given when it comes to hiring the graduation gowns.

So that about sums up what I wanted to get from this blog post. Unless anything useful or interesting comes up between now and graduation I am unlikely to be blogging very frequently through here. I am kicking off a years hiatus of learning and concentrating on my family and my extra curricular hobbies including kickboxing, beer brewing and I might finally get my teeth into my Raspberry Pi for some fun!

For now merry christmas and a happy new year. To all of you continuing to study, good luck and keep going!

Simon

Friday, 21 September 2012

Coursera.org - Free distance learning course from World Class Universities

I thought I'd post this up as it is a really great site, and the best things in life are free.

Coursera is a website that provides free distance learning from world class universities and professors. The provide quite a range of courses and new additions appear to be continually coming along.

Topics available include the following,

  • Biology & Life Sciences
  • Business & Management
  • Computer Science: Artificial Intelligence, Robotics, Vision
  • Computer Science: Programming & Software Engineering
  • Computer Science: Systems, Security, Networking
  • Computer Science: Theory
  • Economics & Finance
  • Education
  • Electrical and Materials Engineering
  • Food and Nutrition
  • Health and Society & Medical Ethics
  • Humanities and Social Sciences
  • Information, Technology, and Design
  • Mathematics
  • Medicine
  • Music, Film, and Audio Engineering
  • Physical & Earth Sciences
  • Statistics, Data Analysis, and Scientific Computing

Courses run from anywhere between 4 and 12 weeks and the lectures are delivered via streamed video content. There are also collaborative environments where you can interact with other students as well as assignments which are marked and returned to you.

Many of the courses provide certificates of completion which can be included in your record of achievement or CV for employers to see. The range of computing courses is pretty incredible. I've already got myself signed up to a graph theory and social network analysis module and a statistical and data analysis course. Take a look here and get yourself signed up, its free! If you don't get on with a course you can just drop out and lose nothing :)

Simon

Sunday, 16 September 2012

The final chapter

As I put the finishing touches to my End of Module Assessment (EMA) for TM470 and in turn for my degree I couldn't help but feel slightly sentimental and reflective. Whilst it is only another EMA, one of many completed throughout the course of my degree, here in 60 pages of report writing and appendices lay the culmination of 6 years of hard work and life changing events and it felt like the perfect time to reflect on this journey.

Leaving school at 18 I attended the University of Staffordshire briefly before leaving after only a few months due to a number of factors but mainly my inability to finance myself and a gut feeling that I had not made the best decision for my future.

Upon leaving university I went straight into a paid employment with a position at a call centre where I remained for approximately a year. Knowing call centre work wasn't going to be for me I looked around for other opportunities, taking an office position for a major UK insurer. In this job I was able to show an aptitude for computing and I progressed into an IT focused team where I began to learn to program computers, specifically VBA and then onto VB.net. It was here that I realised IT was where I would like to spend the rest of my career and I wanted to formalise what I had learned over the years about computing into something tangible that would be recognised by future employers. This turned out to be the itch that needed scratching and it took me down the path to where I am today.

So what drew me to the open university? At the time I commuted to work by train and I was able to get to know a few of the regulars who shared the commute. One of them was studying for an engineering degree with the OU and would spend some of his journeys reading through course texts and proof reading assignments. One day I asked him what he was up to and he explained all about the Open University raving about the quality of study as well as tutor arrangements and face to face study time. He explained how a typical module operated and how it was amenable to his current work and life commitments. To me this sounded like the perfect way to complete a degree, after all my financial position was one of the reasons I had left university the first time around. The prospect of being able to work and learn at the same time was attractive to say the least! Armed with a fist full of motivation I visited the Open University website to explore the options for higher education study and the costs that may be involved. It was then that I took the decision to pursue a degree with the Open University.

When I set out to begin my degree in 2006 I had not long met my girlfriend. I was living at home with my parents (paying rent and bills) and as we've already established I had a relatively interesting job and a steady income that was suitable for my needs but in no way earth shattering. The OU offered fantastic support to me as a student, subsidising the cost of my first two modules and making me aware of other support arrangements that were available. I selected the B29 Computing degree due to the range of modules that were available as well as the BCS accreditation that it provided and enrolled on my first two modules of study with the OU. I created this blog with the hope of documenting my progress as it unfolded and capture anything potentially useful for others along the way.

From the outset there was no doubt in my mind that I would complete my degree and whilst 6 years seemed like a long time, the reality was that it passed swiftly. I eagerly watched the completed modules stack up on  my student home record; each marking another milestone along my journey and bringing me a step closer towards my goal. I learned to anticipate the autumn exam season and work it into my family and life commitments and as someone who is always keen to learn something new, the prospect of hitting the books wasn't a particular issue.

So how has the experience been overall? Well I think it is fair to say that its been both hard work and rewarding. I can honestly say that I have enjoyed every single minute of it. There have been many late nights, lots of occasions where I have had to say no to social outings in favour of studying and lots and lots of assignments. Would I do it again? Absolutely!

The OU has brought out the best from me and taught me a lot both academically and personally. I have developed great life skills and met a diverse and rich set of people along the way, each experiencing their own journeys in their own way but sharing the common desire to learn. That's one thing that truly stands out with the OU; when you're sat in tutorials everyone wants to be their and is motivated to be their. Each person has a different story and experiences that enrich the learning environment. The calibre of the people is exceptional! Some of my tutors were also tutors at red brick universities, others had incredible professional careers that have brought with them their own anecdotes helping to apply theory to real world examples. The breadth of people that the OU is able to attract really sets the university apart from the rest and is one of its biggest strengths in my eyes.

There have been a couple of hiccups along the way, I had a module where I was allocated a tutor a good 450 mile round trip away from me, so managed to attend a total of 0 tutorials and 0 day schools. I had a tutor who was surprisingly sub standard teaching M359. That is not to say he didn't know what he was talking about, he really did know it inside out; it was his ability to convey that knowledge in a meaningful way that was seriously lacking. This was particularly difficult for me as the subject was one I struggled to get to grips with. In the grand scheme of things though these were minor blips in what has been a thoroughly enjoyable experience.

To me the biggest strength of the OU has to be its flexible approach to study. This includes the ability to dictate the pace at which you work through each module and the overall degree as well as when you chose to study (at night, at work, at home, on the train). Its this flexibility that has allowed me to get to this point despite undertaking some serious life changes. Let's face it, life changes are something OU students will always face!

In the last 6 years I left my job in change delivery at a UK insurer and took up a graduate position with a large IT organisation where I have been progressing my career successfully ever since. All this despite being just over half way through my degree at the time of applying for the post. Slightly cheeky to apply for a graduate campaign but such is the respect given to an OU degree in industry I am where I am.  The girlfriend I had met at the start of my degree has become my wife, we have bought our first home together and we had the joy of welcoming our first child into the world in June this year. As I write this I struggle to think how I could have done any of these things without the flexibility the OU offers. Being able to study on a train, in a hotel, in advance of a major event (or catching up following one!) the OU's approach to learning has helped me through every step of my degree.

Now it has not all been down to flexibility of the OU. Every OU student will know that its as much about their efforts as it is the people around them who support them and help them reach their goals. For me this has been in the form of support from my wife, family and friends without whom I would not have reached this point. Whilst studying is a truly rewarding and enlightening experience it brings with it stresses and strains that require dedication and commitment in order for you to succeed. It would be impossible to have made the commitment without the support I had around me. I can't recall the number of times I have had to say "no, I have to study" to my wife, family and friends.  I have always tried my best to say yes but eventually you have to do the work and inevitably sacrifices have to be made. Whether it be an invite to dinner, a trip away, planning a holiday or planning a wedding there have been so many occasions that I have had to say no. In the vast majority of cases the response has been unconditional understanding.  Recognising this support is important to me so I'll take this opportunity to thank each and every one of you even though you may never read it. I'll tell you all in person too...

Having my wife looking after not only me, but the running of our house and more recently our family whilst I undertook my degree has been incredible. There are times I definitely wouldn't have reached deadlines, ate or washed without that continual support. She has been a complete rock throughout my degree and if I pass this module, (which hopefully I will) and get to attend my graduation it will be as much about recognising her achievements in supporting me as it will be about recognising my degree.

So what next... My experiences with the OU have inspired me to continue down a road of life long learning and after a year out I plan to pursue an MSc in a Computer Science related field. Exactly what I want to study has yet to be decided. One thing this experience has taught me is that there is so much to learn and so many interesting things to learn about thinking about where to go next is all part of the fun. For now though I think both my wife and I deserve a bit of time where there aren't constant deadlines looming! Establishing ourselves as parents and taking stock of where we are today.

To wrap up, I started this blog with the aim of capturing my experiences with the OU in the hope that it would inspire others to study and act as a useful resource for students. I can only hope that it has achieved some of these goals. Through my interaction with fellow and prospective students, many of whom have got in touch with me as a result of this blog, I like to hope I have been able to share some of the inspiration I took from the commuter on the train who inspired me to turn to the OU 6 years ago.

This post has the title of the final chapter as this chapter of my life is drawing to a close, I like to think that there are a library of books yet to be embarked upon on particularly when it comes to learning.

Simon

Friday, 3 August 2012

TMA03 Results

After a slight delay in marking I received my results for TMA 03 at the beginning of the week. I scored a remarkable 92% which I am very pleased (if somewhat surprised) with. This has been a great result and reflects the time and effort I have spent on my project.

This just leaves me to finish up the development work and write up the finished report ready for the EMA submission, marking the end of not only another year of study but also my degree in computing with the OU. I still haven't quite come to terms with that so I'll save those thoughts until once the EMA has been submitted! For now I'm enjoying the Olympic games like every other person in the UK!

Simon

Saturday, 14 July 2012

TM470 TMA03

I submitted TMA03 on Tuesday, slightly after the 12 noon deadline due to work commitments but for the TMA's you are given a 12 hour grace period until midnight on the due date so this wasn't an issue.

The project is going well and development has been progressing at the correct pace. For TMA03 we are asked to produce a draft of the EMA, although there is an appreciation that we may not have everything that we need to formally draft the final report. I ended up submitting 50 pages or so including all my appendices but this was a draft with most of the sections completed so I don't think it was overkill. There was a bit of confusion in the TMA03 guidelines which instructed you to write approximately 6 pages on the review and evaluation of the project, but then asked for a draft of the EMA to be submitted which would clearly be substantially more. I interpreted this guidelines as submitting a draft but it appears others have gone for the slighter approach.

All in all the course is going well, it is very light contact - I haven't actually dealt with my tutor beyond the TMA markings however this has been out of personal choice. My tutor was keen for me to give progress updates but I think that's more to do with making sure I am making progress. I've learnt a lot so far both about myself and technically so the course seems to have been good, whether paying over £700 or £1250 under the new funding arrangements would be worth it I am unsure. In my head I've treated it like a discipline bond, I have paid that money I am definitely going to make time to work on my project!