All About Web Hosting

A repository for all kinds of useful web hosting information

Cloud Computing and Vulnerability

leave a comment »

“Cloud computing” being the buzzword du jour we’re all being told how it’s going to change everything blah blah blah. Apparently it will even get rid of desktop/laptop computers according to a Twit I listened to recently – we’ll all be using our phones for everything. Coding on my phone seems distrinctly unlikely!

But there are downsides to “the cloud” (would those be storm clouds? Lightning?) and plenty of people have mentioned them. Privacy concerns. Security concerns. Really, the usual concerns for any Internet technology.

One concern that  is the idea of vulnerability. Media Temple is a popular web hosting company that is know for providing quality service – and for its (apparently) innovative “grid computing” – which seems to be a sort of cloud computing for web hosting. It’s a hosting “solution” that operates on a distributed computing metaphor. Customers’ sites are hosted on a network of computers rather than single machines.

Normally this is not a bad idea at all – after all one server can die and the effect is minimized (or there’s no effect) for the other clients. But on Wednesday May 6th something went very wrong with the system that provides storage for some of their clients. And so, something like 15,000 websites went down.

Now, in a traditional web hosting scenario, multiple customers’ sites are hosted on a single server, spreading the cost of that server out amongst those clients. Of course, if that server dies, there will likely be some down-time for those clients. But at the same time when that server dies – the damage is limited to those clients who were hosted on it. So maybe a few dozen sites are affected, not thousands.

I have no idea what went wrong with Media Temple’s grid service, but it seems to me it shows that the whole cloud computing thing doesn’t mean we should just pitch more established ways of doing things out the window.

For example, rather than having google mail handle all my email for my website (which I certainly could do) I’ve opted to stick with the usual POP/IMAP mail server thing – and have gmail pull the email off of my server. I still can access my email using google’s great webmail service, but this way – if gmail shut down tomorrow (obviously unlikely) I’m minimally affected – all my old email is still on my server.Perhaps more likely – if gmail suddenly became an expensive service tomorrow, I’m not locked in…

Like with so many things in the online world, redundancy is not bad thing.

Written by web hosting guy

May 7, 2009 at 9:31 pm

Posted in Misc

Does your web hosting company have its own data center?

leave a comment »

This is a question that everyone who is serious about their web projects should ask themselves. There are many, many web hosting companies out there, and it can be very difficult to decide amongst them when shopping around for web hosting. Too many people get wrapped up comparing storage space and RAM, bandwidth, uptime, etc. These are all important of course, but don’t forget about what’s at the core of it all – the data center.

Most web hosting companies don’t have their own data center – they simply rent some space or servers from a company that does have a data center. This is fine, but it’s important to remember that if they don’t operate their own data center, then they’re really just someone else’s customer. So if your support issue involves the actual hardware of the machine, they may not have immediate direct access to it – they’ll have to put in a support request to fill your support request!

Even if your hosting company has the best relationship in the world with whatever company owns the data center that their hardware is located in, this can still make for slower support turnaround, delays upgrading hardware etc.

I’m not saying you should only host with a company that also has their own data center, I just think that you should add this as another thing to thing about when considering web hosting providers!

Written by web hosting guy

February 2, 2009 at 7:32 pm

Posted in Misc

Using mysqldump to backup MySQL database from the command line

leave a comment »

I suspect that most people who work with MySQL database use PHPMyAdmin to interact with their database, and so may not know about how handy the command line program mysqldump is both for one-time backups and for regular use.

I believe that mysqldump comes with the regular installation of mysqldump (at least on linux servers) so it should be available, assuming you have command line access to it, etc.

Using mysqldump is pretty straightforward – the basic command is:
mysqldump [database name]

Which will output the SQL to recreate that database. Obviously, watching all that code stream by on the console is not terribly useful, so we need to dump it to a backup file – for example:
mysqldump [datbase name]  > [backup filename]

The “>” directs that output to the file.
The most common complication of this is the need to send passwords, usernames, etc. That’s easy enough as well. This command adds username, password and host:
mysqldump –user [username] –password –host [host name/IP] [database name] > [backup filename]
When run, mysqldump will ask for the password before proceeding.

If you only need a backup for one table, you can just add the table’s name after the database name in the command, and mysqldump will only dump the SQL for that table.

Then, if you need to recover a database from a dump, it’s pretty easy as well:
mysql [database name] < [backup filename]

You may need to add –user, etc to that command (as with the mysqldump example) to connect.

Hope that’s helpful to someone!

Written by web hosting guy

December 2, 2008 at 7:17 pm

Posted in Uncategorized

Tagged with , , ,

Free Web Hosting – I don’t get it

leave a comment »

You occasionally see offers for free web hosting, or people trying to find a decent free web host. I’ve never understood the point of free hosting. It boils down to this – why would you spend the time to find a free host, put up with whatever rigamarole they’re going to put you through for the free server, and then spend time building a site on that free host – if you’re going to do all this, why wouldn’t you take the step of just getting some cheap web hosting. Surely your time is worth more than the few bucks a month you save by using free hosting? To say nothing of the fact that such hosts are often insecure, unstable and unpredictable.

Seriously, if you’re thinking about this, think about why. If you’re unwilling to spend a few bucks a month to get actual hosting for your site, why are you spending time on it in the first place?

Written by web hosting guy

November 25, 2008 at 5:15 pm

Posted in Uncategorized

How to test your web host’s speed

leave a comment »

For a lot of webmasters, the speed at which their web host can serve a page is important, or even critical. Studies have found that many users will close their browser, or click to a different site if a website takes too long to display. So obviously this is an issue that should and does concern webmasters.

The problem is that there are many different elements involved in the display of a web page. First, a quick basic overview of the process.

1. The user clicks or enters a URL
2. The user’s browser connects to the server at that URL
3. The server does some “stuff” and returns a “page”
4. The user’s browser then opens connections and downloads any resources that are needed to display this page – such as images, javascript, css, etc.
5. The user’s browser renders the page.

Obviously the web server is a major part of the time involved in this process. However there are other factors that can cause a page to appear “slow” – even if the web host’s server is responding quickly.

A slow connection
If the user has a high latency connection (such as dial-up) – all of the steps that involve the user’s browser communicating with the web server will be slowed down significantly. Connection speed can be an issue even if the user has a fast connection, since the packets that make up the data being sent back and forth are routed all over the place – if the geographical distance between the user is very great, then it will take longer for those packets to arrive, even if both sender and receiver have “fat pipes.” This is one reason why companies often choose to colocate their equipment in data centers in different geographical regions.

Slow third party servers
If a web page makes use of resources from other web sites, this adds more time to the whole process, because the user’s browser must go out and get those resources from those external sites. This is often a problem with ads – if a site relies heavily on ads, each time a page loads those ads must be pulled from the ad company’s servers, which can slow things down.

Javascript, Flash, Java, etc.
The time that the user’s browser takes to render the page can be affected by the resources being used – for example javascript, flash and java all require more processing power to be parsed and displayed than simple html and images. Of course computer processors are always getting faster – but then websites are always making more use of these technologies also!

Improperly compressed images
This is a common problem when rookie webmasters or designers are involved – images that are way too big for their use on a site. We’ve all been to sites that show a photo at it’s original resolution, but “squeezed” down by changing its “width” parameter. This can make an enormous difference in load time – the user’s browser may need to go out and download a multi-megabyte image, rather than one that’s under 100k.

Many, many more
Of course there’s also many other reasons that may cause a slow page load – such as a computer slowed by viruses or malware, or a server that is being attacked by a denial of service, or poorly written code running on the server. We can’t cover them all here, but I wanted to show that there’s a lot of factors involved in a web page’s load time!

What to do?
Next post I’ll look at some of the ways to try to troubleshoot why a page is taking a long time to load.

Written by web hosting guy

November 3, 2008 at 10:23 am

Posted in Misc

Tagged with ,

Why going “virtual” may be right for you

leave a comment »

Most people are familiar with the what’s generally called “shared hosting” – whereby multiple clients share the resources of a single web server. This approach has a lot going for it – it allows for inexpensive web hosting because the costs of the server can be split among many clients – requiring each to pay less.

But shared hosting also has some problems. For one, the separation between clients on the same server is not extensive – while hosts do a lot to try to keep problems with one clients website from affecting others on the same server, when resources are shared, this is difficult. Furthermore, there can be problems rising from needs for specialized software configurations – for example some clients need PHP4, and some need PHP5 for their website… and the server can only have one version installed at a time.

The traditional solution to this problem was to go up to a dedicated server, where a server is only used by a single client. This makes for better security, performance, etc. It also means that the costs of the server must be borne by that one client – making dedicated hosting plans more expensive than is feasible for some clients.

Thankfully developments in virtualization technology have made a third option ever more useful. A virtual server is a server that runs on a “virtual machine” – a virtual version of a computer existing within the resources of a real physical machine. This virtual machine can be configured in all the ways that a “real” computer can be, and as far as the software running on it is concerned, it is a real machine.

Software like VMWare and Xen allow hosts to set up their servers to host multiple virtual machines – and these machines then can act as virtual dedicated servers for clients. Thus, the cost of the physical machine is split among the clients whose virtual servers are hosted there. The clients gain many of the benefits of a “real” dedicated server (stability, flexibility, security, performance) while still only paying a fraction of the cost of the actual computer.

This is especially helpful for ecommerce hosting, as ecommerce sites generally require greater security and often also need specialized ecommerce software like Magento which is difficult to set up on a shared hosting plan. By using a virtual server they can “start small” and not need a dedicated server right off the bat.

Written by web hosting guy

October 31, 2008 at 6:10 pm

Posted in virtual hosting

Tagged with

A few web hosting warning signs

leave a comment »

There’s got to to be thousands, probably hundreds of thousands of web hosting operations out there. Things like reseller hosting make it easy for pretty much anyone to set up shop and host a few small sites. And there’s nothing wrong with that, in general.

But as with anything, you’ll tend to get some fly-by-night operations, and if you’re looking around for somewhere to host an important site, be sure not to get stung! One thing about the web, it’s relatively easy for someone to put up a website, and a good website can make an operationg look legit when it really isn’t!

So here some things to watch out for when checking out a potential host!

  • Overselling – A problem that is epidemic in the business, this is promising far, far more than is reasonable for a hosting plan, basically taking advantage of user’s ignorance as to what is realistic pricing. For example, offer 5000 gigabytes of disk space on a plan that costs less that $10 – there’s no way a legitimate hosting provider could offer that, while storage space is cheap – it’s not that cheap! Customers of such plans will find that shut down if they actually try to use that much space…
  • No data center – A data center is crucial for reliable web hosting. Sure, anyone with a little networking know-how can hook up a machine in their basement and host a site. But to host a site with 99% uptime and that’s capable of dealing with high traffic levels, you need a data center. If the hosting provider you’re checking out says nothing about their data center, that’s not a good sign!
  • Support promises – Quality hosts put a lot of resources into their support staff. If a host’s site doesn’t at least give you some idea of what levels of support you can expect, that’s a warning sign. If they have no support at all (or it’s just the owner) – or if they’ve outsourced their support, that’s another warning sign!
  • Web buzz – Do a google search on the host’s name. What comes up? Do they have a lot of “hosted by” type entries? That’s a good sign, it means they have a lot of sites hosted. Do you find good or bad reviews? Take everything with a grain of salt, after all most reviews you see have little or no checking of authenticity – there’s nothing to stop someone from writing fake reviews (good or bad!) about a web hosting company. But it’ll still give you at least some idea of what customers think about the company.

So do your research – a little effort up front can save you a lot of hassle down the road!

Written by web hosting guy

October 24, 2008 at 3:50 pm

Posted in Misc

Tagged with ,

Handy VI tip – using buffers and macros

leave a comment »

I do nearly all my coding in vim – other than the occasional use of textpad when I don’t have ssh access to a website… I like vim because I prefer working on the server – everything’s there, and there’s no time wasted uploading/download, etc. And you can also use things like grep to help you get things done.

Two of the handiest features in vim are buffers and macros. (Are there such thing as freudian typos? I keep mis-typing “buffers” as “buggers”… lol). Buffers allow you to quickly pull text into a little spot in memory – it’s like the clipboard that every (modern) OS has, except that you have a lot of them available. Basically you assign a letter (or number I think) to the buffer, and copy/paste using that. This vim buffer example has more info.

Macros are even handier, in my opinion – especially when used in conjunction with buffers. Basically, they record all your key strokes, and since vim is a console program, that means a macro records everything. With some clever use of searching, etc you can use a macro to automate just about any repetitive task you can imagine.  Here’s some great vim macro examples.

Written by web hosting guy

October 3, 2008 at 3:09 pm

Posted in Uncategorized

Tagged with ,

A couple handy command line (SSH) tips

leave a comment »

Just a quick bit that may be helpful to someone out there… If you have a linux-based web hosting plan and SSH access, you have a very powerful tool at your command! We’re talking many times more useful than simple FTP.

For example, say you need to update your site, but you’re not sure which files have the bit of text you need. Let’s say it’s an out of date copyright line in a footer – try this:

grep -rl ‘copy 2007” *

Which will list all files that have that “copy 2007″ text in them, in all directories from the current one on down. Or perhaps you need to securely copy a lot of files from one website to another. Of course you could downlod them all from site1 to your local machine, then upload them all to site2… But isn’t that kind of a waste when you could directly from site1 to site2? Heck, the internet connections between the two servers are probably faster than your local connection also. Try using scp to copy files. This command will recurisvely (i.e. get all the subdirectories) copy from site1 to site2:

scp -r ./* site@site.com:~/site2/path/to/desination/

It’s as easy as that! Don’t let the fact that these commands seem arcane or complicated, there’s tons of other examples out there on the web – just do some googling!

Written by web hosting guy

September 30, 2008 at 5:41 pm

Posted in Uncategorized

Tagged with

Business card sized web server?

leave a comment »

Saw this linked from Slashdot – how to make a card-sized web server – pretty cool! Not sure what you’d do with it, and it makes you wonder how much traffic it could handle… And how it would scale – would a large number of these actually be more power/cost/space efficient than a “normal” web server?
And of course, you’d need somewhere to put them… If you’re in the market for colocation space in the Midwest, EliteRAX has great rates on Michigan colocation services in their Detroit-area data center.

Written by web hosting guy

September 26, 2008 at 3:34 pm

Posted in Uncategorized

Tagged with ,