How to setup a redundant NFS server with DRBD and Heartbeat in CentOS 5

How to setup a redundant NFS server with DRBD and Heartbeat in CentOS 5

This tutorial will guide you through the entire process of setting up a highly available NFS server.  To proceed, you must have the following:

1. 2 servers with similar hard disk setup (These will be used to create a redundant nfs server)
2. atleast 1 server where the nfs share will be mounted.
3. Static IPs
4. Basic knowledge of vi (:q! = quit, :wq = write and then quit, i = insert mode, esc = leave insert mode, dd = delete line when not in insert mode)

First off, install CentOS on both machines.  During the install process, create a separate blank partition on both machines to be used as your nfs mount.  Set the mount point to /data during installation.

From this point on i’m going to be referring to both nfs servers by their IPs and hostnames.  Server1 will be nfs1 with ip 10.132.196.221 and server2 will be nfs2 with ip 10.132.196.222.  Your private IPs might be different so make sure to put in the correct IPs where necessary within this tutorial.

(more…)

How to Install ThinkorSwim in Linux

How to Install ThinkorSwim in Linux

Here are the quick an easy steps on how to install TOS in Linux (Debian Distro).

First you will need to setup Java on your computer so lets go ahead and do that. Open up the console and login as super user.

su

Now that we have full privileges, lets edit the sources.list file so that we can fetch the much needed java packages.

pico /etc/apt/sources.list

This will bring up your sources.list file in the editor. You should see something that looks like this:

deb http://debian.lcs.mit.edu/debian etch main
deb-src http://debian.lcs.mit.edu/debian etch main

Add the words “contrib non-free” at the end of both lines so it looks like the following:

deb http://debian.lcs.mit.edu/debian etch main contrib non-free
deb-src http://debian.lcs.mit.edu/debian etch main contrib non-free

Now hit “Ctrl + O” to write the changes to the file. Then hit enter to accept the changes. Now hit “Ctrl + X” to exit the editor. That was the hard part :) . Lets update our package listing and download the java packages by running the following commands:

apt-get update
apt-get install sun-java5-jre sun-java5-jdk

Follow the onscreeen instructions to complete the installation of the java packages. Its pretty much gonna ask you to agree to the licenses. After you are done you can close the console window.

(more…)

Understanding Linux File Permissions

Understanding Linux File Permissions

File permissions in Linux are actually pretty easy to understand and modify.  To check the permissions on a file just navigate to the directory and use the following command to list the files and their details.

ls -l

As you can see, the first piece of information on each line are the permissions.  There are 3 sets of permissions put together all into one line.  The very first character denotes whether the file is a directory, a link or a file.

- = file
l = symbolic link
d = directory

The 3 characters following the first character represent the permission information for the file owner.  The 3 characters following that denote the permissions for the group and the last 3 characters are the file permissions for everyone else.  A key for what the characters mean is listed below:

- = no read, write, or execute permissions
r = read
w = write
x = execute

For example, lets say we have the following permission information on a file.

drwxr-xr-x

Since the first character is “d” we know that its a directory.  Then next 3 characters are “rwx” which means that the owner has read, write, and execute permissions.  The next set of characters are “r-x” which means the group has read and execute permissions but no write permissions.  The last 3 characters are “r-x” which means that everyone else has read and execute permissions but no write permissions.
You can easily change file permissions by using the “chmod” command.  Using numbers to change permissions on a file is very quick, easy, and precise.  A key for what each number represents is listed below.

4 = read
2 = write
1 = execute

You have to set permissions for the owner, group, and everyone else all at the same time when using the number method so that means there will be 3 numbers.  The first number is the permission for the owner, the second is for the permission of the group and the last number is the file permission for everyone else.

To give the owner, group, and everyone else only read permissions then the command would be the following.

chmod 444 filename

To give the owner, group, and everyone else read and execute permission then you just add the numbers together.  So 4(read) + 1(execute) = 5.

chmod 555 filename

The numbers don’t have to be the same, you can give different permissions to the owner, group and everyone else all in one shot.  So lets say you want the file owner to have read, write and execute permissions but you want the group and everyone else to have only read and execute permissions.  The command to do this would be the following.

chmod 755 filename

If you are applying permissions to a folder and would like to recursively change the permissions of the contents as well then don’t forget to use the capital ‘R’ switch:

chmod -R 755 somedir

Remember, the first digit is for the owner, the second digit is for the group and the last digit is for everyone else.