Monday, October 29, 2012

Install Java and enable java plugin in Browser


How to  install 32-bit Java for Linux Platforms?


This article applies to:
  • Platform(s): Red Hat Linux, SUSE Linux, Oracle Linux, Oracle Enterprise Linux, SLES
  • Java version(s): 6.0, 7.0

Linux System Requirements
See supported System Configurations for information about supported platforms, operating systems, desktop managers, and browsers.
You will also need a Pentium 166MHz or faster processor with a minimum of 75MB free disk space and a minimum of 64MB of RAM.

Note: For downloading Java other flavors of Linux see Java for UbuntuJava for Fedora

Follow these steps to download and install 32- bit Java for Linux.
  1. Download
  2. Install
  3. Enable and Configure
Download
  1. Go to http://java.com and click on the Download button
  2. There are two types of installation packages.
    • Java on Linux Platforms
      This is an archive binary file that can be installed by anyone (not only the root users), in any location that you can write to. However, only the root user can install Java into the system location. 
    • Java on RPM-based Linux Platforms
      32-bit RPM-based Linux platforms, such as Red Hat and SuSE, use a RPM binary file (.rpm) in the system location. You must be root to perform this installation.

    Download the package that best suits your needs. You can download the file to any of the directories on your system.
  3. Download and check the download file size to ensure that you have downloaded the full, uncorrupted software bundle. Before you download the file, notice its byte size provided on the download page on the web site. Once the download has completed, compare that file size to the size of the downloaded file to make sure they are equal.


Install
Java for Linux Platforms
The instructions below are for installing version Java 7 Update 7 (7u7). If you are installing another version, make sure you change the version number appropriately when you type the commands at the terminal. Example: For Java 6u35 replace 7u7 with 6u35. Note that, as in the preceding example, the version number is sometimes preceded with the letter u, and sometimes it is preceded with an underbar, for example, jre1.7.0_07. 
  1. Change to the directory in which you want to install. Type:
    cd <directory path name>
    For example, to install the software in the /usr/java/ directory, Type:
    cd /usr/java/

    Note about root access: To install Java in a system-wide location such as /usr/local, you must login as the root user to gain the necessary permissions. If you do not have root access, install the Java in your home directory or a subdirectory for which you have write permissions
  2. Move the .tar.gz archive binary to the current directory.
  3. Unpack the tarball and install Java
    tar zxvf jre-7u7-linux-i586.tar.gz

    The Java files are installed in a directory called jre1.7.0_07 in the current directory.
    In this example, it is installed in the /usr/java/jre1.7.0_07 directory.
    When the installation has completed, you will see the word Done.
  4. Delete the .tar.gz file if you want to save disk space.

Java for RPM based Linux Platforms
The instructions below are for installing version Java 7 Update 7 (7u7). If you are installing another version, make sure you change the version number appropriately when you type the commands at the terminal. Example: For Java 6u35 replace 7u7 with 6u35. Note that, as in the preceding example, the version number is sometimes preceded with the letter u, and sometimes it is preceded with an underbar, for example, jre1.7.0_07
  1. Become root by running su and entering the super-user password.
  2. Uninstall any earlier installations of the Java packages.
    rpm -e <package_name>
  3. Change to the directory in which you want to install. Type:
    cd <directory path name>
    For example, to install the software in the /usr/java/ directory, Type:
    cd /usr/java
  4. Install the package.
    rpm -ivh jre-7u7-linux-i586.rpm

    To upgrade a package,
    rpm -Uvh jre-7u7-linux-i586.rpm
  5. Delete the .rpm file if you want to save disk space.
  6. Exit the root shell. No need to reboot.
The installation is now complete. Go to the Enable and Configure section.

Enable and Configure
Firefox or Mozilla
To configure the Java Plugin follow these steps:
  1. Exit Firefox browser if it is already running.
  2. Uninstall any previous installations of Java Plugin.
    Only one Java Plugin can be used at a time. When you want to use a different plugin, or version of a plugin, remove the symbolic links to any other versions and create a fresh symbolic link to the new one.
  3. Create a symbolic link to the libnpjp2.so file in the browser plugins directory
    • Go to the plugins sub-directory under the Firefox installation directory
      cd <Firefox installation directory>/plugins
    • Create the symbolic link
      ln -s <Java installation directory>/lib/i386/libnpjp2.so

    Note: If you are upgrading your Java version then before creating new symbolic link you should remove old symbolic link to enable latest downloaded Java.

    To remove old symbolic link:
    type cd <Firefox installation directory>/plugins
    rm libjavaplugin_oji.so

    Example
    • If Firefox is installed at this directory:
      /usr/lib/<Firefox installation directory>
    • And if the Java is installed at this directory:
      /usr/java/<Java installation directory>
    • Then type in the terminal window to go to the browser plug-in directory:
      /usr/lib/<Firefox installation directory>/plugin
    • Enter the following command to create a symbolic link to the Java Plug-in for the Mozilla browser.
      ln -s /usr/java/<Java installation directory>/lib/i386/libnpjp2.so


  4. Start the Firefox browser, or restart it if it is already up. 

    In Firefox, type about:plugins in the Location bar to confirm that the Java Plugin is loaded. You can also click the Tools menu to confirm that Java Console is there.

Test Installation
To test that Java is installed and working properly on your computer, run this test applet

Friday, October 26, 2012

Difference b/w rpm and apt-get


DIFFERENCE BETWEEN RPM AND UBUNTU


TaskRed Hat/FedoraUbuntu
Adding, Removing and Upgrading Packages
Refresh list of available packagesYum refreshes each time it's usedapt-get update
Install a package from a repositoryyum install package_nameapt-get install package_name
Install a package fileyum install package.rpm
rpm -i package.rpm
dpkg --install package.deb
Remove a packagerpm -e package_nameapt-get remove package_name
Check for package upgradesyum check-updateapt-get -s upgrade
apt-get -s dist-upgrade
Upgrade packagesyum update
rpm -Uvh [args]
apt-get dist-upgrade
Upgrade the entire systemyum upgradeapt-get dist-upgrade
Package Information
Get information about an available packageyum search package_name apt-cache search package_name
Show available packagesyum list availableapt-cache dumpavail
List all installed packagesyum list installed
rpm -qa
dpkg --list
Get information about a packageyum info package_nameapt-cache show package_name
Get information about an installed packagerpm -qi package_namedpkg --status package_name
List files in an installed packagerpm -ql package_namedpkg --listfiles package_name
List documentation files in an installed packagerpm -qd package_name-
List configuration files in an installed packagerpm -qc package_name-
Show the packages a given package depends onrpm -qR package_nameapt-cache depends
Show other packages that depend on a
given package (reverse dependency)
rpm -q -whatrequires [args]apt-cache rdepends
Package File Information
Get information about a package filerpm -qpi package.rpmdpkg --info package.deb
List files in a package filerpm -qpl package.rpmdpkg --contents package.deb
List documentation files in a package filerpm -qpd package.rpm-
List configuration files in a package filerpm -qpc package.rpm-
Extract files in a packagerpm2cpio package.rpm | cpio -viddpkg-deb --extract package.deb dir-to-extract-to
Find package that installed a filerpm -qf filenamedpkg --search filename
Find package that provides a particular fileyum provides filenameapt-file search filename
Misc. Packaging System Tools
Show stats about the package cache-apt-cache stats
Verify all installed packagesrpm -Vadebsums
Remove packages from the local cache directoryyum clean packagesapt-get clean
Remove only obsolete packages from the local cache directory-apt-get autoclean
Remove header files from the local cache directory
(forcing a new download of same on next use)
yum clean headersapt-file purge
General Packaging System Information
Package file extension*.rpm*.deb
Repository location configuration/etc/yum.conf/etc/apt/sources.list

Virtualization With Xen On CentOS 6.2 (x86_64) (Paravirtualization)

Step1:
Make sure that SELinux is disabled or permissive:



cmd: vi /etc/sysconfig/selinux


Step2:
If you had to modify /etc/sysconfig/selinux, please reboot the system:



reboot



Step3:Creating A Network Bridge

We need to set up a network bridge on our server so that our virtual machines can be accessed from other hosts as if they were physical systems in the network.
To do this, we install the package bridge-utils...
cmd: yum install bridge-utils
... and configure a bridge. Create the file /etc/sysconfig/network-scripts/ifcfg-br0 (please use the IPADDR, PREFIX, GATEWAY, DNS1 and DNS2 values from the /etc/sysconfig/network-scripts/ifcfg-eth0 file); make sure you use TYPE=Bridge, not TYPE=Ethernet:
cmd: vi /etc/sysconfig/network-scripts/ifcfg-br0




Modify /etc/sysconfig/network-scripts/ifcfg-eth0 as follows

cmd: vi /etc/sysconfig/network-scripts/ifcfg-eth0


Restart the network...



cmd: /etc/init.d/network restart



... and run



cmd: ifconfig




Step 4: Installing Xen

First check if your CPU supports hardware virtualization - if this is the case, the command


cmd: egrep '(vmx|svm)' --color=always /proc/cpuinfo

egrep'(vmx|svm)'--color=always/proc/cpuinfo
flags:fpuv medepsets cmsrpaem cecx8apicsepmtrrpgemcacmovpatpse3clflushmmxfxsrssesse2 ht syscall
 nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy misalignsse
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall



If nothing is displayed, then your processor doesn't support hardware virtualization. This means you can use only paravirtualization with Xen, but not hardware virtualization.
As CentOS 6 is based on RedHat 6, and RedHat has dropped support for Xen in version 6, we need to get Xen from a third-party repository. We can enable the repo as follows:
yum install wget
cd /etc/yum.repos.d/
wget http://www.crc.id.au/repo/kernel-xen.repo

To install Xen, we now simply run
cmd: yum install kernel-xen xen
This installs Xen and a Xen kernel on our CentOS system.
Before we can boot the system with the Xen kernel, please check your GRUB bootloader configuration. We open /boot/grub/menu.lst:
cmd: vi /boot/grub/menu.lst
We need to modify that section so that the Xen hypervisor gets loaded first. In the kernel /vmlinuz... line, replace the first word kernel with module. Do the same in the next line - replace the first word initrd with module in the initrd /initramfs... line. Then add the line kernel /xen.gz dom0_mem=1024M cpufreq=xen dom0_max_vcpus=1 dom0_vcpus_pin after the root line and before the first module line (if you have more than one CPU core, you can specify another number than 1 for dom0_max_vcpus). The final kernel section should look like this:

[...]
title CentOS (2.6.32.54-1.el6xen.x86_64)
        root (hd0,0)
        kernel /xen.gz dom0_mem=1024M cpufreq=xen dom0_max_vcpus=1 dom0_vcpus_pin
        module /vmlinuz-2.6.32.54-1.el6xen.x86_64 ro root=/dev/mapper/VolGroup00-LogVol00 rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD quiet SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto  KEYBOARDTYPE=pc KEYTABLE=de rd_LVM_LV=VolGroup00/LogVol01 rd_LVM_LV=VolGroup00/LogVol00 rd_NO_DM
        module /initramfs-2.6.32.54-1.el6xen.x86_64.img
[...]
The complete /boot/grub/menu.lst should look something like this:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/mapper/VolGroup00-LogVol00
#          initrd /initrd-[generic-]version.img
#boot=/dev/sde
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.32.54-1.el6xen.x86_64)
        root (hd0,0)
        kernel /xen.gz dom0_mem=1024M cpufreq=xen dom0_max_vcpus=1 dom0_vcpus_pin
        module /vmlinuz-2.6.32.54-1.el6xen.x86_64 ro root=/dev/mapper/VolGroup00-LogVol00 rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD quiet SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto  KEYBOARDTYPE=pc KEYTABLE=de rd_LVM_LV=VolGroup00/LogVol01 rd_LVM_LV=VolGroup00/LogVol00 rd_NO_DM
        module /initramfs-2.6.32.54-1.el6xen.x86_64.img
title CentOS (2.6.32-220.el6.x86_64)
        root (hd0,0)
        kernel /vmlinuz-2.6.32-220.el6.x86_64 ro root=/dev/mapper/VolGroup00-LogVol00 rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD quiet SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto  KEYBOARDTYPE=pc KEYTABLE=de rd_LVM_LV=VolGroup00/LogVol01 rd_LVM_LV=VolGroup00/LogVol00 rd_NO_DM

Before we reboot, we install the libvirt and python-virtinst (which contains the virt-install tool which we will use later on to install Xen VMs) packages:
cmd: yum install libvirt python-virtinst

Because the libvirt package from CentOS 6/RedHat 6 has no support for Xen, we must rebuild it with Xen support. To do this, we install a few prerequisites now:
cmd: yum groupinstall 'Development Tools'
OR



cmd: yum install python-devel xen-devel libxml2-devel xhtml1-dtds readline-devel ncurses-devel libtasn1-devel gnutls-devel augeas libudev-devel libpciaccess-devel yajl-devel sanlock-devel libpcap-devel libnl-devel avahi-devel libselinux-devel cyrus-sasl-devel parted-devel device-mapper-devel numactl-devel libcap-ng-devel netcf-devel libcurl-devel audit-libs-devel systemtap-sdt-devel



Let's find out our libvirt version:
cmd: rpm -qa | grep libvirt






It's 0.9.4, so we download the appropriate src.rpm package into /root/src and install it:

cmd: mkdir /root/src
cmd : cd /root/src
cmd: wget http://vault.centos.org/6.2/os/Source/SPackages/libvirt-0.9.4-23.el6.src.rpm
cmd: rpm -i libvirt-0.9.4-23.el6.src.rpm




The last command will show some warnings that you can ignore:
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
Next we patch Xen support into the libvirt sources:

cmd: wget http://pasik.reaktio.net/xen/patches/libvirt-spec-rhel6-enable-xen.patch
cmd: cd /root/rpmbuild/SPECS
cmd: cp -a libvirt.spec libvirt.spec.orig
cmd: patch -p0 < ~/src/libvirt-spec-rhel6-enable-xen.patch


Now we build a new libvirt package:

cmd: rpmbuild -bb libvirt.spec

At the end of the build process you should see something like this:
Wrote: /root/rpmbuild/RPMS/x86_64/libvirt-0.9.4-23.el6.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/libvirt-client-0.9.4-23.el6.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/libvirt-devel-0.9.4-23.el6.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/libvirt-lock-sanlock-0.9.4-23.el6.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/libvirt-python-0.9.4-23.el6.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/libvirt-debuginfo-0.9.4-23.el6.x86_64.rpm
Go to the directory where the new packages have been created (/root/rpmbuild/RPMS/x86_64/ in this case)...



Cmd: cd /root/rpmbuild/RPMS/x86_64/



... and install the new libvirt packages (with Xen support) as follows:
cmd: rpm -Uvh --force libvirt-0.9.4-23.el6.x86_64.rpm libvirt-client-0.9.4-23.el6.x86_64.rpm libvirt-python-0.9.4-23.el6.x86_64.rpm

Afterwards, we reboot the system:
cmd: reboot
The system should now automatically boot the new Xen kernel. After the system has booted, we can check that by running
cmd: uname -r






So it's really using the new Xen kernel!
We can now run
cmd: xm list





Instead of using the xm command, I will from now on use the virsh command to manage Xen VMs. This is the preferred way as we are using libvirt.



Cmd: virsh list
should show this:



Installing Centos as a Guest Operating System on Xen

Step1:
Go to Application -> System Tools -> Virtual Machine Manager
Its asking Root Password


Right Click on loachost(Xen) and the click on New


Its a ParaVirtualization It does not Give full Options
So we can install os by using Network Install(HTTP,FTP,NFS)








Its Creating Virtual Machine

























In this way we can install Centos ...






PLEASE REFER BELOW LINK FOR FULL REFERENCE

http://www.howtoforge.com/virtualization-with-xen-on-centos-6.2-x86_64-paravirtualization-and-hardware-virtualization

INSTALLING/CONFIGURING APACHE V2 AND PHP V4 THROUGH SOURCE CODE AND MYSQL THROUGH YUM/RPM IN CENTOS 6.2/RHEL5



INSTALLING/CONFIGURING APACHE V2 AND PHP V4 THROUGH SOURCE CODE AND MYSQL THROUGH YUM/RPM IN CENTOS 6.2/RHEL5

Why compile from source

You may ask, why we need to compile PHP and Apache from source when binary RPMs are already available and which don't take much effort to setup. The reason is, it provides you much more flexibility. Instead of being dependent on other people's RPMs you can decide what PHP and Apache functionality you want to enable. Another reason is that these RPMs are weeks or months out of date. When compiling from source, you can also specify the directory where software will be installed. Also, after you see your compiled software working, it really provides great satisfaction. Compilation process is really very straight forward.

Before you start

Before starting to compile Apache and PHP you must uninstall all previous Apache and PHP related RPMs installed on your system

Then download apache 2.0 source and PHP source . These files have .tar.gz extension. Save these files to any directory of your choice. I am using PHP 4.4.9 and Apache 2.0.44/64 and have these files in /usr/src directory.

NOTE: I faced no problems with Apache 2.0.44 and PHP 4.4.9(IN CENT 6.2)
I faced no problems with Apache 2.0.64 and PHP 4.4.9(IN RHEL 5)
I have faced so many problems with Apache 2.0.44 and PHP 4.3.0 /4.3.9in my system (CENT 6.2 64 bit)
but it may work in another machines(like cent os 5 /RHEL5).
Most others faced no problems with Apache 2.0.40 / 2.0.43 and PHP 4.2.3 and Apache 2.0.44 and PHP 4.3.0

YOU MAY GET PROBLEMS WHILE USING BELOW SOURCE CODE
    Apache 2.0.39 and PHP 4.2.3 / 4.2.2 

Compilation Process

Login as root to follow these steps.

#cd /usr/src

download source code from apache website and unzip in /usr/src

# cd /usr/src/httpd-2.0.44


#./configure --prefix=/wwwroot –enable-so

(OR)


#./configure --prefix=/wwwroot --enable-so --enable-deflate --enable-expires --enable-headers --enable-rewrite --with-included-apr --with-included-apr-util



First option --prefix tells configure script that we want Apache to be installed in directory /wwwroot. If we don't provide a prefix option than it'll be installed in default location, which is /usr/local/apache2.
I am installing everything in /wwwroot because:
  1. when a new version of PHP and Apache is released, I only have to rename /wwwroot directory to some other name like /wwwrootold and then I can install new versions in /wwwroot directory again. If new installation works properly then I can simply copy configuration files from old directory to /wwwroot.
  2. users new to compiling software from source, after compiling and installing it, try to find a way to uninstall the software. So, benefit of keeping everything at one place is; if someone wants to uninstall Apache and PHP then he just has to delete /wwwroot directory (After stopping Apache, if it is running).
Second option --enable-so tells configure to enable module so, which allows Apache to load shared modules. We need this option because we are compiling PHP as Apache shared module.
Example Apache configure command line looks like this. After configure finishes we have to compile Apache.

YOU MAY GET THIS TYPE OF ERROR

rotatelogs.c:298: warning: implicit declaration of function ‘apr_file_link’
/usr/lib64/apr-1/build/libtool --silent --mode=link gcc -std=gnu99 -pthread
-o rotatelogs rotatelogs.lo /usr/lib64/libaprutil-1.la -ldb-4.7 -lexpat
-ldb-4.7 /usr/lib64/libapr-1.la -lpthread
rotatelogs.o: In function `post_rotate':
rotatelogs.c:(.text+0x5ed): undefined reference to `apr_file_link'
collect2: ld returned 1 exit status
make[2]: *** [rotatelogs] Error 1
make[2]: Leaving directory `/usr/local/src/httpd-2.0.44/support'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/httpd-2.0.44/support'
make: *** [all-recursive] Error 1

IF U GET SAME ERROR THEN DOWNLOAD NEW APR AND APR-UTIL FROM INTERNET AND THEN COPY INTO
/usr/local/src/httpd-2.4.1/srclib/
AND UNZIP RENAME IT TO “apr and apt-util” as shown below
cd /usr/local/src/httpd-2.4.1/srclib/
Installing APR & APR-Utils dependencies :
#wget http://mirror-cybernet.lums.edu.pk/pub/apache//apr/apr-util-1.4.1.tar.bz2

#wget http://mirror-cybernet.lums.edu.pk/pub/apache//apr/apr-1.4.6.tar.bz2

#tar -jxf apr-1.4.6.tar.bz2

#tar -jxf apr-util-1.4.1.tar.bz2

#mv apr-1.4.6 apr

#mv apr-util-1.4.1 apr-util

Lets configure it now :

#./configure --prefix=/wwwroot --enable-so --enable-deflate --enable-expires --enable-headers --enable-rewrite --with-included-apr –with-included-apr-util



ERROR:
you may get lot of errors thats depends upon the libraries or dependencies and other modules first see the error if you get any errors just type

# yum install packname*

AGAIN ERROR :
if you got same error or different error some dependencies are missing in your OS. So please check the dependencies and install it through rpm or yum
OR)
simply change the source code of apache and try another version in your system and follow above process

#make


#make install

This will install Apache to /wwwroot directory. Now test your Apache installation by starting Apache:

# /wwwroot/bin/apachectl start-----------for starting apache


# /wwwroot/bin/apachectl stop -----------for stoping apache


INSTALLING MYSQL
you can install mysql through yum or rpm

#yum install mysql*

it will install all packages of my sql
type below command for changing password of root user of mysql

#mysql -u root -p


#PASSWD:********** -------it will ask password then enter new password


Compiling PHP

Change to directory where you have downloaded PHP source.



# cd /usr/src



Then we have to extract PHP source files from php-4.4.9.tar.gz file.
To decompress the compressed file use:
# gunzip php-4.4.9.tar.gz
You will have a file named php-4.3.0.tar in your current directory. Now to extract its contents use:
# tar -xvf php-4.4.9.tar
Both above steps can be completed by using this command:
# tar -zxvf php-4.4.9.tar.gz



A new directory php-4.3.0 will be created in your current directory. For me its /usr/src/php-4.3.0.
Now change to this directory:
# cd /usr/src/php-4.4.9



#./configure --prefix=/wwwroot/php --with-apxs2=/wwwroot/bin/apxs --with-config-file-path=/wwwroot/php --with-mysql
After configure finishes. You have to type make to compile PHP:
# make



It will take several minutes to compile. After make finishes and, no error etc. is displayed then PHP has been compiled successfully. If any warning is displayed then, normally, you can ignore it.
After this, if Apache is running stop Apache:
# /wwwroot/bin/apachectl stop






Now you can execute make install from within PHP source directory to install PHP to /wwwroot/php directory:
# make install



make install will install PHP4 module to Apache's modules sub-directory (/wwwroot/modules) and add a line like this:
AddType application/x-httpd-php .php
in /wwwroot/conf/httpd.conf file
To add this line search for word AddType in httpd.conf file. There will be a line like this:
AddType application/x-tar .tgz
Below this line add (on a new line):
AddType application/x-httpd-php .php

Save this file and then start Apache:

# /wwwroot/bin/apachectl start



Testing the PHP Installation

Now create a PHP file named info.php, using any editor like vi or emacs, in the /wwwroot/htdocs directory and enter three lines, shown below, in this file. Directory /wwwroot/htdocs is Apache root directory. Apache publishes all files present in this directory to web users. This directory can be changed by editing httpd.conf file and changing DocumentRoot value to some other directory.
info.php
<?php
phpinfo();
?>

Save this file and then access this file using a web browser
Now you can copy /usr/src/php-4.4.9/php.ini-dist to /wwwroot/php/ directory as php.ini.

# cp /usr/src/php-4.4.9/php.ini-dist /wwwroot/php/php.ini

# /wwwroot/bin/apachectl restart


NOTE:
AFTER INSTALLING ALL DEPENDENCIES AND MODULES AND DEPENDENT LIBRARIES ITS WORKING IN MY SYSTEM
IAM NOT SURE IT MAY WORK IT MAY NOT WORK IN YOUR SYSTEM
BUT TRY DIFFERENT DIFFERENT SOURCE CODE OF APACHE AND PHP IN YOUR SYSTEM IT WILL WORK IN YOUR SYSTEM

FOR MORE CLARIFICATION FOLLOW THE BELOW LINK I HAVE FOLLOWED SOMANY LINKS BUT THIS IS THE BEST LINK

http://www.web-tech-india.com/articles/php/compiling_php_apache/

Linux Open Port


Redhat / CentOS / Fedora Linux Open Port

Q. I’ve Redhat Enterprise Linux 5 server with Iptabeles firewall enabled. By default it is only allowing port 22. How do I open port 80 / 143 / 110 on Linux? I've started all services but don't know how to open port using iptables.
A. By default iptables firewall stores its configuration at /etc/sysconfig/iptables file. You need to edit this file and add rules to open port number. This file only avilable under
Red Hat Enterprise Linux 3 / 4 / 5 and above
=> Old Red hat Linux version
=> CentOS 4 and above
=> Fedora Linux

Open port 80

Open flle /etc/sysconfig/iptables:
# vi /etc/sysconfig/iptables
Append rule as follows:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
Save and close the file. Restart iptables:
# /etc/init.d/iptables restart

Open port 110

Append rule as follows:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 110 -j ACCEPT

Open port 143

Append rule as follows:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 143 -j ACCEPT

Restart iptables service

Type the following command:
# service iptables restart

Verify that port is open

Run following command:
netstat -tulpn | less
Make sure iptables is allowing port 80 / 110 / 143 connections:
iptables -L -n

Linux Commands for Beginners

Linux Commands
A B C D E F G H I K L M N P Q R S T U V W XYZ
References and answers
back to beginning

A
alias Create your own name for a command
arch print machine architecture
ash ash command interpreter (shell)
awk (gawk) pattern scanning and processing language


B
basename Remove directory and suffix from a file name
bash GNU Bourne-Again Shell
bsh Command interpreter (Shell)
bc Command line calculator
bunzip2 Unzip .bz2 files


C back to commands top
cat Concatenate a file print it to the screen
chgrp Change the group designation of a file
chmod Change file permissions
chown Change the owner of a file
cjpeg Compress an image file to a JPEG file
clear Clear terminal screen (command line)
comm Compare two sorted files
stty cooked Formatting the display of text in a terminal
cp Copy command
cpio Copy files to and from archives
csh C Shell
cut Print selected parts of lines to standard output


D back to commands top
date Display date and time
dc Command line calculator
df Show amount of disk space free
diff Determine difference between two files
diff3 Determine difference between 3 files
dig Interrogate DNS name servers
djpeg Decompress a JPEG file to an image file
dmesg Print or control the kernel ring buffer (print out bootup messages)
dnsdomainname Show the system's DNS domain name
doexec Run an executable with an arbitrary argv
domainname Show or set the system's NIS/YP domain name
dos2unix Converts plain text files in DOS/MAC format to UNIX format
du Show disk useage
dumpkeys Write keyboard driver's translation tables to std output


E back to commands top
echo Display a line of text
ed Line-oriented text editor
egrep Print lines matching a pattern
elinks A text mode WWW browser (supports frames)
env Dislay the path
ex Start Vim in ex mode
eject Eject media from device ( command line )


F back to commands top
factor Display prime factors of a number
false Exit with a status code indicating failure
fdisk The fdisk command with usage examples
fgrep Variant of grep
find Find a file
finger Displays information about the system users
fixps Try to fix common PostScript problems that break postprocessing
free Display free memory


G back to commands top
grep Search for a pattern using regular expression
gtar See the tar command
gunzip Unzip .gz files
gzip Compress using Lempel-Ziv coding (LZ77)


H back to commands top
halt Stop the system
hdparm Get/set harddisk parameters
head Print the first 10 lines of a file to standard output
hostname Show or set the system's host name
history Display entire command history
HISTSIZE Change history size
httpd Start Apache


I back to commands top
identify Describes the format and characteristics of image files.
id Print information for username, or the current user
ifconfig Display network and hardware addresses
igawk Gawk with include files
ipcalc Calculate IP information for a host


K back to commands top
kbd_mode Report or set the keyboard mode (RAW, MEDI- UMRAW or XLATE)
kill Terminate a process


L back to commands top
last Show listing of last logged in users
lastlog Formats and prints the contents of the last login log /var/log/lastlog file
link Call the link function to create a link to a file
links See elinks
ln Create a link to the specified TARGET with optional LINK_NAME
loadkeys Load keyboard translation tables
locate Locate a file
login Sign on
look Displays any lines in file which contain "string" as a prefix.
ls List directory contents
lsmod List loaded kernel modules
lynx Command to start the Lynx browser


M back to commands top
mac2unix Converts plain text files in DOS/MAC format to UNIX format
mail A mail processing system, which has a command syntax like ed
man Display a particular manual entry
manweb Manweb is part of the Netpbm package
mdu Display the amount of space occupied by an MSDOS directory
mkdir Create a directory
mkfs Make a filesystem on a drive
mknod Make block or character special files
mktemp Make temporary filename (unique)
more Page through text one screenful at a time.
mount Mount a filesystem/device
mt Control magnetic tape drive operation
mv Move and / or rename files
:


N
namei Follow a pathname until a terminal point is found
nano An enhanced free Pico clone
nc arbitrary TCP and UDP connections and listens
(note that nc is also called the client interface
to the NEdit program but it is not the
command that invokes nedit-nc on current systems)
ncftp Browser program for the File Transfer Protocol
nedit-nc nedit-nc is the client interface to the NEdit text editor
netstat Display verbose info about network processes and ports
nice Run a command with modified priority
nisdomainname Show or set system's NIS/YP domain name
nslookup query internet domain name servers


P
paste Merge lines of files
pdf2dsc Generate a PostScript page list of a PDF document
pdf2ps Convert PDF file "input.pdf" to PostScript(tm) in "output.ps"
pdfinfo Print contents of the 'Info' dictionary (plus some other useful information) from a PDF file
pdftotext Convert pdf files to plain text
perl (start) Practical Extraction and Report Language
pgawk The profiling version of gawk
pico Text editor that comes with Pine (from the University of Washington)
pine Email program used by The University of Washington
ping6 Ping
ping Send ICMP ECHO_REQUEST to network hosts
pinky A lightweight 'finger' program;
pr Format for printing
ps Processes running
ps2ascii Ghostscript translator from PostScript or PDF to ASCII
ps2epsi Generate conforming Encapsulated PostScript
ps2frag Obsolete shell script for the PSfrag system
ps2pdf12 Convert PostScript to PDF 1.2 (Acrobat 3 and later compatible) using ghostscript
ps2pdf13 Convert PostScript to PDF 1.3 (Acrobat 4 and later compatible) using ghostscript
ps2pdf14 Use ps2pdfwr: Convert PostScript to PDF without specifying Compatibility Level, using ghostscript
ps2pdf Convert PostScript to PDF using ghostscript
ps2pdfwr Convert PostScript to PDF without specifying Compatibility Level, using ghostscript
ps2pk creates a TeX pkfont from a type1 PostScript font
ps2ps ps2ps uses gs to convert PostScript(tm) file "input.ps" to simpler and (usually) faster PostScript in "output.ps"
psbook Rearranges pages from a PostScript document into "signatures" for printing books or booklets
pwd Print Working Directory


Q back to commands top
quota display disk usage and limits


R back to commands top
resize Xterm window size
readelf Displays information about ELF files
reboot Stop the system, poweroff, reboot
red red is a restricted ed: it can only edit files in the current directory and cannot execute shell commands
rename Rename files
rmdir Remove a directory
rm Remove files or directories
rpm rpm command options
rundig Sample script to create a search database for ht://Dig
rview The GUI version of Vim in easy mode with restrictions
rvi Vi / Vim editor


S back to commands top
sed Stream editor
setfont Load EGA/VGA console screen font
set gid Set group id
set serial Get / set Linux serial port info
set uid Set user id
sfdisk Modified fdisk program
sftp Secure file transfer protocol (ftp)
sh Shell (BASH)
shred Safely remove data from disk drive
sleep Delay for a specified amount of time
slocate Security Enhanced version of the GNU Locate
sort Sort lines of a text file
ssh Secure shell connection command
stty change and print terminal line settings
stty raw Unformatted output to terminal
su Become super user ( root )
switchdesk Graphical and text mode interface for choosing desktop environment
sync Force changed blocks to disk, update the super block
ssh Secure shell connection command


T back to commands top
tail Print the last 10 Lines of a file standard output
tar Create an Archive
tcsh Enhanced completely compatible version of the Berkeley UNIX C shell, csh
tee Copy standard input to each file, and also to standard output
telnet User interface to the telnet protocol
time Run the specified program command with the given arguments
touch Change file timestamps
tracepath6 See tracepath
tracepath Trace path to a network host discovering MTU along this path
traceroute6 See traceroute
traceroute Print the route packets take to network host
tree Display file tree
true Exit with a status code indicating success
tty Print name of terminal connected to standard output


U back to commands top
umask File creation mask / Bash builtins
umount Detache file system(s) mentioned from file hierarchy
uname Print system information ( kernel version )
unicode_start Put keyboard and console into Unicode (UTF-8) mode
unicode_stop Undo the effect of unicode_start
unlink Call the unlink function to remove the specified file
uniq Remove duplicate lines from sorted file
updatedb Update the slocate database
unset gid Group id change
unset uid User id change
untar Unarchive ( untar ) a file
unzip Unzip .zip files
useradd Add new user
users Output who is currently logged in according to system records
usleep Sleep a given number of microseconds. default is 1


V back to commands top
view Start vim in read-only mode
vi Start the vi editor


W back to commands top
w Show who is logged on and what they are doing
wc Word count of a file
wget Non-interactive download of files from the Web
whatis Search the whatis database for complete words (command names)
whereis Locate a command or file
which Find command path
whoami Print effective userid
who show who is logged on
whois Client for the whois service


X,Y,Z back to commands top
xinit Start Xserver
xpdf Portable Document Format (PDF) file viewer for X windows
xrandr Change resolution running Xwindows ( command line )
ypdomainname show or set the system's NIS/YP domain name
zcat Compress or expand files
zip Compression and file packaging utility for Unix, VMS, MSDOS, OS/2, Windows NT, Minix,
Atari and Macintosh, Amiga and Acorn RISC OS. It is analogous to a
combination of the UNIX commands tar(1) and compress(1) and is
compatible with PKZIP (Phil Katz’s ZIP for MSDOS
systems)

zipinfo List detailed information about a ZIP archive