Ben Shephard

Apache default name virtual host issue

by Ben on Jun.06, 2010

My website runs on Apache which can set up to host multiple sites at once. I’ve been hosting several sites for a while but that wasn’t the intention when I first set it up. I decided I wanted to move my blog into a directory of it’s own rather than the default directory so I did that and set up it’s own virtual host entry in the Apache config files. I opened my site up in firefox and instead of seeing my blog all I saw was the contents of the default root web directory.

After much faffing around and things breaking and having rebuilt all of my virtual host files several times bshephard.com kept pointing to the default root folder in /var/www rather than what I’d put in the config file.

I found the reason for this was that bshephard.com was the first entry in my system hosts file (/etc/hosts) rather than the host name of the machine so I swapped those around and restarted Apache and bshephard.com was alive once again. It seems apache takes that first hosts file entry and assumes that’s what it’s intend to serve up over and above the defined virtual hosts in it’s own config files.

Anyway this thing just cost me about 12 hours of my life and there is very little out there on the forums so I thought I’d post it to try and save someone else hours of pain and frustration.

In other news http://crazytrainmusic.co.uk is the latest project I’ve been working on. It’s still a work in progress but things are coming together nicely and it’s live. Fingers crossed it will start to sell again after the lest few weeks of outages due to the old site getting hacked twice and rushing to rebuild it and get it going again. If you need some new pickups it’s well worth checking out.

:) = 5.5

Ben

Leave a Comment more...

Another big saving thanks to open source software

by Ben on May.16, 2010

One of the subjects I’ve been introduced to at work recently has been DNS and specifically BIND9. Through watching and learning from Dan I managed to pick up a few bits of the basics of how BIND9 works. One of the issues I had when I wanted to set up a DNS server is how to point external and internal traffic on my network to the right IP address. All external traffic that goes to a site I host has to go to my real world external IP and everything inside has to go to the servers 192.168 internal address. Dan mentioned something about views and I watched as he set it up and defined the internal networks we use at work. You don’t have to do much for the external traffic because that’s explicit but each method points to a zone file which defines the IP addresses for a particular domain name. There are two of those for each domain name one for internal traffic and one for external.

The way I’ve always done DNS is to let someone else deal with it. I’ve always used no-ip.com for bshephard.com and since I’ve bought some from 123-reg I use their DNS servers and I’ve had business broadband which comes with a static IP address which is costing me about £33 a month and I only get 3.5Mb downstream and about 600Kb upstream probably due to saturation on my local phone exchange. Today I stumbled on an article on how to host my own dynamically updated DNS server for my 123-reg domains.

The idea is to set up a BIND9 DNS server on my box and then use my no-ip.com account to point to that and run a script every time my IP address changes that updates the zone files and reloads BIND9 thus serving up the correct IP address for the likes of sts-it.co.uk without me having to spend a fortune on business broadband or registering the name through someone like no-ip.com. I found this all written up HERE by a chap called Ian Atkinson from Leeds. As soon as I read it everything just clicked into place in my mind and I knew what I wanted to do was possible. His article is really well written and apart from the initial sticking point of getting my head around the Debianised BIND config files on my system I was pretty much there.

By running my own dynamic DNS server in this way I can abandon my expensive business broadband account and move to Virgin Media’s cheapest domestic package which is three times faster than what I have and half the price and means a saving of just over £200 a year. The only problem is that I can’t test this setup yet as my IP address is static and never changes and until my Pipex contract expires and I can get Virgin Media installed I’ll not know if it works or not. as soon as my contract is up if they won’t offer me a better deal I’ll get Virgin installed side by side with Pipex and port everything over once it’s tested on bshephard.co.uk which I’m using for trying this out at present.

Over the last week or so I’ve also been testing out Google Analytics to monitor traffic to my site. I don’t have any real use for this kind of thing but it’s interesting to see where my visitors come from and see everything graphed out nicely and be able to run custom reports to look for trends and stuff. I can see why businesses want to use things like this as it helps them advertise effectively and to improve their site to get the most out of it. I don’t get a huge number of hits but I’m hoping perhaps someone will have read down the page this far and that will show up in a nice graph when I go back to check in the next few days.

All in all I’ve not got much housework done today because I’ve been on the computer setting all this up but hopefully in a years time I’ll be a bit better off for it.

Ben

:) = 7.8

Leave a Comment more...

Twitter overdose

by Ben on May.10, 2010

Lot’s of things have been happening to me in recent weeks that for one reason or another I’ve not felt I’ve been able to write about. Events at work have taken a few good turns with me now working much more closely with Dan who is responsible for the companies Linux servers with a view to me being able to act as a stand in should he be on holiday or off sick or otherwise unable to work. I’m really enjoying that and although so far a great deal of what I’ve been watching him do has been a little bit beyond me at present but It’s sinking in and in my own time I’m experimenting with some of the open source software that he’s already implemented to gain a better understanding of how it works.

Apart from exploring new technologies in my spare time I also seem to have made a few new friends recently via twitter. I like using twitter but I not on the level some use it and I’m starting to find it’s detracting from the reason I turned the computer on in the first place which is mainly to spend time researching and learning new things. If I’m going to have a conversation with someone then I’d rather use instant messengers because the message is private and you generally get an immediate response. I think the idea of twitter is as a status message about what I’m doing or events that are unfolding in front of me. Of course it’s useful to be able to send feedback to others but if that’s going to turn into a conversation then twitter is not the place for it. I’m increasingly noticing my time line getting filled up with the conversations of others which I have no interest in. It feels like twitter is slowly taking over my life like facebook once did so I think it’s time i put the brakes on a bit and limited myself. Social media is good in small doses but too much can be bad for you and become distraction.

Bed time now I think

Ben

:) = 6.5

Leave a Comment more...

Fault Lines – Cyberwar

by Ben on Apr.25, 2010

Just watched this documentary on Aljazeera and thought I’d post the youtube version on here because it was pretty interesting.

Leave a Comment more...

The digital economy bill – Labour’s statement

by Ben on Apr.24, 2010

I wanted to try and work out who I should vote for in the next election so I’ve spent the week watching the campaign and reading up on the parties. It seems most of the major topics talked about in the manifestos have little impact on me. One of the key deciding issues for me is the parties approach to technology issues and the digital economy act has been worrying me in recent weeks and months. I decided to write to the local candidates for the three main parties expressing my views and asking what they would do about my concerns should they be elected next month. Today i had my first reply. Not from my candidate but from one of her campaigners. This was the reply.

Dear Ben,

Thank you for your email. I am helping Gloria de Piero answer the vast amounts of email being received. The Digital Economy Act was passed by parliament by the Labour government and the Conservatives. Obviously, you understand why it was felt necessary to pass the bill. Artists and the record companies are losing a lot of money and many people refuse to pay for their downloads, even if they are reasonably priced. The situation is this, any business, regardless of their trade, expects payment for their service. At the moment, this is not always happening. The situation will only get worse as the internet expands more and more. In order to protect future in this area, it was felt that as a country we had to try to ease the problem.

As I understand it the Act will take around 2 years to be fully functioning. Ofcom have to draw up an Industry Code for consumers, IPS’s and copyright holders. Any illegal activity will activate a notice asking you to stop. You will therefore know that there is a problem before any further action is taken. The ISP’s will work with you as much as they can as it is in their interest to do so. The code will be reviewed by the government and they will then consider how it should be enforced. Nobody wants people like you to suffer but people do have to accept they have to make payments for the service they are receiving the same as what they would expect to do so in any retail outlet.

I understand this Act is emotive but am confident a Labour government would monitor the situation carefully and do the fair thing.

Yours Sincerely,

Melanie Darrington

The line that annoys me most is this one “Nobody wants people like you to suffer but people do have to accept they have to make payments for the service they are receiving the same as what they would expect to do so in any retail outlet.” This act states that I can be cut off without a trial. If I’d walked into my local branch of HMV and stuffed a CD in my jacket and I’d be put in front of a judge accused of theft before being sentenced but not if I steal the same music by other means. I’m not against this bill’s intentions but I am very much against it in it’s current form. I think this email just confirms my disappointment with the Labour party. This bill was pushed through when it was as it would never have gone through if it had been properly debated. Sadly the media were focussed on the fact that an election had been called and very little time was given to what was going on in the background in the mean time.

The Lib Dem’s seem to be doing very well so far but I’ve also emailed Jason Zadrozny my local Lib Dem candidate but I’m still awaiting a reply.

Ben

:) = 6.5

Leave a Comment more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!