Mounting Partitions within a XEN domU disk Image

If you have played around with virtualisation technologies, specifically Xen, then you may have experienced creating a disk image. To create a disk image on Linux we execute the following command:

dd if=/dev/zero of=centos.img bs=1024k count=0 seek=5000

This would have created for me an image which is approximately 5GB in size. And then I format it to an ext3 file-system with:

mkfs.ext3 centos.img

Recently we happened to encounter a problem whereby there was more than a single partition on an image and it wasn’t formatted by dom0.

Normally when you have create an image from dom0 and formatting it to ext3 you can mount it using

mount -o loop centos.img /mnt/file

But since the image which gets created during the installation process of the VM, has multiple partittions, a simple mount won’t work. This is what happens when we try to mount an image which has multiple partitions:

mount -o loop centos.img /mnt/file: you must specify the filesystem type

We can look at the file in detail by executing:

fdisk -lu hda

Which outputs:

You must set cylinders.
You can do this from the extra functions menu.

Disk hda: 0 MB, 0 bytes
255 heads, 63 sectors/track, 0 cylinders, total 0 sectors
Units = sectors of 1 * 512 = 512 bytes

Device Boot      Start         End      Blocks   Id  System
  centos.img   *     1060290    17848214     8393962+  83  Linux
Partition 1 has different physical/logical endings:
     phys=(1023, 254, 63) logical=(1110, 254, 63)
  hda2        17848215    20964824     1558305   83  Linux
Partition 2 has different physical/logical beginnings (non-Linux?):
     phys=(1023, 254, 63) logical=(1111, 0, 1)
Partition 2 has different physical/logical endings:
     phys=(1023, 254, 63) logical=(1304, 254, 63)

The “u” flag within the fdisk command gives the partition tables sizes in sectors instead of cylinders. This is important for us as we will be using that information for some calculation. Also important to us is the “Bytes/sector” values

Calculate the Offset in “Bytes”

Now in order to mount the two partitions from the image file, we need to know the starting Byte from which each partition starts. To calculate this offset, we mulitply the (start_sector * sector_byte_size). So for the Partition 1 we have (1060290 * 512) = 542868480 and for Partition 2 we have (17848215 * 512) = 9138286080. I pretty well know that the Partition 1 was the root partition and Partition 2 was the Home partition so I will mount them into appropriate folder names.

Now we can use those “Start Byte” values to mount those partitions in two seperate locations:

mount -o loop,offset=542868480 centos.img /mnt/file1
mount -o loop,offset=9138286080 centos.img /mnt/file2

Posted in XEN | Leave a comment

HowTo: Speed Up Linux Software Raid Building And Re-syncing

Creating, assembling and rebuilding small array is fine. But, things can get nasty when you try to rebuild or resync large size array. You may get frustrated when you see it is going to take 22 hours to rebuild the array. You can always increase RAID resync performance using the following command with the appropriate settings.

/proc/sys/dev/raid/{speed_limit_max,speed_limit_min}

The /proc/sys/dev/raid/speed_limit_min is config file that reflects the current “goal” rebuild speed for times when non-rebuild activity is current on an array. The speed is in Kibibytes per second, and is a per-device rate, not a per-array rate . The default is 1000.

The /proc/sys/dev/raid/speed_limit_max is config file that reflects the current “goal” rebuild speed for times when no non-rebuild activity is current on an array. The default is 100,000.

To see current limits, enter:

sysctl dev.raid.speed_limit_min
sysctl dev.raid.speed_limit_max

To increase speed, enter:

echo value > /proc/sys/dev/raid/speed_limit_min

OR

sysctl -w dev.raid.speed_limit_min=value

In this example, set it to 50000 K/Sec, enter:

echo 50000 > /proc/sys/dev/raid/speed_limit_min

OR

sysctl -w dev.raid.speed_limit_min=50000

If you want to override the defaults you could add these two lines to /etc/sysctl.conf:

dev.raid.speed_limit_min = 50000
dev.raid.speed_limit_max = 200000

Bitmap Option

Bitmaps optimize rebuild time after a crash, or after removing and re-adding a device.

Turn it on by typing the following command:

mdadm –grow –bitmap=internal /dev/md0

Once array rebuild or fully synced, disable bitmaps:

mdadm –grow –bitmap=none /dev/md0

Result

Speed went from 4k to 51k:

cat /proc/mdstat

Sample outputs:

Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath]
md5 : active raid1 sde2[2](S) sdd2[3](S) sdc2[4](S) sdb2[1] sda2[0]
      530048 blocks [2/2] [UU]
md0 : active raid6 sde3[4] sdd3[3] sdc3[2] sdb3[1] sda3[0]
      5855836800 blocks level 6, 64k chunk, algorithm 2 [5/5] [UUUUU]
      [============>........]  resync = 61.7% (1205475036/1951945600) finish=242.9min speed=51204K/sec
Posted in Technical Tips | Leave a comment

HowTo: Install XEN Dom0 on Debian Squeeze from source


This article assumes you have a clean install of Debian and have root level access to the server. Note this was performed on a minimal install with no desktop.

Prereqs

To be able to perform a successful kernel build, you will need to install the following packages:

apt-get install bcc bin86 gawk bridge-utils iproute libcurl3 libcurl4-openssl-dev bzip2 module-init-tools transfig tgif tgif texinfo texlive-latex-base gcc-multilib texlive-fonts-extra texlive-fonts-recommended pciutils-dev mercurial libncurses5-dev patch libvncserver-dev libsdl-dev libjpeg62-dev iasl libbz2-dev git-core uuid-dev python python-dev python-twisted build-essential make gcc libc6-dev zlib1g-dev texlive-latex-recommended e2fslibs-dev libyajl-dev libpixman-1-dev

XEN Compile and install

Now lets get the XEN tarball and make XEN

cd /usr/src

wget http://bits.xensource.com/oss-xen/release/4.4.0/xen-4.4.0.tar.gz

tar xvf xen-4.4.0.tar.gz

 cd xen-4.4.0

./configure –enable-githttp –libdir=/usr/lib

make xen

make tools

make stubdom

cd dist/install

cp -R * /

vi /etc/sysconfig/xendomains and comment out #XENDOMAINS_SAVE=/var/lib/xen/save

These tweeks should make XEN start at system startup and also create the bridge we need for the DomUs.

ln -s /etc/init.d/xendomains /etc/rc0.d/S10xendomains

ln -s /etc/init.d/xendomains /etc/rc6.d/S10xendomains

ln -s /etc/init.d/xencommons /etc/rc3.d/S98xencommons

ln -s /etc/init.d/xendomains /etc/rc3.d/S98xendomains

ln -s /root/xendom0caps /etc/rc3.d/S98xendom0caps

ln -s /root/iptables-enable /etc/rc3.d/S99iptables-enable (not required)

vi /root/xendom0caps (add xl sched-credit -d Domain-0 -w 512)

chmod +x /root/xendom0caps

vi /etc/rc.local (add /usr/bin/setterm -powersave off -blank 0

vi /etc/xen/xend-config.sxp

find line (network-script network-bridge) and comment out

#network-script network-bridge

vi /etc/xen/xl.conf (disable autoballon)

Interfaces

As newer versions of XEN can use the system bridge rather than its own script we need to edit the network configuration to invoke our new bridge. Firstly create our new bridge interface.  Replace the IP values with your settings.

vi /etc/network/interfaces

auto xenbr0
iface xenbr0 inet static
bridge_ports eth0
address 172.20.45.1
netmask 255.255.0.0
network 172.20.0.0
broadcast 172.20.255.255
gateway 172.20.0.1

Once done reboot to ensure the config applies successfully.

Kernel Compile

Now XEN is complete we need to get our kernel for Dom0.  Replace the kernel number with the version you want to use.

cd /usr/src

wget ftp://ftp.kernel.org/pub/linux/kernel/v3.x/linux-3.13.6.tar.gz

tar xvf linux-3.13.6.tar.gz

cd linux-3.13.6

make menuconfig

Go into Processor type and features

Statically enable all XEN features

Go back to the  main menu and enter Device Drivers menu, then enter block devices menu

Statically enable the 2 XEN options

Go back to the Device Drivers menu and go down to XEN driver suppport

Statically enable all features

Go back to Device Drivers, go into Network device support and statically enable the 2 XEN options at the bottom

Exit out and save.

Note to make sure all options are selected run

cat /usr/src/linux-3.13.6/.config | grep XEN

You should see the same as

CONFIG_XEN=y
CONFIG_XEN_DOM0=y
CONFIG_XEN_PRIVILEGED_GUEST=y
CONFIG_XEN_PVHVM=y
CONFIG_XEN_MAX_DOMAIN_MEMORY=500
CONFIG_XEN_SAVE_RESTORE=y
CONFIG_XEN_DEBUG_FS=y
CONFIG_PCI_XEN=y
CONFIG_XEN_PCIDEV_FRONTEND=y
CONFIG_XEN_BLKDEV_FRONTEND=y
CONFIG_XEN_BLKDEV_BACKEND=y
CONFIG_NETXEN_NIC=m
CONFIG_XEN_NETDEV_FRONTEND=y
CONFIG_XEN_NETDEV_BACKEND=y
CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y
CONFIG_HVC_XEN=y
CONFIG_HVC_XEN_FRONTEND=y
# CONFIG_XEN_WDT is not set
CONFIG_XEN_FBDEV_FRONTEND=y
CONFIG_XEN_BALLOON=y
CONFIG_XEN_BALLOON_MEMORY_HOTPLUG=y
CONFIG_XEN_SCRUB_PAGES=y
CONFIG_XEN_DEV_EVTCHN=y
CONFIG_XEN_BACKEND=y
CONFIG_XENFS=y
CONFIG_XEN_COMPAT_XENFS=y
CONFIG_XEN_SYS_HYPERVISOR=y
CONFIG_XEN_XENBUS_FRONTEND=y
CONFIG_XEN_GNTDEV=y
CONFIG_XEN_GRANT_DEV_ALLOC=y
CONFIG_SWIOTLB_XEN=y
CONFIG_XEN_PCIDEV_BACKEND=y
CONFIG_XEN_PRIVCMD=y
CONFIG_XEN_ACPI_PROCESSOR=y

If it looks good then continue otherwise please correct before hand.

make bzImage

make modules

make modules_install

cp -a arch/x86/boot/bzImage /boot/vmlinuz-3.13.6

cp -a System.map /boot/System.map-3.13.6

cp -a .config /boot/config-3.13.6

depmod –a

mkinitramfs -o /boot/initrd.img-3.13.6 3.13.6

Modify GRUB2 to boot in XEN mode

vi /boot/grub/grub.cfg

scroll down to the current setting and add the following above your current boot config, you will need to edit the lines to match your root and paths to the files.

menuentry ‘Debian GNU/Linux, with Linux 3.13.6 and XEN 4.4.0′ –class debian –class gnu-linux –class gnu –class os –class xen {
insmod raid
insmod mdraid
insmod part_msdos
insmod part_msdos
insmod ext2
set root=’(md0)’
search –no-floppy –fs-uuid –set 7f012ee0-60d9-482a-9158-52fa2bcf0300
echo ‘Loading Linux 3.13.6 …’
multiboot /xen-4.4.0.gz placeholder dom0_mem=1024M
module /vmlinuz-3.13.6 placeholder root=UUID=af529b20-8702-4fe8-8c24-e332b845cfe2 ro quiet rootdelay=10
echo ‘Loading initial ramdisk …’
module /initrd.img-3.13.6

save and reboot.

If your system fails to boot then you can boot back into the normal kernel and correct any issues.

Once the system is booted run this as a simple test to make sure XEN is running

xl list

Posted in XEN | Leave a comment

HowTo: Install XEN Dom0 on CentOS 6 from source

This article assumes you have a clean install of CentOS and have root level access to the server. Note this was performed on a minimal install with no desktop.

Prereqs

To be able to perform a successful kernel build, you will need to install the following packages:

yum groupinstall “Development tools” “Compatibility libraries”

yum install transfig wget texi2html libaio-devel dev86 glibc-devel e2fsprogs-devel gitk mkinitrd iasl xz-devel bzip2-devel pciutils-libs pciutils-devel SDL-devel libX11-devel gtk2-devel bridge-utils PyXML qemu-common qemu-img mercurial texinfo libuuid-devel openssl-devel python-twisted python python-devel ncurses-devel

We also need the 32 bit version of glibc-devel.i686

yum install glibc-devel.i686

XEN Compile and install

Now lets get the XEN tarball and make XEN

cd /usr/src

wget http://bits.xensource.com/oss-xen/release/4.4.0/xen-4.4.0.tar.gz

tar xvf xen-4.4.0.tar.gz

 cd xen-4.4.0

./configure -enable-githttp -libdir=/usr/lib

make xen

make tools

make stubdom

cd dist/install

cp -R * /

vi /etc/sysconfig/xendomains and comment out #XENDOMAINS_SAVE=/var/lib/xen/save

These tweeks should make XEN start at system startup and also create the bridge we need for the DomUs.

ln -s /etc/init.d/xendomains /etc/rc0.d/S10xendomains

ln -s /etc/init.d/xendomains /etc/rc6.d/S10xendomains

ln -s /etc/init.d/xencommons /etc/rc3.d/S98xencommons

ln -s /etc/init.d/xendomains /etc/rc3.d/S98xendomains

ln -s /root/xendom0caps /etc/rc3.d/S98xendom0caps

ln -s /root/iptables-enable /etc/rc3.d/S99iptables-enable (not required)

vi /root/xendom0caps (add xl sched-credit -d Domain-0 -w 512)

chmod +x /root/xendom0caps

vi /etc/rc.local (add /usr/bin/setterm -powersave off -blank 0

vi /etc/xen/xend-config.sxp

vi /etc/xen/xl.conf (disable autoballon)

find line (network-script network-bridge) and comment out

#network-script network-bridge

Interfaces

As newer versions of XEN can use the system bridge rather than its own script we need to edit the network configuration to invoke our new bridge. Firstly create our new bridge interface.  Replace the IP values with your settings.

vi ifcfg-xenbr0

DEVICE=”xenbr0″
NM_CONTROLLED=”yes”
ONBOOT=yes
TYPE=Bridge
BOOTPROTO=none
IPADDR=172.20.1.73
PREFIX=16
GATEWAY=172.20.0.76
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME=”System xenbr0″

Now we need to edit ifcfg-eth0 and comment out the IP address and add the bridge in.

vi ifcfg-eth0

DEVICE=”eth0″
BOOTPROTO=”none”
NM_CONTROLLED=”yes”
ONBOOT=”yes”
#IPADDR=172.20.1.73
#GATEWAY=172.20.0.76
#NETMASK=255.255.0.0
TYPE=”Ethernet”
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME=”System eth0″
UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03
BRIDGE=xenbr0

Once both files are done reboot to ensure they both apply successfully.

Kernel Compile

Now XEN is complete we need to get our kernel for Dom0.  Replace the kernel number with the version you want to use.

cd /usr/src

wget ftp://ftp.kernel.org/pub/linux/kernel/v3.x/linux-3.13.6.tar.gz

tar xvf linux-3.13.6.tar.gz

cd linux-3.13.6

make menuconfig

Go into Processor type and features

Statically enable all XEN features

Go back to the  main menu and enter Device Drivers menu, then enter block devices menu

Statically enable the 2 XEN options

Go back to the Device Drivers menu and go down to XEN driver suppport

Statically enable all features

Go back to Device Drivers, go into Network device support and statically enable the 2 XEN options at the bottom

Exit out and save.

Note to make sure all options are selected run

cat /usr/src/linux-3.13.6/.config | grep XEN

You should see the same as

CONFIG_XEN=y
CONFIG_XEN_DOM0=y
CONFIG_XEN_PRIVILEGED_GUEST=y
CONFIG_XEN_PVHVM=y
CONFIG_XEN_MAX_DOMAIN_MEMORY=500
CONFIG_XEN_SAVE_RESTORE=y
CONFIG_XEN_DEBUG_FS=y
CONFIG_PCI_XEN=y
CONFIG_XEN_PCIDEV_FRONTEND=y
CONFIG_XEN_BLKDEV_FRONTEND=y
CONFIG_XEN_BLKDEV_BACKEND=y
CONFIG_NETXEN_NIC=m
CONFIG_XEN_NETDEV_FRONTEND=y
CONFIG_XEN_NETDEV_BACKEND=y
CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y
CONFIG_HVC_XEN=y
CONFIG_HVC_XEN_FRONTEND=y
# CONFIG_XEN_WDT is not set
CONFIG_XEN_FBDEV_FRONTEND=y
CONFIG_XEN_BALLOON=y
CONFIG_XEN_BALLOON_MEMORY_HOTPLUG=y
CONFIG_XEN_SCRUB_PAGES=y
CONFIG_XEN_DEV_EVTCHN=y
CONFIG_XEN_BACKEND=y
CONFIG_XENFS=y
CONFIG_XEN_COMPAT_XENFS=y
CONFIG_XEN_SYS_HYPERVISOR=y
CONFIG_XEN_XENBUS_FRONTEND=y
CONFIG_XEN_GNTDEV=y
CONFIG_XEN_GRANT_DEV_ALLOC=y
CONFIG_SWIOTLB_XEN=y
CONFIG_XEN_PCIDEV_BACKEND=y
CONFIG_XEN_PRIVCMD=y
CONFIG_XEN_ACPI_PROCESSOR=y

If it looks good then continue otherwise please correct before hand.

make bzImage

make modules

make modules_install

cp -a arch/x86/boot/bzImage /boot/vmlinuz-3.13.6

cp -a System.map /boot/System.map-3.13.6

cp -a .config /boot/config-3.13.6

depmod –a

mkinitramfs -o /boot/initrd.img-3.13.6 3.13.6

Modify GRUB to boot in XEN mode

vi /boot/grub/grub.conf

scroll down to the current setting and add the following above your current boot config, you will need to edit the lines to match your root and paths to the files.

title Xen 4.4.0 / Debian GNU/Linux, kernel 3.13.6
root (hd0,0)
kernel /xen.gz
module /vmlinuz-3.13.6 root=root=UUID=03f9e700-ba18-41a1-bbe7-65a372716c73 ro console=tty0
module /initrd.img-3.4.5

save and reboot.

If your system fails to boot then you can boot back into the normal kernel and correct any issues.

Once the system is booted run this as a simple test to make sure XEN is running

xl list

Posted in XEN | Leave a comment

How To Increase server security using Linux Malware Detect ( LMD )

Introduction

LMD or the Linux Malware detect is yet another useful software application form RfxNetworks , it has been prepared keeping the specific share hosting requirements and malware scenario in mind.

RfxNetworks Defines is at follows :

Linux Malware Detect (LMD) is a malware scanner for Linux released under the GNU GPLv2 license, that is designed around the threats faced in shared hosted environments. It uses threat data from network edge intrusion detection systems to extract malware that is actively being used in attacks and generates signatures for detection.

The author of LMD declares the limited availability of existing open source free tools for Linux system that focus on malware detection as the driving force behind making this software.

The shared hosting environment has its own dynamics and LMD targets this specific environment considering the specific features of shared hosting.

There are so many new malware coming every day and these reside mostly in user level files which are not checked by most of the common antivirus software that mainly focus on server level vulnerabilities.

Installation and Configuration

In this article we will look into its installation and some basic configurations and usage details. Lets start with the installation.


wget http://www.rfxn.com/downloads/maldetect-current.tar.gz
tar -xzvf maldetect-current.tar.gz
cd maldetect-*
sh install.sh

After running the install script , the installation will complete with in seconds and you will be provided with successful installation output, in this information some of the main configuration and usage related information provided is   below :


...
installation completed to /usr/local/maldetect
config file: /usr/local/maldetect/conf.maldet
exec file: /usr/local/maldetect/maldet
exec link: /usr/local/sbin/maldet
exec link: /usr/local/sbin/lmd
cron.daily: /etc/cron.daily/maldet
...

As you can see from above output the main configuration file for malware detect is located at below path :

/usr/local/maldetect/conf.maldet

The main cron is located at /etc/cron.daily/maldet

Before we move on to look into usage of this binary, LMD provide some ignore options that provide you a better control on what you want to do accordingly to your specific environment.

There are three ignore files available in LMD , below are their paths and usage details :


/usr/local/maldetect/ignore_paths
This is a line spaced file for paths that are to be execluded from search results

 

/usr/local/maldetect/ignore_sigs
This is a line spaced file for signatures that should be removed from file scanning

 

/usr/local/maldetect/ignore_inotify
This is a line spaced file for paths that are to be excluded from inotify monitoring

The main configuration file is fully commented so you can easily make setup most options by looking at the comments, below are some main options that you should set  :

email_alert
This is a top level toggle for the e-mail alert system, this must be turned on if you want to receive alerts.

email_addr
This is a comma spaced list of e-mail addresses that should receive alerts.

quar_hits
This tells LMD that it should move malware content into the quarantine path and strip it of all permissions. Files are fully restorable to original path, owner and permission using the –restore FILE option.

quar_clean
This tells LMD that it should try to clean malware that it has cleaner rules for, at the moment base64_decode and gzinflate file injection strings can be cleaned. Files that are cleaned are automatically restored to original path, owner and permission.

quar_susp
Using this option allows LMD to suspend a user account that malware is found residing under. On CPanel systems this will pass the user to /scripts/suspendacct and add a comment with the maldet report command to the report that caused the users suspension (e.g: maldet –report SCANID). On non-cpanel systems, the users shell will be set to /bin/false.

quar_susp_minuid
This is the minimum user id that will be evaluated for suspension, the default should be fine on most systems.

The rest of the options in conf.maldet can be left as defaults unless you clearly understand what they do and how they may influence scan results and performance.

Manual Scan and real-time monitoring

For complete details of commands you can check the command help using below :

maldet –help

If you are looking to scan all the public_html directories for all the users on the server then you can achieve this using below command  :

maldet –scan-all /home?/?/public_html

Note : Please note that LMD use ‘?’ as wild card instead of ‘*’ , thus the use of  ’?’ in above command.

There are more options like –scan-recent which you can use to scan only recent files/changes and you have the option to mention number of days at the end of command which helps you scan for a recent time period.

Also there are other option parameters related to quarantine and cleanup, however please note that the quarantine option is disabled with default installation of LMD , if you want you can enable it from the main config.

There is also a real-time monitoring supported by LMD , however it will not work with CentOS4/RHEL4 as it requires inotify kernel parameter which is available in CentOS5/RHEL5 only.

Below is the help section related to real-time monitoring :

-m, –monitor USERS|PATHS|FILE

Run maldet with inotify kernel level file create/modify monitoring
If USERS is specified, monitor user homedirs for UID's > 500
If FILE is specified, paths will be extracted from file, line spaced
If PATHS are specified, must be comma spaced list, NO WILDCARDS!
e.g: maldet --monitor users
e.g: maldet --monitor /root/monitor_paths
e.g: maldet --monitor /home/mike,/home/ashton

You can initiate to monitoring for any user account as follows :

maldet –monitor /home/mike

And the monitoring will continue to run in background and the resultant logs will be reported in below log file :

/usr/local/maldetect/inotify/inotify_log

The daily scans through cron

The cronjob which is installed by LMD is located at path /etc/cron.daily/maldet as I mentioned earlier in the post and this cron is used to perform a daily update of signatures, keep the session, temp and quarantine data to no more than 14d old and run a daily scan of recent file system changes.

The above information should be enough to get your started !

You can find more details on the official site for this RfxNetwork project at below link :

http://www.rfxn.com/projects/linux-malware-detect/

Have a Happy Malware Hunting !

Posted in Technical Tips | 1 Comment

25 Brilliant WordPress Themes

Boldy

PureVISION

Sideways

Versatile

Monaco

Premium News

Sabuy

Pleng

Visual (HTML5)

Irresistible

Spitz

LiberWP

Zombizness

DeathLab

Modus

Soon

Shaken Grid

Widezine

Cleansure

LondonLive

Vibrant Media

BlueBubble

Katana

Brave Zeenat

Posted in WordPress | Leave a comment

Anchor Text and other Link Building Tips

 

Anchor Text SEO

For effective Search Engine Optimisation, there are two main approaches which must be taken to ensure your website achieves the ranking positions which it deserves. The first, and most obvious, of these is the actual on-site optimisation work which must take place, focussing on keyphrase relevant title, Meta and h1 tags in addition to well written and relevant content on the website. The second of these, and what it widely considered to be one of the main determinants of ranking positions, is link building; the process of sourcing high-quality in-bound links to a website from a variety of sources.

The methods of on-site SEO are well documented, with the first resource anyone should visit for more information being Google’s own Webmaster Central, and whilst taking a site from a non-optimised state to a fully optimised one is an essential process, this is putting in place a strong framework for link building campaigns and techniques. SEO is not just a single approach technique to improve one’s search engine rankings, rather a careful mix of a number of strategies which, when implemented together, will see a website climbing up the search engine pages. Whilst no one doubts that on-site optimisation will see a website climb up the rankings, it is link building techniques which will reward a website with the top positions.

The concept of link building works on the basis that each in-bound link to a website acts as a vote for that page on Google, essentially meaning, in theory, that the site with the most ‘votes’ will rank highest on the search engines. However, in reality it does not necessarily work on a basis of ‘most votes wins’ as link quality is of higher importance than link quantity. For example, if website X has 10 high quality in-bound links, and website Y has 20 low quality in-bound links, site X will be the one which ranks highest in the search engines. This concept of ‘votes’ is the case as each in-bound link is considered to be what is classed as an ‘editorial endorsement’ for a website, or in simpler terms, one website showing its trust for another by placing a link to their website, however a number of factors are taken into account when establishing the quality of links.

When working on a link building campaign essential to take a variety of factors which affect link quality into consideration throughout the process, which, it should be pointed out, should be a continual strategy to ensure regular, high quality, links are sourced. Below we will discuss the major factors affecting link building;

  1. Link Anchor Text
    The anchor text of a link refers to the clickable text of a link through to a website and it is essential to give some thought to the anchor text used, as this is what helps the search engines to understand what the page which the link points to is all about. However, it is advisable not to place links with anchor text completely irrelevant to the website as it has been well documented that the search engines are wise to this and the effectiveness will not be the same as it would on a page relevant to the link anchor text. 
  2. PageRank
    The PageRank of a website providing the in-bound link is an important ranking factor in link building campaigns as, again, it is well documented that a page passes on a proportion of its Google PageRank to those websites which it links to. How much of a given websites PageRank is passed is unknown but it is certainly the case that a proportion is passed on. Therefore, when seeking direct links it is worth taking into account the PageRank which a page possesses and it is definitely the case of ‘quality over quantity’ in a lot of circumstances, where, for example, one high quality link is of more value than two low quality links. 
  3. Relevance
    The relevance of a page where a link originates is another factor which should be taken into consideration for link building as a link from a website with a relevance to the topic ones website covers is a stronger link than one which originates from a website with unrelated content. 

 

Having looked at a number of the major factors to take into consideration when implementing a link building campaign, I’m sure many of you will be asking where the best place to source links is. That is unfortunately not a question which can be answered in a straight forward manner, and where to obtain links is certainly not a case of ‘right or wrong’ as there is endless opportunities for links to be sought. What we will do, however, is give a run down on a number of the most common sources of links so you yourself can begin to seek high quality links, or if you are employing an SEO company, develop a basic understanding behind the work that goes on in your link building strategy;

  1. Directories
    However obvious they may be, a number of directories are still a valuable source for in-bound links. Whilst a lot of these are free submissions, the most effective are those which must be accepted and face an editorial review. 
  2. Direct Links
    A strong source of links is direct links from one website to another and if one website has a strong relationship with another similar website, for whatever reason that may be, a direct link request may be accepted by the webmaster to place a link from site X to site Y. If there is no current relationship between the two websites, obtaining a link may prove to be more difficult and is likely to require an in-depth link request proposal to the webmaster, which may or may not be accepted, depending on the nature of the website, amongst other factors.  
  3. Article Writing and Submissions
    Writing relevant articles relating to a subject matter which is covered on your website and submitting these to a range of article hosting directories, ensuring links with relevant anchor text are placed within the content, can be a brilliant source of links and is a highly recommended technique to use. 
  4. Blog Comments
    Whilst this is one of the primary methods of Spam seen on blog websites, providing comments left on blogs are relevant and do not follow the structure of ‘interesting post [link]’ it is likely that webmasters will leave comments in place, keeping the link with it. What becomes a problem is when blogs are spammed with irrelevant comments so stay away from that, post relevant and interesting comments and it can be used as a brilliant link building technique. Put a bit of thought into it and you will get something out of it, put no thought into it and you won’t. 

What must be remembered when link building is that links must appear to be natural, which means placing hundreds of links in one go is generally not a good idea. It is also worth noting that the likes of link farms, where a group of websites all link to each other solely for the purpose of link building, are classed as spam by Google and the other search engines, so are best avoided. A bit of careful research should quickly raise any concerns there may be with a link source and ensure a website receives only links which will be of benefit.

Link building and SEO in general are huge topics which could be written about in-depth for long periods of time however hopefully this article has shed some light on the subject and provided an analysis on link building techniques and practices.

Written by James Brockbank, SEO Consultant at SearchQuest.

Posted in Search Engine Optimisation | Leave a comment

How To Optimise Your Blog Posts

 

Google Insights

It is an essential part of any companies Social Media plan to have a blog that is relevant and engaging to its customers. However, it is fundamental to your articles success to consider how search engines like Google and Bing see your post.

Most people use search engines to find interesting blog posts and you need to make sure that your posts are listed highly when they are searching for information relevant to your business.

Below are a few tips to help you get started in optimising your blog. For a more in-depth SEO guide then check out our Ultimate SEO Tips Guide.

Focus Your Efforts on the Most Effective Search Terms

Firstly we need to find out what people are searching for, what competition there is for those search terms and what growth those keywords have seen.

I would recommend choosing 1 or 2 topics, related to your business, to focus on when starting your blog. This will help you in selecting relevant keywords to optimise your blog and articles for.

There are a number of search term analytic tools around but I would recommend Google Insights as the place to get started. You can use Google Insights to compare a number of search terms and they have some great advanced search features. You can compare by Locations and Time Ranges and filter by Categories or Image searches among other options.

If location is important to the sales success of your business? You could check what search terms related to “restaurant” are rising in your area. Then focus your blog optimisation and articles around those keywords.

If your online marketing aims for your company are based around online sales rather than getting people through the shop door, you could focus your efforts on choosing keywords that are related to your business, highly searched for and yet low in competition.

Optimise One Post Title at a Time

When Google crawls your website it places the most importance on the Title and opening paragraph and so the keywords you use in these two areas need to reflect what you want people to find you under when using the search engines.

The Post Title needs to include some of the keywords that you chose from Tip 1. Take a look at the Title for this post – How to Optimise you Blog Posts – we’re hoping to rank highly for the terms Optimise Blog Post as our customers have told us they need help with online marketing and a big part of anyone’s online marketing strategy is the company blog.

It is also important not to fit all of your keywords into each Title post or first paragraph. This post is about optimising your Blog Posts and so that is all our Title needs to include.

Why are you sending me here?

 Hyperlinks within articles play a very important part to your posts SEO success. All posts should be as helpful and informative as possible. If you are writing about a particular third party product then add a hyperlink to the most relevant page on their website. Similarly if you mention something in your article that you have previously covered in more detail then add a hyperlink to that page.

One of the most important factors in Google’s algorithm when determining a sites importance (ranking position) is how many inbound links there are to that page. As we’ve covered previously getting inbound links is a subject that can be quite complex. Although Google places more importance on a link from an external site that has a high Page Rank, there is ranking value still to be gained from linking to other internal blog posts.

It not only helps your readers to understand more on a subject if you link to relevant blog posts, but gives value to your search engine ranking for linked-to posts. I would recommend having about 6-8 hyperlinks in any given post and maybe 2-3 of those should be internal links to your other relevant articles with the rest linking externally.

Quick Tip: If linking to an external site use the target attribute _blank (target=”_blank”) so that it will open a new window for those links. Otherwise you may find people leave your post half way through and forget to come back!

What’s my Tag?

 The majority of blog tools, such as WordPress, allow you to Tag your posts. Search engines use these Tags as part of their ranking for your site. It’s important to add around 6-8 tags to each blog post you make. I would recommend adding around 4-6 very general tags as I have done on this post (posts, seo, optimising, keywords, inbound links) and 2-4 specific tags (optimising blog posts, keyword research, google crawl algorithm).

This will help your human readers quickly choose a general tag such as SEO and find all your posts related to that. And will help you rank highly for relevant, less competitive, search terms like ‘optimising blog posts’ when the Google crawlers find your posts.

Posted in WordPress | Leave a comment

How To Get More Website Visitors from Google

Getting a website up and running is only a small part of having an effective online strategy for your company. This post does not discuss SEO for search engines, if you’ve not done that yet then check out Hubspot’s 10 Common Website Mistakes and How To Fix Them.

This article explains how to get more quality, inbound links to your site, which is one of the most important factors in Google’s algorithm. Having lots of other great sites, relevant to your own, that are linking to you will increase the ranking of your site for certain keywords.

Example:

If BBC News link to your website without you linking back to theirs this will massively help boost you up the Google rankings, for the keywords in the hyperlink. This is because Google already ranks the BBC website highly and anything that they link to must be quality content.

The fact that you don’t link back to the BBC tells Google that you’ve not set-up a reciprocal link, which re-enforces the fact that the link from the BBC is there because they like your website.

This provides us with a problem…How do I get quality websites to link to my website?

You will probably come up against a brick wall if you send out hundreds of emails to website owners and just ask them to link to you without you doing something in return. If they ask for a link back then only accept to do that if they are a great website otherwise the value of the link will not be worth your efforts.

So for this post we will look at two ways of getting those inbound links.

Number 1 – Provide brilliant, unique and interesting content on your website/blog.

This will take time but if you combine your Social Media presence then hopefully not too long. Do you take photos or videos at events/conferences that you could post online? Could you use your knowledge of a chosen topic, related to your company, and blog about it? Are you organizing a competition or event? Anything that would be of interest to your target audience is content you need to get on your website and be Twittering, Facebooking and Blogging about. If people like it they will link to it. These are links that you do not need to reciprocate and hopefully a number of the links will be from established websites.

Number 2 – Do something newsworthy.

If you can do something that will get you in the local, regional and national press’s websites, then 9 times out of 10, they will place a link to your website in the article. If you can get quality inbound links to your website then from that you will see a viral effect of content sharing, people retweeting the article/blogging about it. Whatever you choose to do it needs to grab your target audience’s attention.

So to summarise, in order to get more website visitors from Google you need to get higher in the Google ranking for search terms that your audience is using. To achieve this you need are lots of quality, inbound links. By ‘quality’ I mean links from websites that Google thinks are great. To get inbound links you need to earn it, through great content on your website and/or doing something newsworthy.

Posted in Search Engine Optimisation | Leave a comment

The Ultimate SEO Tips Guide

SEO Tips

The Ultimate SEO Tips guide. This article provides you with SEO tips for your website, blog, Twitter, Facebook, Linked and YouTube content.

We are still incorporating many of the tips ourselves and if you have come across any others then please leave them in a comment below.

It is fairly lengthy so remember to bookmark this article for later reference.

Top 10 SEO Tips for your Website

(Difficulty – Medium/Advanced)

  1. Use Your Older Pages – It can be easy to overlook the importance of your own website for ranking factor. If you’ve just posted a new page you need to link to it internally and doing this from older, well established pages, is the best approach. Here is a fantastic article that explains internal link building in more detail.
  2. Increase Indexation – Ensure that you submit your sitemap(s) to Google using their Webmaster Tools. You can then begin to see how often your site is crawled and indexed. Most websites have a Homepage that is crawled relatively frequently but other internal pages are ignored. This is largely due to a lack of inbound links to those internal pages, to combat this it is a good idea to implement a sitemap within each folder, listing the pages in that particular folder. Then create a master sitemap that that links to all the smaller sitemaps. Remember to add a link in your footer to the master sitemap.
  3. Avoid Over Using Sub-Folders – You want to make sure that the keywords in your pages URL are as close to the root domain as possible as it helps Google recognise what that page is for and increases the strength of your ranking factor. So instead of “yoursite.co.uk/folder/folder/foler/page3.html” use “yoursite.co.uk/top-seo-tips-2011.html”
  4. Start Building Deep LinksInbound link building is one of the most important factors to getting more website visitors from Google. However, make sure that all your link building efforts are not just to your websites homepage. Search engines give more ranking strength to websites that have popular internal pages, and by popular I mean pages that have inbound links. So for example if you are guest writing an article for another site who has agreed to link back to you then why not get them to link to an internal page rather than your homepage.
  5. Properly Formatted Meta Titles and Descriptions – The structure and wording of your meta titles and descriptions is something that you can easily change on all of your current and future web pages. This is an in-depth post on the correct keyword hierarchy.
  6. Keyword Stemming – This is a masterful technique that will help you really improve your ranking strength for a specified page. SEODesignSolutions have created this in-depth post to explain SEO Rankings and How to Create Them.
  7. RSS Feeds – Sharing content is the main aim of any website/blog and RSS feeds really help to syndicate your articles and posts to other sites. It helps attract natural backlinks from news sites and anyone else who thinks your content is interesting. It is worth setting up a RSS feed for each particular topic, especially if you have a large amount of article for those topics.
  8. Virtual Theming – Wikipedia is one example of a website that uses virtual theming (which means creating a secondary navigation contextually through keyword co-occurrence) and as a result reaps the rewards in search engine ranking. You will notice when you visit a Wikipedia page that many keywords link to another Wikipedia page. Wikipedia does this automatically, when creating a post. For example if you type SEO and then want to hyperlink that somewhere, Wikipedia will automatically choose its own SEO article as the default target URL for that word, making it very easy for people to link internally.
  9. Broken Links – Regularly check your website for broken links, search engine spiders hate not being able to flow through your website and so make sure you remove any hyperlinks that are going to an error page/incorrect page.
  10. Image Alt Attribute – This is a tip that many of you will have come across before but it is a really useful one. It helps reinforce the relevance of the text on the page if your alt attribute is a keyword and links to another internal page.
Posted in Search Engine Optimisation | Leave a comment