home | contact us
» Archive by category "hosting"

category: hosting


What DNS is

DNS (Domain Name System) is the system used to make sure that when users type in your web address into their browser, they end up on your website.

How communication happens on the internet

When using the web, every site has its own address. It might have extra bits on the start and end, but the core part will be “yoursitename.com”, or similar. This is your Domain Name.

Behind the scenes, servers have a unique number assigned to them, similar to how houses have phone numbers. This will look something like “123.456.789.000″. This is called an IP Address.

Like phone numbers, the problem with IP addresses is that they’re hard to remember. It’s not easy to tell other people a list of numbers and have them remember them when they get home. It’s for this reason we have phone books. Fortunately the internet has its own built in way of looking up IP addresses by a name. This is where DNS comes in.

DNS is a way of looking up an IP address by a more memorable name. When you type in “google.com” it’s actually being converted into an IP address without you realising.

How Domain Names are converted into IP Addresses

When you buy your domain from your registrar, you will also be provided an area where you can set up DNS Records, also called Zone Records. This is where you, or your development company, set up the conversion from the Domain Name to the IP address. When this is populated, people accessing your domain are able to end up on your server because of this translation.

In actual fact, this information is spread across the world so that every DNS Server in the world (a place where the translation happens) knows what your IP address is, exactly like sharing a phone book with the world.

This translation information is transmitted with a validity period, which is how often other DNS Servers should ask for updates. This is called a “Time To Live”, or TTL). This is generally set to a relatively high time, and is the reason you generally have a 24 hour wait period when you change where your site is hosted.

Separating your Domain Registrar from your Name Server

It’s possible (and not unusual) to have the Domain Registrar (the company you bought the domain from) and the Name Server (the place where you update these DNS records) in completely different places. This is set up by telling your Registrar where your Name Servers are.

When this is changed, it means that the Registrar is no longer in control of the translation from Domain Name to IP Address

The General Overview

So when you access a website, here is what’s actually happening behind the scenes

  • You type in the web address into your browser
  • Your browser asks a DNS Server what the corresponding IP address is
  • The DNS server sends the IP address back to your computer
  • Your browser then knows which specific IP address to send subsequent messages to
  • The browser takes this IP adress and sends a message to the server it’s assigned to for the web page
  • The server sends back the page to your computer, and it’s displayed on your screen

 

Easily deploy PHP applications to the Amazon Web Services infrastructure allowing you to take advantage of an easily scaled flexible cloud based system.

Furthermore there is Git based deployment so your version control workflow can hook directly into deployment for speed and convenience.

This does really look attractive. The Angry birds store recently launched on Magento using Varnish and Amazon Web Services and it runs very fast indeed. Perhaps the days of expensive dedicated hardware are really numbered. If its this easy to set something up that can perform as well as a complex server cluster at a fraction of the cost.

http://aws.typepad.com/aws/2012/03/aws-elastic-beanstalk-build-php-apps-using-git-based-deployment.html


 

Just thought I would drop a quick blog and link to this nice succinct guide for setting up SSH to be able to log in via public key.

SSH public key tutorial

Using public keys offers you a more secure way of logging into an SSH server and also opens up the possiblity of being able to log into an SSH server without entering your password. This is less secure of course but allows easier remote scripted SSH.

For example you can set up a user account on your server with limited permissions and then on a remote machine set up public key login capabilites and cron an rsync script to maintain a mirror image of your server without the need for any user intervention.


 

If you have recently bought a domain name and updated the nameservers to point to your new hosting, or if you are moving hosts and have update the nameservers for your existing domain name then for a period of up to 48 hours people who type in your domain name into their web browser might get directed to the old server or the new server.

This period is called propogation and these days can be over quite quickly, but is still an important point to be aware of.

However what do you do if you need to make sure you are looking at your new server and not your old server?

You have two options really, you can wait for the propagation to complete or you can edit your HOSTS file to force your computer to look at your new server when you type your domain name.

This is really quite easy. You only need to know one thing which is the IP address of your new server.

Then you find your hosts file on your computer, open it up in a text editor like notepad (for windows) and add a line like this:

123.123.123.123 www.mydomain.com

at the bottom of the file. Then save that file, close all of your web browser windows and reopen a browser session and if you type your domain name you should get forced through to the new server.

See this wikipedia page for info on where to find your HOSTS file.

For windows users, you can generally find your HOSTS file here:
c:windowssystem32driversetc

More…


 

Check out this little snippet of htaccess code to force SSL usage. Works regardless of port.

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

More…


 

If you are administering a plesk server running version 8.x then you are likely dealing with phpMyAdmin version 2.8.x.x which has a bug that prevents you from performing database copy operations due to one missing space in the generated SQL.

One possible solution here is to simply install phpMyAdmin in its own right and of course use the latest version which has resolved this bug.

If however you would rather not bother with that, you can do this quite easily from the command line using the following commands.

First the SQL query:

CREATE DATABASE db2;

Then, from the command-line, do the following:

$ mysqldump -u root --password=pass db1 | mysql -u root --password=pass db2

I suppose you could start hacking on the bundled phpMyAdmin source code to fix the bug without upgrading the whole version… Ever looked at the phpMyAdmin source code?

:-)

More…


 

The scenario here is that you have access to two servers – old and new – and you want to copy a site + database from old server to new server directly.

You have root SSH access to both servers.

1. Create a TAR archive of the document root for the site on the old server.
Log into SSH on the old server.

Navigate to your vhost root (the folder just above httpdocs) then use the following command to make a tar archive of your entire httpdocs folder:

tar -cvvf httpdocs.tar httpdocs/

2. Gzip the TAR archive

 gzip httpdocs.tar

3. Transer the File to the New Server
Log into SSH on the new server

This bit may change according to your specific server setups. The way I approached this was to log into the new server at the vhost root where I want to import the old httpdocs folder. I then use the following SCP command to log into the old server, find my archive and copy it to the current location.

I am using a custom port (not the real one in the example of course) for SSH so that must be specified. Unlike SSH, you must use a capital P to specify a custom port

Note the space and full stop at the end – they are very important!

scp -P 1111 old_server_username@123.123.123.123:/path/to/file/on/old/server/archive.tar.gz .

4. Dump all DB’s and Transfer
To dump all of the databases into one single file we can use the following mysqldump syntax. Note you can simply use the –all-databases switch but this will backup database that you probably don’t want to include. Better to declare a list of all the DB’s that you do want.

mysqldump -u SomeUser -p --databases mydb1 mydb2 mydb3 > myDbs.sql

Once you have this dump file you can Gzip it and transfer it via SCP using the same kind of commands as above.

More…


 

For a webmaster that relies on their site as their source of income, such as an ecommerce shop – it can be terrible to see the site become unavailable.. if no one can access your site then you won’t make any money!

However, sometimes its not that your site has gone down but that there is something wrong with your internet connection, your ISP or some higher level network problem that will affect some but not all of your sites visitors.

So next time your site goes down, visit this link and check to see if you site is down or its just you!


 

There is a lot of buzz at the moment surrounding VPS hosting. For those of you who are not familiar with VPS, or virtual private server hosting – it is similar to shared hosting in that you are sharing a physical server with other web sites. The big difference is that with a VPS, you are not sharing the operating system with those other sites.

To clarify this. Think of your desktop PC and think of web sites as separate windows running Word for example (this is just to illustrate the idea). Each instance of Word is a separate entity but they are all running on the same instance of windows and are all running on the same machine. There are some security issues with this idea, for example someone elses instance of word might be able to get access to your folder with your files in it.

On a VPS, there is only your instance of word running in your instance of windows. And only you can access your files. From your point of view, the VPS operates exactly as if it was a dedicated server. You have total control over every single bit of the operating system and can install whatever software you wish and make any changes that you would like.

Also – VPS solutions tend to offer better protection against the physical server resources being hogged by one particularly demanding account at the cost of all the other accounts on the server. Instead on VPS systems, the resources are more rigidly shared out meaning that you have a guaranteed minimum level of performance that can not be degraded no matter how hard other VPS’s on the physical server are being used.

This all sounds great, and for many people it is. However there is a big BUT…

The drawback with VPS hosting is in the support. Often these VPS accounts are available very cheaply and when they are working they can work really well. The problem arises when they stop working. You go to the hosting company and ask them why the server has stopped working and they tell you that they do not support the software and its your responsibility to sort it out.

At this point, the average person who just wanted a hosting environment for their web site and is not an experienced systems administrator can come really unstuck because you simply might not be able to fix the problem.

With dedicated server hosting, many hosts offer something called Managed hosting. This is where you not only get the machine but you also get a full support service and ongoing management to keep the machine up to date with the latest patches and security updates and also get the machine up and running again should there be any problems. If you can afford this kind of service then I highly recommend going for it, but it is significantly more expensive than VPS hosting.

So to conclude, if you do not regard yourself as an experienced systems administrator then I would highly recommend you double check the level of support offered with the VPS before you sign up for it. For UK based readers, I would especially recommend avoiding web fusion VPS servers.

If you need any help finding a suitable hosting solution for your online business – get in touch today.


 

While recently migrating a client from a dedicated server which was proving a little too expensive over to one of the great value Linux Virtual Private Servers offered by Web Fusion, I found myself frustrated with the 2mb upload limit apparent in the control panel side of things.

So I went and edited the php.ini to allow for a more generous upload limit. Restarted the server but to no effect.

After a closer inspection I realised that the Plesk control panel actually had its own separate php.ini file. Edited this file and it works.

Another Problem Solved :-)


 
rss icon