Category Archives: Linux

Some Notes on SSL Certificates

Here are some selected notes regarding SSL Certificates, this is more of a brain dump than anything so your mileage with this post may vary.

  • You should take the time to learn the theory behind private/public key authentication, knowing why you are doing something will always make it easier to get to grips with the practical aspects of it. Stack Exchange has a nice question on it and here is a Wikipedia article;
  • If your hosting company offers to install SSL, don’t be a hero, let them.
  • If your server has cPanal/Webmin/Some form of admin that has SSL stuff, don’t be a hero, use it. (mainly because if you manually change stuff some of their scripts might change it back)
  • You should where possible follow the advice laid out by the SSL issuer you are buying from, some of them have different preferences for how the .csr file is generated and it would just be quicker then sending them the wrong stuff.
  • Speaking of .csr file – this is a certificate signing request, it is basically a file you send to an SSL issuer saying “This is who I am, please verify me thank you”
  • The command to generate the .csr is something like; openssl req -nodes -newkey rsa:2048 -keyout myserver.key -out server.csr
  • The .key file above is your private key, keep that safe (seriously)
  • Where files should sit depends mainly on your configuration and server setup, a quick google will answer any questions.
  • Depending on the SSL certificate you are asking for authentication can take a while and may involve some offline steps – plan accordingly if you are planning a launch.
Share this on

Some command line tips for the web developer

I wanted to share some tips I have collated over the years that would be useful for web developers who occasionally need to roll their sleeves up and get their hands dirty working on a server. These are by no stretch of the imagination a complete list and nor do I get too specific. The tips below should work on the majority of Linux based web servers and should apply to the majority of setups.

Where to get more help

The first thing I should point out is that if at any time you get stuck or need help you should consult your sysadmin, if you have no sysadmin and need to consult the internet, I would suggest browsing and then asking on ServerFault, the people on that site seem to know their stuff and it is a vibrant enough community.

Using Tab

When typing file or folder names you can tab once to automatically complete the name, this can vastly speed up your time in the terminal, so instead of typing vi /home/username/longFolderName/MyFileNameIsLongToo.txt you could type vi /h TAB u TAB l TAB M TAB.

You can also double tap the tab key to see a list of options available, this is useful if you have two filenames and the tab autocomplete doesn’t know what to do.

Listing Files

You probably already know the ls command, but did you know that by adding -lah after it you can greatly improve the detail you get back from it.

-l lists everything out in a nicer format, -a includes hidden (dot) files in the list and -h makes thing like sizes human readable.

The other thing some people don’t know about ls is that you can pass in the location you want to look at, so instead of typing cd /home/user/ and then ls you can type ls /home/user/

Removing Files

Again most people know about using rm to remove files, but some don’t realise you can pass multiple files into it, for example rm file1 file2

Viewing Files

cat is your friend for quickly viewing the contents of a file, so you can just type cat my_file.txt instead of going into your text editor.

For larger files you might only want to see the very top of the file or the very bottom of the file, the quickest way to do that is to type head my_file.txt for the top or tail my_file.txt for the bottom of the file.

If you are constantly checking a debug file you can set up a quick command to constantly monitor it by typing tail -f my_file.txt this follows the file and it will automatically update as new stuff enters the file.

Drive Space

If you need to know how much space is on your drives just type df -h, you will normally get information for drives you probably didn’t think existed, don’t worry about it just focus on the ones that are clearly your main drives.

RAM

If you need to know how much RAM is installed on your machine just type free -m, the main column you will want to worry about is the ‘total’ one.

History

Did you just get shouted at because you forgot to prefix your command with sudo? Type sudo !! and it will run the last command as sudo.

If you know you entered a command a couple of commands ago, hit up a couple of times and the terminal will add it in for you.

If you used a command a while ago and want to be able to remember it, type history and you will see everything that you have typed in the last while come up along with a unique number for it. Take note of the number and type ![the number] and the command will run.

The Pipe Character

The pipe character will take anything that would normally appear on the screen and passes it somewhere else, this is crazy handy for doing basic searches. So instead of typing history and scanning for every time you used sudo, type history | grep sudo and you will get only items with sudo in it.

What is running

Find out what is currently running by typing top — pay attention to the load average, if it is high there may be something going wrong. Generally look for a full disk, a process that is going mental or a load of traffic to the site.

If you just care about the load average you can get it on one line by typing uptime.

Finding out More

man + any command will give you the manual for that command, super handy for finding out what you need without resorting to Google — also just like programs you run on your computer different versions could be installed on the server, this means that the man page will be more relevant sometimes than what google searches will tell you.

Moving folder contents up a level quickly

Move all contents of a folder into its parent with mv child_dir/* ./

This means take everything in child_dir (but not directory called child_dir) and move it to the folder we are in. If you don’t like the idea of typing ./ because it looks odd you can always type the full address.

Alias Commands

If there are long or complex commands that you type regularly you should alias them, this means creating another name you can reference the command by.

For example alias lsa='ls -lah' would allow you to type lsa and what would run would be ls -lah, you can even overwrite ls if you really wanted with alias ls='ls -lah'.

If you want to pass parameters you can create an alias with a function like this (just type it into the command line); mkdir_ls() { mkdir $*; cd $*;} then when you type mkdir_ls new_folder it will make a new folder and the move you into that folder.

In closing

Hopefully you find some of these useful, if you have any to add feel free to let me know on Twitter.

Share this on

Setting up Redmine from a blank Ubuntu install

Here is a dump of all the commands I typed in to install Redmine onto a blank Ubuntu install.

I am not saying this is the best way to do it (there are definitely better ways to install the dependencies ahead of time) but it worked for me.

sudo apt-get update
sudo apt-get install build-essential
curl -L https://get.rvm.io | bash -s stable --rails
source /usr/local/rvm/scripts/rvm
rvm pkg install zlib
rvm remove 1.9.2
rvm install 1.9.2
rvm use 1.9.2 --default
gem install rails
sudo apt-get install mysql-server mysql-server-5.5 libmysql-ruby libmysqlclient-dev mysql-client-5.5 mysql-common
#Enter MySQL root password twice
gem install mysql2
gem install bundler
mkdir /home/redmine
cd /home/redmine
wget http://rubyforge.org/frs/download.php/76448/redmine-2.1.0.tar.gz
tar xzvf redmine-2.1.0.tar.gz
rm redmine-2.1.0.tar.gz 
mv redmine-2.1.0/* ./
rm -r redmine-2.1.0/
bundle install --without development test postgresql sqlite rmagick
mysql -uroot -proot_password
create database redmine character set utf8;
create user 'redmine'@'localhost' identified by 'redmine_password';
grant all privileges on redmine.* to 'redmine'@'localhost';
exit
cp config/database.yml.example config/database.yml
vi config/database.yml
#Edit databases to suit your needs
rake generate_secret_token
rvm pkg install openssl
rvm reinstall 1.9.2 --with-openssl-dir=$rvm_path/usr
RAILS_ENV=production rake db:migrate
RAILS_ENV=production rake redmine:load_default_data
#select your language
ruby script/rails server webrick -e production 
Share this on

Working with Ubunutu? Save yourself a headache and run sudo apt-get install build-essential

If you are working with a clean install of Ubuntu and are trying to set up some sort of development environment you will almost definitely need to run sudo apt-get install build-essential.

The command installs the build-essential package which amongst other things installs a C compiler, which you will almost certainly need because a lot of things in the GNU/Linux world are written in C.

Some tutorials will include this step (or bury the build-essential package in with a host of other packages to download) but many of them assume you must have already performed this step.

Share this on

Interview with Stephen Kinkaid from Big Wet Fish

Today I am proud to share with you an email interview I conducted with Stephen Kinkaid, the owner of Big Wet Fish, a web hosting company based in Northern Ireland.

I should say, I am a customer and BWF fanboy – so was very glad to get this interview, I think a lot of hosting companies could learn from what BWF are doing.

Anyway, onto the interview!

For those who don’t know who you are, could you give us a bit of an introduction.

My name is Stephen Kinkaid and I am owner of Big Wet Fish Hosting in Belfast.  I was born in 1974 (get the calculators out) and I grew up in Derry/Londonderry.  I went to Queens University in Belfast in 1992 to study Computer Science graduating in 1996.  I then completed my Teacher Training at Queens and got my first teaching job in Glengormley High School in 1997.  I moved to te role of Teacher in Charge of IT in Carrickfergus Grammar School in 2000 and onto Head of IT in Carrickfergus College in 2007.  I have been working full time at ‘the fish’ for well over a year now and am excited about what we have achieved to date and what we hope to achieve in the future.

A level students needing web space – Carrick Grammar must have been pretty forward thinking, did you get to affect much of the curriculum there?

Unfortunately not. You are constrained by the Curriculum and the need to have the students pass exams. The specification at the time for the web design unit stated that websites should have ‘Advanced Content’ so I took that as the chance to host the websites and have a little bit of php and mysql going on (by little I mean real simple stuff but enough for a basic introduction and stir their curiosity). Ironically at an Exam Board training day I was informed that adding a (wait for it) ‘Flash Navigation Button’ or an html image rollover or a hit counter would also be classed as ‘Advanced Content’ for the purposes of the mark scheme. In my opinion something is seriously wrong with the teaching of IT and Web design if the exam board class an html image rollover as advanced content.

You may have seen the debate of late about IT in schools and how it fails to deliver what is needed for life at University or the World of Work. Although I am not a teacher any more (well technically I still am just am not teaching!) I tend to agree with many of the critics about the poor state of IT in schools. In defence of teachers, a teacher has to teach the specification in order to have their students pass the examination so it is unfair to pile all the blame on teachers. Take the provided software on the managed service solution to schools – the only provided software for web design in schools on this date in 2012 is Microsoft Frontpage so unless a school invests from their own budget this is the only tool a teacher has to help a student develop a website. I had to fight to get £3000 to buy en education site license for Dreamweaver from the limited school budget. I have been in classes where teachers have told students that a Frontpage Layer is just like a Publisher Textbox in that you can move it around (yes the teaching of web design IS that poor in schools)! I could go on for paragraphs here but I think you get a sense of how strong I feel about this. The Government is investing millions in a new managed service network for schools and I fear training of staff and proper software provision will be neglected once again.

So that is your history, but lets talk about the present! For those who are unaware of Big Wet Fish, could you give us a brief history.

I did an interview for repknight.com back in June 2011 and much of what I summarise here can be found on their Blog.  http://repknight.com/blog/?p=52

I started BWF in 2002 as a hobby when I needed some reseller space for my students to use for their websites they were doing for their GCSE and A Level work.  I used to get frustrated at the standard of IT Teaching in schools (I still do!) and I wanted to give my students the ability to host any web work they did on line and to also introduce them to basic php and mysql.  I started selling web plans on Ebay in 2003 but did not really start any serious work until November 2007 when the first BWF website went on line.  I wanted to start a company where clients came first – where clients were more than a number (the old cliche!) and where clients felt valued.  We always try to go the extra mile for clients using a common sense approach.  Clients are seeing that and our growth in the past 12 months has seen an 85% increase in turnover and we see no signs of that growth slowing down.

Could you briefly describe the current setup for us, in terms of staff and locations.

We have servers located in two locations.

  • Firstly we have servers (Shared, Reseller, VPS and Cloud) in Bluesquare in Maidenhead near London.  We have been using this data centre for a few years now and have found them to be a solid provider.
  • Secondly we have servers (Shared, Reseller and VPS) located in DIMEnoc in Orlando Florida :  http://vimeo.com/32164614  gives you a tour of this facility

We have a full compliment of staff available 24/7 to support clients with their needs.

Stephen K (myself)

I work from Belfast and manage all sales and accounting enquiries.  I also help out on the helpdesk when needed and I manage any new server build projects.

Giles W (Senior Support Admin)

Giles is our Senior Support Admin and his role is to handle any escalated support tickets from our front line team and also work with me on a daily basis to ensure things run smoothly.  Giles did a design degree from Full Sail University in Orlando Florida and started off his career with Hostdime in Orlando where he worked his way up to a Level 2 support technician.  He left Hostdime Orlando in 2010 and has been working for BWF since that time.

Praveen N (Level 3 Linux Tech)

Praveen works the helpdesk for us office hours Monday-Friday and he is a computer science graduate specialising in Linux Servers.

January W (Administrative Assistant)

January is Giles’ wife and she assists with Level 1 Support tickets, sales tickets as well as accounting issues on a contract basis.  She presently works for us 2 days per week.  Giles and her have just had a baby so her hours fluctuate but many of her admin tasks are not time critical so it works well for us and her.

Nixserv Solutions (remote technical team)

We also have a contract with a remote support company who are based in India.  This company have built up a strong reputation in the industry as being trustworthy and reliable and these technicians are on hand 24/7 to handle support tickets that we do not handle in house. The person who owns this company was a former Hostdime India technician and he came highly recommended by the Vice President of Operations at Hostdime USA.  We trust their judgement so trust this company based on that strong recommendation.   When a ticket is not answered internally within 30 minutes the remote technicians will pick up the ticket and handle it efficiently 24/7.  They are also monitoring the servers 24/7 and alert us the moment there is an issue.  In fact if you check our Twitter feed this morning a client just said :

‘Why to host with @bigwetfish? They tell you when something went wrong and you didn’t know. They don’t keep you in the dark! The light is on!’

It is our strong desire within the medium term to bring more dedicated technicians working for us onto the helpdesk and to rely less and less on a remote Indian team.

DIMEnoc

We have contracts in place with DIMEnoc USA and DIMEnoc UK for our servers, bandwidth, IPs etc  There are spare parts for every server we deploy in the data centre and staff available 24/7 to respond in the event of a service outage.  Also in the unlikely event we have a support issue we cannot handle internally DIMEnoc and their sister company Hostdime Level 3 support admins will support us (for a cost) on a per ticket basis.

Seems like you have a scaleable team, on the theme of scale, Big Wet Fish have been known as a customer service focused company – do you think that reputation can scale as you grow bigger?

Yes we really believe we can handle this.  We want to look at examples of other hosting companies and take the positives and negatives and learn from successes and mistakes from other companies.  12 months ago I started the painful process of ‘letting go of my baby’ and I firmly believe our reputation today as as strong as it was 12 months ago.

Hosting Con in Boston in July 2012 has a number of seminars relating specifically to this question.  I plan to attend that conference this year to network and learn from others.

We built our business on strong customer service and the business will fall if we ever let our guard down.  This is our primary goal to continue to give clients what they need.  As we grow we need to instill this ethos into the entire workforce and enable the workforce to make ‘ad hoc’ decisions based on common sense.

Take yourself last week.  You had been asking about installing Ruby on your cloud server so I made a decision to offer you a free standard VPS server for as long as you had an active cloud server to allow you to test things without the fear of you having issues with your live cloud server.[Toby Note: I was incredibly grateful for this!]  It is these sorts of common sense business decisions that help clients to grow to love us – we need to enable all staff to make such decisions moving forward.  That decision I made for you will cost me a little money in terms of server space I cannot sell to someone else BUT critically the decision was taken to aid an active client and our primary aim is to keep all clients happy.

Some of the seminars I have in my mind to attend at HostingCon in Boston in July 2012 are:

  • From Bedroom to Boardroom
  • How to get your whole company thinking and acting like owners
  • Maximise productivity by supporting employee freedom
  • Growing and Managing a remote workforce
  • Take your company to the next level
  • Finding your story : Branding yourself in the hosting industry
  • ‘The next evolution in customer care’

As you can see we are focused on moving forward but critically moving forward always with our clients at the forefront of our minds.  We must be doing something right as we were approached recently by another hosting company who do similar things to us to buy us out.  We looked at the offer on the table and politely said no.

Hosting Con sounds good, but are there any web host events closer to home that you think would be worth a look?

Were it Web Design then there are loads of local events but for Web Hosting unfortunately much of the current development seems to be in the United States (any excuse for a trip to Boston!).  There are the World Host Days and this year it was held in Germany which I guess is much more local than the USA.  We did not attend but many of the seminars are available online:  http://www.worldhostingdays.com/eng/agenda-120322.php

That said, the range of speakers at Hostingcon meet the needs more of our organization at this moment in time with much more focussed talks relevant to us.

What technical challenges have you had to face as your business has grown?

We stick to what we  know and can manage so that helps us overcome any technical challenge.  For example, we have the ability to deploy Windows Servers on our Cloud but we only will do so on the understanding that it is 100% unmanaged.  We specialise in Linux CentOS servers with the Cpanel Control Panel.  Having all our shared and reseller servers set up in an identical fashion assists us in helping clients with issues.

We work on a team approach.  We actually do not like clients calling us with technical issues as a helpdesk ticket helps us deal with the issue in a team approach and we feel a client will get better service in this fashion.  If a tech has fixed an issue that another tech is unsure about we have a strict policy that the one tech will instruct the other tech. We all learn things on a daily basis with this approach.

Any hosting horror stories you can share with us?

Server 19.  Before we deployed our own OnApp Cloud in Maidenhead we had bought some OnApp Cloud space from a Dublin based Cloud only provider.  I need to say that this particular company has evolved greatly since that time and are now known as a very stable and solid provider but in mid 2011 we started getting tickets that server 19 was off line.  We checked our OnApp logins for this provider and the server had been terminated.  Contact was made with this provider and they informed us that a developer employed by them was working on their ‘Hostbill’ module and had issued an API call to terminate some servers.  They said only a few servers were destroyed of which one was ours.  Thankfully we had R1Soft continuous Data Protection backups and this provider provided a technician to get everything back running after a few hours.  They also gave €250 credit as compensation.  They did take responsibility for this but this left us reeling at relying on a Virtual Platform to deliver shared and reseller hosting accounts to clients.

Thinking to the future now, do you have anything big in the pipeline you want to share?

Ask me after I attend Hosting Con!  Seriously though there are lots of things going on at the moment.  A summary of some is below.

Our Cloud is reaching capacity so we need to make some decisions moving forward about that within the next few months.

We also fully realise that our website is probably our biggest weakness and we have a 4-6 month plan in place to have a new website in place.  This will hopefully enable users to see more clearly what we can offer them and what we can do for them.

We also have some tentative ideas about how we could split the company into divisions which could happen at the same time as the website launch – one for our cheap shared servers where we have thousands of clients all paying a little money  - one for our VPS and Cloud servers where we have a few hundred clients all paying a lot of money. This would help us clear up the support channels available to all clients.  There are a lot of ‘grey areas’ at the moment we need to clear up.   We love our clients but moving forward as we grow we need to make our support policy much more clear.  For example, if you only pay £2.49 per month (8 pence per day) you would only get helpdesk support.  If you pay £70 per month on a cloud server you get phone support.  Having 2 divisions – one for basic shared and reseller and one for business shared and Cloud Servers seems like a sensible approach.  These are all in the ‘Melting Pot’ at the moment and are all open for discussion between staff.  Anything we change will be customer focused and we will always work hard to ensure our valued clients come first.

We will also be watching the industry to look to see how we can move forward and embrace new technologies.

Finally, is there anything else you would like to talk about or mention?

Yes it seems appropriate to end this interview with a word of thanks to our clients who have made BWF the company it is today.  Without you we would not be here. It is a pleasure to see some clients from our early eBay days renewing year on year.  These clients especially I salute for being with us at the start and sticking with us over 10 years – watching us evolve into a one man ‘bedroom’ operation into a company with many staff providing 24/7 support.

I feel I also need to mention DIMEnoc/Hostdime in Orlando Florida and in Maidenhead UK.  We are proud hosting partners of yours and have been for ten years.
Thanks for being there for us when we needed support.  Thanks for continuing to be there for us to assist with the really complex ‘head-melting’ issues.  Having the power of a huge corporation behind us gives us and our clients the confidence that we have the contracts in place to handle even the most complex issues.

##End of Interview

Thanks so much for Stephen for taking the time out to answer my questions. You can following BWF on Twitter.

Share this on