Ubuntu

Popular Linux Flavors

Linux Distributions

Popular Linux Flavors

RedHat

Popular Linux Flavors

Open SUSE

Popular Linux Flavors

Fedora

Popular Linux Flavors

Knowledge Sharing

All about Linux and much more...

Oracle database 11gR2 installation in RedHat 6.2 (32-bit)

In my earlier post I shoed you the steps to install Oracle database 10gR2 installation in RedHat 5.4 (64-bit).
Now in this post I will guide with the steps and the pre-requisites required for the installation of Oracle 11gR2 in Red Hat 6.2 (32-bit)

Pre-requisites before installing database

  • GUI Environment
Make sure you have a running GUI environment with all the packages inside group GNOME or KDE package installed.

You can do the same using
# yum groupinstall "GNOME Desktop Environment" "X Window System"
In case you want to use KDE desktop you can select the KDE group package instead of GNOME

  • Memory Requirements
Minimum 1 GB of RAM
Recommended 2 GB of RAM or more

You can follow the below table which is as per the Oracle standards for installing Oracle Database 11g in a 32 bit Linux machine

RAM
Swap Space
Between 1024 MB and 2048 MB
1.5 times the size of RAM
Between 2049 MB and 16384 MB
Equal to the size of RAM
More than 16 GB
16 GB
You can check the RAM and SWAP space using this command
# free -m
             total       used       free     shared    buffers     cached
Mem:          4392       4352         39          0        149       3828
-/+ buffers/cache:        374       4018
Swap:         6399          0       6399
In case you want to change the swap size of your machine as per the default standards, Follow this link

  • Disk Space Requirements
For the installation of Oracle 11g minimum of 1 GB is required for /tmp directory

You can check the same using
# dh -h /tmp

  • Display Requirements
Minimum display of 1024 x 768 or higher is required for the installation of Oracle 11g

  • Operating system and Kernel Requirement
Follow this link for making sure that the OS you are using is compatible with the database you are installing

  • Package Requirement
binutils-2.20.51.0.2-5.11.el6.i686 
compat-libcap1-1.10-1.i686
compat-libstdc++-33-3.2.3-69.el6.i686
gcc-4.4.4-13.el6.i686
gcc-c++-4.4.4-13.el6.i686
glibc-2.12-1.7.el6.i686
glibc-devel-2.12-1.7.el6.i686
pdksh-5.2.14-1.i386
libgcc-4.4.4-13.el6.i686
libstdc++-4.4.4-13.el6.i686
libstdc++-devel-4.4.4-13.el6.i686
libaio-0.3.107-10.el6.i686
libaio-devel-0.3.107-10.el6.i686
make-3.81-19.el6.i686
sysstat-9.0.4-11.el6.i686
unixODBC-2.2.14-11.el6.i686 or later
unixODBC-devel-2.2.14-11.el6.i686 or later

  • Kernel parameters
Add the following lines at the end of sysctl.conf file
# vi /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
Run the following command to refresh the kernel parameters just added
# sysctl -p
To view all the kernel parameters 
# sysctl -a
Set the proper upper and lower limits in your machine. Add these lines in the given file as shown below
oracle         soft    nproc     2047 
oracle         hard    nproc     16384
oracle         soft    nofile    1024
oracle         hard    nofile    65536
oracle         soft    stack     10240

  • Hostname
Check your hosts file and hostname as it should be proper
# vi /etc/hosts 
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
10.10.20.42     test    test.example.com
Your machine should have a proper hostname. To check use the below command
# hostname 
test.example.com
  • User and Group
You have to create a different user and group who will run the database
# useradd oracle
# passwd oracle

# groupadd dba

# usermod -G dba oracle
So we have added oracle user to dba group using the above command.

  • Create home directory
# mkdir -p /u01/app/oracle/product/11.2.0/dbhome_1/ 
# mkdir /u01/app/oraInventory

# chown -R /u01/
# chmod -R oracle:dba /u01/
We will use the standard format for creating the oracle database. Create a directory with the name used above. 

  • Specify the Display protocol
Log in to oracle user
# su - oracle
$ export $DISPLAY=localhost:0.0

  • Installation
Go to the location where you have downloaded and unzipped the database setup file using oracle user
# su - oracle
$ cd /database11gr2/database/
$ ./runInstaller
NOTE: In case you get DISPLAY related errors at the installation stage follow this page

Put your email address in case you want recieve updates via Oracle Support. In my case I skip this part

Select the first option as this is a fresh installation


















Select the database class you want to install. All the details as per the database class is mentioned along with their option.

We will go with the typical install
















Browse the location as specified below accordingly as we had created while filling the pre-requisite section






















Select the specified directory in your machine






















Next the set up will verify all the pre-requisites. In case you are warned for any error or missing package, make sure you correct and move ahead or else you might face issues after or during the installation.

NOTE: It is recommended that all the pre-requisites should be passed successfully.























Click on Finish to start the installation
Next you will get this screen. Click on "Password management"



























Next this screen will come up. Create a password for SYS and SYSTEM user and click on Ok





















Click on Ok

Now Click on close. You have successfully installed Oracle 11gR2 in your machine






Xlib: No protocol specified

While installing Oracle database I was getting this error. I searched various blogs and forums and found out
many solutions but lastly I got one solution which worked for me.

But well I will post all the possible ways which you can try (as per my knowledge) to overcome this issue.

Error:
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
Specify the display protocol by logging into the user account you are getting the error

Solution 1:
$ export DISPLAY=localhost:0.0
$ xhost +
Solution 2:
$ export DISPLAY=(machine_name):0.0

$ export DISPLAY=10.10.20.42:0.0
$ xhost +
Solution 3 (which worked for me)
$ xauth $DISPLAY
xauth: creating  new authority file /home/oracle/.Xauthority
xauth: (argv):1: unknown command ":0.0"
The best way to check whether your Xlib display protocol is working or not is by using xclock command
$ xclock
After running this command you should see a small clock on your screen.

Solution 4
In case the above solution does not works
Login as root
# xauth $DISPLAY 
xauth: creating new authority file /home/oracle/.Xauthority
# xauth list $DISPLAY
test.example.com/unix:0 MIT-MAGIC-COOKIE-1 f601e6a29ea688786765434c5c6325071
Now copy the above output and su to the user you are facing issue
# su - oracle
$ xauth add test.example.com/unix:0 MIT-MAGIC-COOKIE-1 f601e6a29ea688786765434c5c6325071
xauth: creating new authority file /home/oracle/.Xauthority
Now test if your DISPLAy is working
$xclock
You should get a small clock output on the screen


Oracle database 10gR2 installation in RedHat 5.4

In this post I'll show you the steps required to install Oracle Database 10g Release 2 on Red Hat Enterprise
Linux 5.4 (64-bit)

Assuming you have downloaded Oracle Database 10g R2 from their official website.

If not you can get it from the below mentioned link

For my case I have disable Selinux. Please make sure you apply relevant policy for selinux in case you have it enforcing state.

Prerequisites before installing Oracle 10gR2 


  • GUI Environment
Make sure you have a running GUI environment with all the packages inside group GNOME or KDE package installed.

You can do the same using
# yum groupinstall "GNOME Desktop Environment" "X Window System"
In case you want to use KDE desktop you can select the KDE group package instead of GNOME

  • Memory and Swap space
You can follow the below table which is as per the Oracle standards for installing Oracle Database 10g in a 64 bit Linux machine

RAM
Swap Space
Up to 512 MB
2 times the size of RAM
Between 1024 MB and 2048 MB
1.5 times the size of RAM
Between 2049 MB and 8192 MB
Equal to the size of RAM
More than 8192 MB
0.75 times the size of RAM
NOTE: In case you donot have enough swap memory space in your machine the follow this page for
How to increase Swap Memory size in Linux

You can check the RAM and SWAP space using this command
# free -m
             total       used       free     shared    buffers     cached
Mem:          4392       4352         39          0        149       3828
-/+ buffers/cache:        374       4018
Swap:         6399          0       6399

NOTE: In case you have assigned a different partition size for /tmp directory then make sure it has minimum 400 MB free space.

  • Hosts File
Your hosts file should be proper as shown below
# vi /etc/hosts 
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
10.10.20.41 test.example test
Your machine should have a proper hostname. To check use the below command
# hostname 
test.example
    • Kernel Parameters
    For Oracle 10g, the following kernel parameters have to be set to values greater than or equal to the recommended values.

    To verify shmmax
    # cat /proc/sys/kernel/shmmax 
    shmmax = 2147483648
    To verify shmmni
    # cat /proc/sys/kernel/shmmni 
    shmmni = 4096
    To verify the shmall parameter
    # cat /proc/sys/kernel/shmall 
    shmall = 2097152
    To verify shmmin
    # ipcs -lm |grep "min seg size"
    shmmin = 1
    Note that shmseg is hardcoded in the kernel, the default is much higher.
    shmseg = 10
    To verify semmsl
    # cat /proc/sys/kernel/sem | awk '{print $1}' 
    semmsl = 250
    To verify semmns
    # cat /proc/sys/kernel/sem | awk '{print $2}' 
    semmns = 32000
    To verify semopm
    # cat /proc/sys/kernel/sem | awk '{print $3}' 
    semopm = 100
    To verify semmni
    # cat /proc/sys/kernel/sem | awk '{print $4}' 
    semmni = 128
    To verify file-max
    # cat /proc/sys/fs/file-max
    file-max = 65536
    To verify ip_local_port_range
    # cat /proc/sys/net/ipv4/ip_local_port_range 
    ip_local_port_range = 1024 65000
    In case your default kernel parameter is less than the above mentioned parameters then you will have to change them. This is how you can add or change these parameters:

    Add the following lines in sysctl.conf
    # vi /etc/sysctl.conf
    kernel.sem = 250 32000 100 128
    net.ipv4.ip_local_port_range = 1024 65000
    net.core.rmem_default=262144
    net.core.rmem_max=262144
    net.core.wmem_default=262144
    net.core.wmem_max=262144
    Run the following command to refresh the kernel parameters just added
    # sysctl -p
    To view all the kernel parameters
    # sysctl -a
    Add the following lines to the "/etc/security/limits.conf" file.
    *    soft    nproc     2047 
    *    hard    nproc     16384
    *    soft    nofile    1024
    *    hard    nofile    65536
    Add the following line to the "/etc/pam.d/login" file, if it does not already exist.
    session    required    pam_limits.so
    • RPM pre-requisites
    Make sure the following rpm version is equal or greater installed in your machine
    gcc-3.4.4-2
    gcc-c++-3.4.4-2
    libstdc++-devel-3.4.4-2
    libgcc-4.1.2-50
    cpp-3.4.4-2
    compat-libf2c-34-3.4.6-4.1
    compat-libcom_err-1.0-7
    glibc-2.3.4-2.13
    glibc-common-2.3.4-2.13
    glibc-devel-2.3.4-2.13
    glibc-headers-2.3.4-2.13
    gnome-libs-1.4.1.2.90-44.1
    compat-db-4.1.25-9
    sysstat-5.0.5-1
    libaio-0.3.103-3
    openmotif21-2.1.30-11
    xorg-x11-deprecated-libs-6.8.2-1
    compat-libstdc++-33-3.2.3-47.3
    make-3.80-5libXp-1.0.0
    • User and Group
    You have to create a different user and group who will run the database
    # useradd oracle
    # groupadd dba
    
    # usermod -G dba oracle
    So we have added oracle user to dba group using the above command.

    • Create home directory
    # mkdir -p /u01/oracle/product/10.2.0/db_3/ 
    # mkdir /u01/oraInventory
    
    # chown -R /u01
    # chmod -R oracle:dba /u01
    We will use the standard format for creating the oracle database. Create a directory with the name used above.

    • Specify the Display protocol
    Log in to oracle user
    # su - oracle
    $ export $DISPLAY=localhost:0.0
    NOTE: In case you get DISPLAY related errors at the installation stage follow this page
    How to specify DISPLAY protocol

    • Installation
    Go to the location where you have downloaded and unzipped the database setup file using oracle user
    # su - oracle
    
    $ cd /database10gr2/database/
    $ ./runInstaller

    You will get the below screen. Change the Oracle Home location as the directory row created in "Create Home Directory" section of this blog

    Give database password in the provided section



























    Give the directory path as mentioned below


























    Make sure you get "Succeeded" in all the pre-requisite section. In case you get a failure at any of the parameter, Re-check the failed parameter and it is advised not to move to next step until and unless all the  pre-requisite are "Passed"


























    Click on Next and Finish the installation



























    Samba 4.1 as Active Directory

    In my earlier post I had shown you the steps to install and configure Samba 4.0 but since then the Samba4 developers have upgraded the Samba version from 4.0 to 4.1. I will be releasing my post for upgrading Samba 4 very soon but in the mean time for the new users planning to configure Samba 4.1 in their machine. Please follow the below steps.

    You can look out for the pre-requisites before installing Samba 4.1

    In my case I am using CentOS 6.2 and have verified all the pre requisite rpms and conditions.
    NOTE: Make sure you have python version more than 2.5 installed in your machine

    For configuring Samba 4.0 follow this link

    NOTE: Make sure you don't have any earlier version of Samba installed

    Downloading Samba 4.1 package

    # git clone git://git.samba.org/samba.git samba-master
    In case you get
    -bash: git command not found

    In RedHat, fedora and CentOS
    # yum install git
    Or you can manually download git package from the below location
    http://rpm.pbone.net/index.php3?stat=3&search=git&srodzaj=3

    Once the package is completely downloaded
    # cd samba-master
    # ./configure
    # make
    # make install
    If the above steps complete without any error then you can move ahead for provisioning step
    Add the new path location to your bash file for samba
    # vi ~/.bashrc
    export PATH=$PATH:/usr/local/samba/sbin:/usr/local/samba/bin
    
    # . .bashrc
    
    Before running the provision step make sure the following things are in place
    # vi /etc/hosts
    127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
    ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
    10.10.20.42 test test.example.com
    
    # vi /etc/resolv.conf
    search example.com
    nameserver 10.10.20.42
    
    # hostname
    test.example.com

    Provision Samba

    # samba-tool domain provision
    Realm [EXAMPLE.COM]: EXAMPLE.COM
    Domain [EXAMPLE]: EXAMPLE
    Server Role (dc, member, standalone) [dc]: dc
    DNS backend (SAMBA_INTERNAL, BIND9_FLATFILE, BIND9_DLZ, NONE) [SAMBA_INTERNAL]: BIND9_FLATFILE
    Administrator password:
    Retype password:
    Looking up IPv4 addresses
    Looking up IPv6 addresses
    No IPv6 address will be assigned
    Setting up share.ldb
    Setting up secrets.ldb
    Setting up the registry
    Setting up the privileges database
    Setting up idmap db
    Setting up SAM db
    Setting up sam.ldb partitions and settings
    Setting up sam.ldb rootDSE
    Pre-loading the Samba 4 and AD schema
    Adding DomainDN: DC=example,DC=com
    Adding configuration container
    Setting up sam.ldb schema
    Setting up sam.ldb configuration data
    Setting up display specifiers
    Modifying display specifiers
    Adding users container
    Modifying users container
    Adding computers container
    Modifying computers container
    Setting up sam.ldb data
    Setting up well known security principals
    Setting up sam.ldb users and groups
    Setting up self join
    Adding DNS accounts
    Creating CN=MicrosoftDNS,CN=System,DC=example,DC=com
    See /usr/local/samba/private/named.conf for an example configuration include filefor BIND and /usr/local/samba/private/named.txt for further documentation required for secure DNS updates
    Setting up sam.ldb rootDSE marking as synchronized
    Fixing provision GUIDs
    A Kerberos configuration suitable for Samba 4 has been generated at /usr/local/samba/private/krb5.conf
    Once the above files are installed, your Samba4 server will be ready to use
    Server Role: active directory domain controller
    Hostname: test
    NetBIOS Domain: EXAMPLE
    DNS Domain: example.com
    DOMAIN SID: S-1-5-21-3668134952-3729197751-3642420208
    Once you successfully run the provision step, Its time to run and test your samba
    # samba
    # ps -ef | grep samba
    root 20465 1 0 10:26 ? 00:00:00 samba
    root 20466 20465 0 10:26 ? 00:00:00 samba
    root 20467 20465 0 10:26 ? 00:00:00 samba
    root 20468 20465 0 10:26 ? 00:00:00 samba
    root 20469 20465 0 10:26 ? 00:00:00 samba
    root 20470 20465 0 10:26 ? 00:00:00 samba
    root 20471 20465 0 10:26 ? 00:00:00 samba
    root 20472 20466 0 10:26 ? 00:00:00 /usr/local/samba/sbin/smbd -D --option=serverrole check:inhibit=yes --foreground
    root 20473 20465 0 10:26 ? 00:00:00 samba
    root 20474 20465 0 10:26 ? 00:00:00 samba
    root 20475 20465 0 10:26 ? 00:00:00 samba
    root 20476 20465 0 10:26 ? 00:00:00 samba
    root 20477 20465 0 10:26 ? 00:00:00 samba
    root 20478 20465 0 10:26 ? 00:00:00 samba
    root 20481 20472 0 10:26 ? 00:00:00 /usr/local/samba/sbin/smbd -D --option=serverrole check:inhibit=yes --foreground
    root 21502 21310 0 11:15 pts/2 00:00:00 grep samba
    
    So our samba has started as you can see above
    Check the version
    # samba -V
    Version 4.1.0pre1-GIT-55add52
    Once you run the provision command following files should be automatically created.
    • /usr/local/samba/private/named.conf 
    • /usr/local/samba/private/dns/example.com.zone 
    • /usr/local/samba/private/krb5.conf 
    Now check if you are able to connect your samba server using smbclient.
    # smbclient -L localhost -U% 
    Domain=[EXAMPLE] OS=[Unix] Server=[Samba 4.1.0pre1-GIT-55add52] 
            Sharename       Type      Comment 
            ---------       ----      ------- 
            netlogon        Disk 
            sysvol          Disk 
            IPC$            IPC       IPC Service (Samba 4.1.0pre1-GIT-55add52) 
     Domain=[EXAMPLE] OS=[Unix] Server=[Samba 4.1.0pre1-GIT-55add52] 
            Server               Comment 
            ---------            ------- 
            Workgroup            Master 
            --------        ------
    When you run the mentioned command you should get the above output.

    NOTE: In case you are getting any error make sure all the pre-requisites are fulfilled correctly and your hostname and all files are proper.
    Check your SeLinux and firewall as in my case I have disabled both of them

    Configure your BIND server

    NOTE: Make sure your bind version is 9.8/9.9
    # rpm -q bind
    bind-9.8.2-0.17.rc1.el6_4.4.i686
    This is a copy of my named.conf file
    # vi /etc/named.conf
     options {
            listen-on port 53 { 127.0.0.1; };
            listen-on-v6 port 53 { ::1; };
            directory       "/var/named";
            forwarders { 8.8.8.8; 8.8.4.4; };
            dump-file       "/var/named/data/cache_dump.db";
            statistics-file "/var/named/data/named_stats.txt";
            memstatistics-file "/var/named/data/named_mem_stats.txt";
            allow-query     { localhost; any; };
            recursion yes;
            dnssec-enable yes;
            dnssec-validation yes;
            dnssec-lookaside auto;
    
            /* Path to ISC DLV key */
            bindkeys-file "/etc/named.iscdlv.key";
            managed-keys-directory "/var/named/dynamic";
     };
     logging {
            channel default_debug {
                    file "data/named.run";
                    severity dynamic;
            };
     };
    
     zone "." IN {
            type hint;
            file "named.ca";
     };
     include "/etc/named.rfc1912.zones";
     include "/etc/named.root.key";
     include "/usr/local/samba/private/named.conf";
    Restart your named server
    # service named restart
    Check if your DNS server is working on localhost
    # ping google.com
    PING google.com (74.125.236.32) 56(84) bytes of data.
    64 bytes from maa03s04-in-f0.1e100.net (74.125.236.32): icmp_seq=1 ttl=56 time=19.1 ms
    64 bytes from maa03s04-in-f0.1e100.net (74.125.236.32): icmp_seq=2 ttl=56 time=18.7 ms
    In case you get
    unknown host google.com
    Check your bind configuration files again. Make sure the Time zone setting and time is properly set in your linux machine as in some cases that is another reason for failure of DNS server.

    Verify if your Samba server is listening to DNS server
    # host -t SRV _kerberos._udp.example.com.
    _kerberos._udp.example.com has SRV record 0 100 88 test.example.com.
    
    # host -t SRV _ldap._tcp.example.com.
    _ldap._tcp.example.com has SRV record 0 100 389 test.example.com.
    
    # host -t A samba.example.com.
    samba.example.com has address 10.10.20.42
    NOTE: In case you get error while using the last command above
    Host samba.example.com. not found: 3(NXDOMAIN)
    then follow the below mentioned steps
    # vi /usr/local/samba/private/dns/example.com.zone
    Add a last line
    
    samba IN A 10.10.20.42
    Restart your bind server and try the above command again. You should get a positive reply.

    Configure Kerberos

    Replace your krb5.conf file inside /etc with the file krb5.conf created after provision step
    Sample krb
    # vi /etc/krb5.conf
    [libdefaults]
    default_realm = ${REALM}
    dns_lookup_realm = false
    dns_lookup_kdc = true
    
    Testing kerberos
    # kinit administrator@EXAMPLE.COM
    Password:
    Warning: Your password will expire in 41 days on Wed Jul 17 10:26:06 2013
    Now try adding your Windows client to the domain server
    Follow this page for
    Configuring a Windows Client for Samba 4 AD


    Understanding RPM package

    All of us install multiple rpms while working on our Linux machines. But do you look at the rpm file
    and ever wonder what does those i586, i686 or any other used similar attributes mean?

    Let me help you understand a rpm file

    For example:
    mysql-5.0.95-5.i386.rpm is a RPM file name for 5 release of version 5.0.95 of the MYSQL package built for i386 architecture.

    Now apart from the version number what you should concentrate on is the CPU architecture type which the RPM will support and using which it has been built. Because different processors must use different software libraries, have different system calls, and utilize different optimizations, software must be built with the proper version of the compiler compatible with the architecture.

    Some of the famous architecture are explained below

    Architecture
    Description
    noarch
    Architecture-independent, can run on any architecture
    i386
    Generic build for a 32-bit x86 system
    i586
    Sometimes used when building kernels for older x86 processors
    i686
    Intel® Pentium® II, Intel Pentium III, Intel Pentium 4, AMD® Athlon, and AMD Duron systems (Most RPMs for these architectures are built using the i386 architecture, with the kernel for these architectures being built with the i686 for optimal performance.)
    x86_64
    64-bit processors such as AMD Athlon64, AMD Opteron, and Intel EM64T
    ia64
    Intel® Itanium™
    s390x
    64-bit IBM eServer System z
    ppc
    32-bit IBM® POWER, IBM eServer™ pSeries®, and IBM eServer iSeries


    Sendmail: Temporary Auth Failure

    While configuring my sendmail server I was getting this error. I had to dig up a lot to fix this one. Then I found the solution so I thought I should share this on my blog as well.

    Solution:

    This happens if you are trying to use PLAIN authentication for sendmail server. So check for this particular package and if it is missing then you might need to install it
    cyrus-sasl
    cyrus-sasl-plain
    sasl
    In case you are getting the below error
    Oct 06 06:10:11 mail sendmail[8606]: error: safesasl(/usr/lib/sasl/Sendmail.conf) failed: World writable directory
    Oct 06 06:10:11  mail sendmail[8606]: error: safesasl(/usr/lib/sasl2  /libanonymous.so.2) failed: World writable directory
    Oct 06 06:10:11 mail sendmail[8691]: STARTTLS=server: file /usr/share/ssl/certs/sendmail.pem unsafe: World writable directory
    Solution:

    Check permission on /usr/lib as the permissions of all the files and directories should not be more than 755. Change the permission to 755 on the following locations.
    # ls -ld /usr /usr/lib   /usr/lib/sasl2   /usr/share   /usr/share/ssl

    stat=Deferred: Connection timed out

    I got this error while trying to send out mail using my MTA which in my case was sendmail.

    Solution:
    If you receive this error then it means that your mail server is unable to connect to your smtp provider most probably due to firewall. So check your firewall and if your server is listening to port 25, 587 and 465 which are the smtp ports unless you have specified some custom port no.
    # netstat -ntlp | grep sendmail
    tcp   0   0.0.0.0:587      0.0.0.0:*    LISTEN    1419/sendmail
    tcp   0   0 0.0.0.0:465    0.0.0.0:*    LISTEN    1419/sendmail 
    tcp   0   0 0.0.0.0:25     0.0.0.0:*    LISTEN    1419/sendmail
    Many a times it happens that your network firewall might be blocking some particular port so you can check using telnet.

    In my case I was using smtp.gmail.com as my smtp server for sendmail. For my configuration file you can refer this post
    # telnet smtp.gmail.com 25
    Trying 74.125.127.109...
     Connected to smtp.gmail.com. 
     Escape character is '^]'. 
     220 mx.google.com ESMTP io2sm27316728pbc.24
    So it shows connected, similarly you can check for other port no.

    How to create Soft Link and Hard Link in Linux

    Well before moving ahead I hope you know about Symlinks in Linux and its both the types i.e Soft Link and Hard Link. I will just give a brief description on both the types of link.

    Soft Link
    1. Using this only a link to the original file is created (shortcut).
    2. The size of created shortcut is null.
    3. If you delete the file then the created link (shortcut) won't work.
    4. In case you delete the shortcut link then it won't affect the original file

    Hard Link
    1. Another copy of the file is created.
    2. Both the file have same inode no.
    3. Any changes made in either of the file will appear on the other file.
    4. Deleting any of the one file won't affect the other file.

    Creating Soft Link

    The syntax to be followed for creating soft links 
    # ln -s /path/to/source    /path/to/destination
    NOTE: You will have to give the complete path of source and destination file unless they both have to exist in the same directory.
    # echo 12345 > ~/myfile.txt
    Now we will create a soft link of this file in some other location
    # ln -s ~/myfile.txt /tmp/
    # cd /tmp
    # ls -l
    lrwxrwxrwx 1 root   root       16 May 20 07:26 myfile.txt -> /root/myfile.txt
    
    Now as you see a symlink has been created which is shown by "Blue colour". 

    NOTE: In case if you see a red color symlink instead of blue then it means either the symlink is not created properly or the original file has been moved or deleted.

    • Now let us check the difference between both the files.
    # stat ~/myfile.txt
    File: `myfile.txt'
    Size: 6               Blocks: 8          IO Block: 4096   regular file
    Device: fd00h/64768d    Inode: 20152421    Links: 1
    Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
    Access: 2013-05-20 07:24:13.000000000 +0530
    Modify: 2013-05-20 07:24:12.000000000 +0530
    Change: 2013-05-20 07:24:12.000000000 +0530
    # stat /tmp/myfile.txt
    File: `/tmp/myfile.txt' -> `/root/myfile.txt'
    Size: 16              Blocks: 0          IO Block: 4096   symbolic link
    Device: fd00h/64768d    Inode: 22479090    Links: 1
    Access: (0777/lrwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)
    Access: 2013-05-20 07:26:06.000000000 +0530
    Modify: 2013-05-20 07:26:03.000000000 +0530
    Change: 2013-05-20 07:26:03.000000000 +0530
    
    So both the inode no. seems to be different.

    • Let us check the size of both the files
    # du -sch ~/myfile.txt
    4.0K    /root/myfile.txt
    4.0K    total
    # du -sch /tmp/myfile.txt
    0       /tmp/myfile.txt
    0       total
    So, we can conclude that all the above mentioned points under soft link are true.

    Creating Hard Link

    The syntax to be followed for creating soft links
    # ln  /path/to/source  /path/to/destination
    # ls -l ~
    -rw-r--r-- 2 root root 6 May 20 07:24 myfile.txt
    
    # ln ~/myfile.txt /tmp/
    
    # cd /tmp
    # ls -l
    -rw-r--r-- 2 root root 6 May 20 07:24 myfile.txt
    So as we see there is no difference between both the files and hard to find out which one is the original file and which one is the created hard link.

    • Lets check the size of both the file
    # du -sch /tmp/myfile.txt
    4.0K    myfile.txt
    4.0K    total

    # du -sch ~/myfile.txt
    4.0K    /root/myfile.txt
    4.0K    total
    So it seems both the file is occupying the same size on the disk.

    • Let us try making some changes in any one of the file
    # echo 123 >> ~/myfile.txt
    
    # cat /tmp/myfile.txt
    12345
    123
    So the changes made in one file are reflected in another file as you can see above. I appended 1 line in the original file inside root and the same changes are reflected on the other file.

    • Let us check the inode number of both the file
    # stat ~/myfile.txt
    File: `/root/myfile.txt'
    Size: 10              Blocks: 8          IO Block: 4096   regular file
    Device: fd00h/64768d    Inode: 20152421    Links: 2
    Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
    Access: 2013-05-20 07:50:32.000000000 +0530
    Modify: 2013-05-20 07:50:28.000000000 +0530
    Change: 2013-05-20 07:50:28.000000000 +0530
    
    # stat /tmp/myfile.txt
    File: `/tmp/myfile.txt'
    Size: 10              Blocks: 8          IO Block: 4096   regular file
    Device: fd00h/64768d    Inode: 20152421    Links: 2
    Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
    Access: 2013-05-20 07:50:32.000000000 +0530
    Modify: 2013-05-20 07:50:28.000000000 +0530
    Change: 2013-05-20 07:50:28.000000000 +0530
    So as you see both use the same inode no. due to which any change made to 1 file is reflected on the other file.

    I hope I cleared all your doubt in case still you have any question feel free to comment for any query.