Sunday, November 21, 2010

Virtualization on RHEL 5

-xen is the basis for virtualization in RHEL 5

-Advantages of virtualization

1-effective resource usage

2-easy management

para virtualization-same arch os support

full virtualization-any arch os support 

-para virtualization

packages-

kernel-xen from pub/Server

Virt-Manager from pub/VT

yum install kernel-xen
yum install virt-manager
yum install xen

uname -r
reboot system

application->system tools->Virtual machine manager->new




To automatically run the guest after a system (Dom0) reboot, we have to create the following link:

# ln -s /etc/xen/[guest_name] /etc/xen/auto/

We can manage the Xen Guest with xm commands, virsh commands or virt-manager.

Virt-Manager
# virt-manager



xm commands
List Domains (Xen Guests)

# xm list
Start a Guest

# xm create [guest-config]
Connect to a guest console ( Back: ESC-] (US-keyboard), Ctrl-5 (German keyboard))

# xm console [guest_name]
Shutdown a guest

# xm shutdown [guest_name]
Destroy (Power off) a guest

# xm destroy [guest_name]
Monitor guests

# xm top


virsh commands
# virsh
virsh # help 

Commands:

    autostart       autostart a domain
    capabilities    capabilities
    connect         (re)connect to hypervisor
    console         connect to the guest console
    create          create a domain from an XML file
    start           start a (previously defined) inactive domain
    destroy         destroy a domain
    define          define (but don't start) a domain from an XML file
    domid           convert a domain name or UUID to domain id
    domuuid         convert a domain name or id to domain UUID
    dominfo         domain information
    domname         convert a domain id or UUID to domain name
    domstate        domain state
    dumpxml         domain information in XML
    help            print help
    list            list domains
    net-autostart   autostart a network
    net-create      create a network from an XML file
    net-define      define (but don't start) a network from an XML file
    net-destroy     destroy a network
    net-dumpxml     network information in XML
    net-list        list networks
    net-name        convert a network UUID to network name
    net-start       start a (previously defined) inactive network
    net-undefine    undefine an inactive network
    net-uuid        convert a network name to network UUID
    nodeinfo        node information
    quit            quit this interactive terminal
    reboot          reboot a domain
    restore         restore a domain from a saved state in a file
    resume          resume a domain
    save            save a domain state to a file
    schedinfo       show/set scheduler parameters
    dump            dump the core of a domain to a file for analysis
    shutdown        gracefully shutdown a domain
    setmem          change memory allocation
    setmaxmem       change maximum memory limit
    setvcpus        change number of virtual CPUs
    suspend         suspend a domain
    undefine        undefine an inactive domain
    vcpuinfo        domain vcpu information
    vcpupin         control domain vcpu affinity
    version         show version
    vncdisplay      vnc display
    attach-device   attach device from an XML file
    detach-device   detach device from an XML file
    attach-interface attach network interface
    detach-interface detach network interface
    attach-disk     attach disk device
    detach-disk     detach disk device
Exp.: Start a guest with virsh

# virsh start [guest_name]

###KickStart [Unattended Installation]###

Kickstart helps to install system unattended. It uses kickstart configuration file and dhcp service for this.
In windows systems kickstart file is known as answer file.

###These are the steps happening.###
Server[dhcp+ks] client
1. asks IP and location of kickstart file
2.gives the info
3. Takes the ks.cfg file and mounts share of OS

###dhcp [nfs/ftp/http] + ks.cfg [nfs]###
The dhcp is using for getting IP for the client machine at first for instation and to get the location of Ks.cfg file. The remote installation image can be of NFS,HTTP or FTP. The kickstar file will be shared using NFS.

###KickStart Configuration###
package = system-config-kickstart
#yum -y install system-config-kickstart
#system-config-kickstart


Basic configuration
Default Language = English USA
Keyboard = U S English
Time Zone = Asia/Culcutta
Root Password = redhat
Confirm Password = redhat
check the encryption box
Target Architecture = x86,AMD64 or Intel EM64T
Check the reboot checkbox

Installation Method
Installaton method = Perform new installation
Choose the Installation Method = NFS //You can use HTTP or FTP if you want
NFS server = IP of the machine which contains NFS image of DVD
NFS directory = Path of NFS share

Boot Loader options
Install New Boot Loader
Use GRUB password if required
Install boot loader on MBR

Partition Information
Do not clear MBR
Remove all exisiting partitions //Removing linux partitions only wont work all time. Windows partitions will be deleted.
click add button and configure as required

Network Configuration
Click Add Network Devices button
Select the network device which is connected to ur machine
network type = DHCP or STATIC [manual]

Authentication 
Authentication Configuration
check use shadow passwords
check use MD5

Firewall Configuration
Firewall Configuration
Security level = Disable firewall
SELinux = Disabled

Display Configuration
Check Configure the x-window system
In General Tab
Color Depth Resolution
8 1024*768 //Default 640*480 will give a blurred image
Default Desktop
Check Gnome
Check Start X window system on Boot

package selection
Nothing to do //We will add package lines 

Pre-Installation Script
Add if wanted

Post-Installation Script
Add if wanted

Configuration over. Save the file. Open the file for further editing.
#vi ks.cfg

Add these lines - Otherwise it wont work.
key --skip
%packages

And these lines for Graphics

@admin-tools
@base
@base-x
@core
@dialup
@editors
@games
@gnome-desktop
@graphical-internet
@graphics
@java
@office
@printing
@sound-and-video
@text-internet

###Make it as NFS share###
copy the ks.cfg file to some dir and share it via NFS

#mkdir /kick
#cp ks.cfg /kick/


#vi /etc/exports
/kick *()

#exportfs -a

###DHCP Configuration###
Add these lines to DHCP Configuration file
#vi /etc/dhcpd.conf

filename "/kick/ks.cfg";
next-server 192.168.1.101; // [ip of the machine which contains kickstart file(ks.cfg)]

#service dhcpd restart
#service nfs restart

###Installation###

#Boot: linux ks
Have a break. The system will be ready when you get back!

Installing Virtualbox on Fedora 13

Today we are going to see how to install Oracle Virtualbox in Fedora 13 Goddard which is the latest release from the Fedora Community.
  • To install virtualbox we should first go to http://www.virtualbox.org.
  • In the downloads section we can see Virtualbox for Linux hosts and if we follow that link we can see the Virtualbox for Fedora 13′s link.
  • Depending on the architecture of OS installed download either i386 or AMD64 version.
  • Now before installing it let us install 2 important packages namely gcc and kernel-devel packages.
For installing gcc open terminal and give the following command
#yum install gcc
Now to install kernels development package first find out the current kernel you are using.
#uname -r
See whether there is anything like “PAE” in the output of the above command. if so install the PAE kernels devel version. else normal version.
#yum install kernel-devel
or
#yum install kernel-PAE-devel
Now import the public key of virtualbox package using the command
wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O-
| rpm --import -
Now navigate to the folder which contains the virtualbox downloaded package and give the command.
#yum localinstall VirtualBox-3.2-3.2.6_63112_fedora13-1.i686.rpm
The above command will pull out the necessary dependencies if any and will compile the kernel module too :)

How to install MySQL on Fedora 13


  1. Install MySQL
    yum install mysql-server php-mysql

How to configure MySQL on Fedora 13

  1. Set the MySQL service to start on boot
    chkconfig --levels 235 mysqld on
  2. Start the MySQL service
    service mysqld start
  3. Log into MySQL
    mysql -u root
  4. Set the root user password for all local domains
    SET PASSWORD FOR 'root'@'localhost' = PASSWORD('new-password');
    SET PASSWORD FOR 'root'@'hostname' = PASSWORD('new-password');
    SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('new-password');
  5. Drop the Any user
    DROP USER ''@'localhost';
    DROP USER ''@'hostname';
    DROP USER ''@'%';
  6. Drop the test database
    DROP DATABASE test;
  7. Exit MySQL
    exit 
  8. ----------------------------------------------------------------

Install MySQL Database 5.1 (5.1.52) on Fedora 13/14, CentOS 5.5, Red Hat (RHEL) 5.5/6

1. Change root user

su -
## OR ##
sudo -i

2. Install Remi repository

Fedora

## Remi Dependency on Fedora 14
rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-rawhide.noarch.rpm
rpm -Uvh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-rawhide.noarch.rpm
 
## Remi Dependency on Fedora 13, 12, 11, 10, 9, 8
rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm 
rpm -Uvh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm
 
## Fedora 14 ##
rpm -Uvh http://rpms.famillecollet.com/remi-release-14.rpm
 
## Fedora 13 ##
rpm -Uvh http://rpms.famillecollet.com/remi-release-13.rpm
 
## Fedora 12 ##
rpm -Uvh http://rpms.famillecollet.com/remi-release-12.rpm
 
## Fedora 11 ##
rpm -Uvh http://rpms.famillecollet.com/remi-release-11.rpm
 
## Fedora 10 ##
rpm -Uvh http://rpms.famillecollet.com/remi-release-10.rpm
 
## Fedora 9 ##
rpm -Uvh http://rpms.famillecollet.com/remi-release-9.rpm
 
## Fedora 8 ##
rpm -Uvh http://rpms.famillecollet.com/remi-release-8.rpm

CentOS and Red Hat (RHEL)

## Remi Dependency on CentOS and Red Hat (RHEL)
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
 
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm

3. Check Available MySQL versions

Fedora 14

yum list mysql

Fedora 14, (13, 12, 11, 10, 9, 8, 7), CentOS 5.5 and Red Hat (RHEL) 5.5

yum --enablerepo=remi list mysql
Output:
Loaded plugins: changelog, fastestmirror, presto, refresh-packagekit
...
remi                                                            | 3.0 kB     00:00     
remi/primary_db                                                 | 106 kB     00:00     
Available Packages
mysql.i686                           5.1.52-1.fc14.remi                     remi
mysql-server.i686                    5.1.52-1.fc14.remi                     remi

4. Update or Install MySQL 5.1 (5.1.50)

Fedora 14

yum install mysql mysql-server

Fedora 13 (12, 11, 10, 9, 8, 7), CentOS 5.5 and Red Hat (RHEL) 5.5

yum --enablerepo=remi install mysql mysql-server
Output:
...
Dependencies Resolved
 
==============================================================================================
 Package                  Arch           Version                       Repository        Size
==============================================================================================
Installing:
 mysql                    i686           5.1.52-1.fc14.remi            remi             881 k
 mysql-server             i686           5.1.52-1.fc14.remi            remi             8.8 M
Installing for dependencies:
 mysql-libs               i686           5.1.52-1.fc14.remi            remi             1.2 M
 perl-DBD-MySQL           i686           4.017-1.fc14                  fedora           137 k
 perl-DBI                 i686           1.613-1.fc14                  fedora           775 k
 
Transaction Summary
==============================================================================================
Install       5 Package(s)
 
Total download size: 12 M
Installed size: 33 M
Is this ok [y/N]: y
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 12 M
(1/5): mysql-5.1.52-1.fc14.remi.i686.rpm                               | 881 kB     00:00     
(2/5): mysql-libs-5.1.52-1.fc14.remi.i686.rpm                          | 1.2 MB     00:00     
(3/5): mysql-server-5.1.52-1.fc14.remi.i686.rpm                        | 8.8 MB     00:04     
(4/5): perl-DBD-MySQL-4.017-1.fc14.i686.rpm                            | 137 kB     00:00     
(5/5): perl-DBI-1.613-1.fc14.i686.rpm                                  | 775 kB     00:00     
----------------------------------------------------------------------------------------------
Total                                                         1.5 MB/s |  12 MB     00:07     
warning: rpmts_HdrFromFdno: Header V3 DSA/SHA1 Signature, key ID 00f97f56: NOKEY
remi/gpgkey                                                            | 2.6 kB     00:00 ... 
Importing GPG key 0x00F97F56:
 Userid : Remi Collet <RPMS@FamilleCollet.com>
 Package: remi-release-14-6.fc14.remi.noarch (installed)
 From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-remi
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing     : mysql-libs-5.1.52-1.fc14.remi.i686                                     1/5 
 
WARNING : This MySQL RPM is not an official Fedora/Redhat build and it
overrides the official one. Don\'t file bugs on Fedora Project nor Redhat.
Use dedicated forums http://forums.famillecollet.com/
 
  Installing     : perl-DBI-1.613-1.fc14.i686                                             2/5 
  Installing     : mysql-5.1.52-1.fc14.remi.i686                                          3/5 
  Installing     : perl-DBD-MySQL-4.017-1.fc14.i686                                       4/5 
  Installing     : mysql-server-5.1.52-1.fc14.remi.i686                                   5/5 
 
Installed:
  mysql.i686 0:5.1.52-1.fc14.remi            mysql-server.i686 0:5.1.52-1.fc14.remi           
 
Dependency Installed:
  mysql-libs.i686 0:5.1.52-1.fc14.remi           perl-DBD-MySQL.i686 0:4.017-1.fc14          
  perl-DBI.i686 0:1.613-1.fc14                  
 
Complete!

5. Start MySQL server and autostart MySQL on boot

/etc/init.d/mysqld start ## use restart after update
## OR ##
service mysqld start ## use restart after update
 
chkconfig --levels 235 mysqld on

6. MySQL Secure Installation

  • Set (Change) root password
  • Remove anonymous users
  • Disallow root login remotely
  • Remove test database and access to it
  • Reload privilege tables

Start MySQL Secure Installation with following command

/usr/bin/mysql_secure_installation
Output:
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
 
 
In order to log into MySQL to secure it, we\'ll need the current
password for the root user.  If you\'ve just installed MySQL, and
you haven\'t set the root password yet, the password will be blank,
so you should just press enter here.
 
Enter current password for root (enter for none): 
OK, successfully used password, moving on...
 
Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.
 
Set root password? [Y/n] Y
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!
 
 
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.
 
Remove anonymous users? [Y/n] Y
 ... Success!
 
Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.
 
Disallow root login remotely? [Y/n] Y
 ... Success!
 
By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.
 
Remove test database and access to it? [Y/n] Y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!
 
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
 
Reload privilege tables now? [Y/n] Y
 ... Success!
 
Cleaning up...
 
 
 
All done!  If you\'ve completed all of the above steps, your MySQL
installation should now be secure.
 
Thanks for using MySQL!
Note: If you don’t want some reason, do a “MySQL Secure Installation” then at least it’s very important to change the root user’s password
mysqladmin -u root password [your_password_here]
 
## Example ##
mysqladmin -u root password myownsecrectpass

7. Connect to MySQL database (localhost) with password

mysql -u root -p
 
## OR ##
mysql -h localhost -u root -p

8. Create Database, Create MySQL User and Enable Remote Connections to MySQL Database

This example uses following parameters:
  • DB_NAME = webdb
  • USER_NAME = webdb_user
  • REMOTE_IP = 10.0.15.25
  • PASSWORD = password123
  • PERMISSIONS = ALL
## CREATE DATABASE ##
mysql> CREATE DATABASE webdb;
 
## CREATE USER ##
mysql> CREATE USER 'webdb_user'@'10.0.15.25' IDENTIFIED BY 'password123';
 
## GRANT PERMISSIONS ##
mysql> GRANT ALL ON webdb.* TO webdb_user@'10.0.15.25';
 
##  FLUSH PRIVILEGES, Tell the server to reload the grant tables  ##
mysql> FLUSH PRIVILEGES;

Enable Remote Connection to MySQL Server –> Open MySQL Port (3306) on Iptables Firewall (as root user again)

1. Edit /etc/sysconfig/iptables file:

nano -w /etc/sysconfig/iptables

2. Add following line before COMMIT:

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT

3. Restart Iptables Firewall:

service iptables restart
## OR ##
/etc/init.d/iptables restart

4. Test remote connection:

mysql -h dbserver_name_or_ip_address -u webdb_user -p webdb

Install Eclipse SDK 3.6.1 (Helios) on Fedora 14/13, CentOS/RHEL 5.5/6

This is guide, howto install latest Eclipse SDK 3.6.1 (Helios) on Fedora, CentOS and Red Hat (RHEL). This guide should work with Fedora 14, Fedora 13, Fedora 12, CentOS 5.5, Red Hat (RHEL) 5.5, Red Hat (RHEL) 6. And even with earlier versions.
Eclipse is a multi-language software development environment comprising an integrated development environment (IDE) and an extensible plug-in system. It is written primarily in Java and can be used to develop applications in Java and, by means of various plug-ins, other languages including C, C++, COBOL, Python, Perl, PHP, Scala and Ruby (including Ruby on Rails framework).

Install Eclipse SDK 3.6.1 (Helios) on Fedora, CentOS, Red Hat (RHEL)

1. Install Sun/Oracle Java JDK 6 on Fedora, CentOS, Red Hat (RHEL)

2. Download Eclipse SDK 3.6.1 (Helios)

Download suitable version from www.eclipse.org/downloads. This guide uses Eclipse Classic 3.6.1 version. Another popular versions are Eclipse IDE for Java EE Developers, Eclipse IDE for Java Developers and Eclipse for PHP Developers. Select also 32-bit or 64-bit version depending on your system.

3. Change root user

su -
## OR ##
sudo -i

4. Extract Eclipse package (example to /opt directory)

tar -xvzf eclipse-SDK-3.6.1-linux-gtk.tar.gz -C /opt

5. Add read permissions to all files

chmod -R +r /opt/eclipse

6. Create Eclipse executable on /usr/bin path

touch /usr/bin/eclipse
chmod 755 /usr/bin/eclipse
 
## Open eclipse file with your favourite editor ##
nano -w /usr/bin/eclipse
 
## Paste following content to file ##
#!/bin/sh
export ECLIPSE_HOME="/opt/eclipse"
 
$ECLIPSE_HOME/eclipse $*

7. Create Gnome desktop launcher

## Create following file, with our favourite editor ##
/usr/share/applications/eclipse.desktop
 
## Add following content to file and save ##
[Desktop Entry]
Encoding=UTF-8
Name=Eclipse
Comment=Eclipse SDK 3.6.1
Exec=eclipse
Icon=/opt/eclipse/icon.xpm
Terminal=false
Type=Application
Categories=GNOME;Application;Development;
StartupNotify=true

8. Start Eclipse 3.6.1

From command line use eclipse command
eclipse
From Desktop menu
Eclipse SDK 3.6.1 Launcher Gnome

9. Eclipse 3.6 screenshots, running (and starting) on Fedora 13 32-bit and CentOS 5.5 64-bit

Eclipse loading
Eclipse SDK 3.6 Loading on CentOS
Eclipse 3.6 running on Fedora 13 32-bit
Eclipse SDK 3.6 Running on Fedora 13
Eclipse 3.6 running on CentOS 5.5 64-bit
Eclipse SDK 3.6 Running on CentOS

Troubleshooting

If you get something like following errors:

Failed to load the JNI shared library /usr/java/jdk1.6.0_21/jre/bin/../lib/i386/client/libjvm.so
Or
/usr/java/jdk1.6.0_21/jre/bin/../lib/i386/client/libjvm.so: cannot enable executable stack as shared object requires: Permission denied
Then do following:
chcon -t execmem_exec_t '/opt/eclipse/eclipse'
and try again.

Install Sun/Oracle Java JDK/JRE 6 on Fedora 14/13, CentOS/RHEL 5.5/6

java-logoThis guide is updated/rewritten Jul 29, 2010 to use currently latest Sun/Oracle Java JDK and JRE 6 Update 22 and I added also separated 32-bit and 64-bit installation instructions.
By default, Fedora 14, Fedora 13, Fedora 12, CentOS 5.5 and Red Hat (RHEL) 5.5/6 Linux operating systems use the OpenJDK Java, which is a good choice for normal use and it works with almost all the Java programs normally. OpenJDK is also easy to install and maintain with YUM package management, but some cases, Sun/Oracle Java installation is necessary, for example, if some program have to compile with Sun/Oracle Java or a particular program does not work without Sun/Oracle Java.

Install Sun/Oracle Java JDK (Java Development Kit)/JRE (Java Runtime Environment) 6u22 on Fedora 14, Fedora 13, Fedora 12, CentOS 5.5, Red Hat (RHEL) 5.5 and Red Hat (RHEL) 6

1. Download Sun/Oracle Java JDK or JRE RPMs

Download Sun/Oracle Java JDK or JRE from here (current version is JDK 6 Update 22) http://www.oracle.com/technetwork/java/javase/downloads/index.html.
Note: Select rpm.bin package (example jdk-6u22-linux-i586-rpm.bin, jre-6u22-linux-i586-rpm.bin, jdk-6u22-linux-x64-rpm.bin or jre-6u22-linux-x64-rpm.bin).

2. Change to root user.

sudo -i
## OR ##
su -

3a. Run Sun/Oracle Java JDK binary

chmod +x /path/to/file/jdk-6u22-linux-*-rpm.bin
/path/to/binary/jdk-6u22-linux-*-rpm.bin
 
## OR ##
 
sh /path/to/binary/jdk-6u22-linux-*-rpm.bin
Note: Use full file name (without asterix) if you have both i586 and x64 versions downloaded.

3b. Run Sun/Oracle Java JRE binary

chmod +x /path/to/file/jre-6u22-linux-*-rpm.bin
/path/to/binary/jre-6u22-linux-*-rpm.bin
 
## OR ##
 
sh /path/to/binary/jre-6u22-linux-*-rpm.bin
Note: Use full file name (without asterix) if you have both i586 and x64 versions downloaded.

4a. Install Sun/Oracle JDK java, javaws, libjavaplugin.so (for Firefox/Mozilla) and javac with alternatives –install command

## java ##
alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_22/jre/bin/java 20000
## javaws (32-bit only) ##
alternatives --install /usr/bin/javaws javaws /usr/java/jdk1.6.0_22/jre/bin/javaws 20000
 
## Java Browser (Mozilla) Plugin 32-bit ##
alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so libjavaplugin.so /usr/java/jdk1.6.0_22/jre/lib/i386/libnpjp2.so 20000
 
## Java Browser (Mozilla) Plugin 64-bit ##
alternatives --install /usr/lib64/mozilla/plugins/libjavaplugin.so libjavaplugin.so.x86_64 /usr/java/jdk1.6.0_22/jre/lib/amd64/libnpjp2.so 20000
 
## Install javac only if you installed JDK (Java Development Kit) package ##
alternatives --install /usr/bin/javac javac /usr/java/jdk1.6.0_22/bin/javac 20000

4b. Install Sun/Oracle JRE java, javaws and libjavaplugin.so (for Firefox/Mozilla) with alternatives –install command

## java ##
alternatives --install /usr/bin/java java /usr/java/jre1.6.0_22/bin/java 20000
 
## javaws (32-bit only) ##
alternatives --install /usr/bin/javaws javaws /usr/java/jre1.6.0_22/bin/javaws 20000
 
## Java Browser (Mozilla) Plugin 32-bit ##
alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so libjavaplugin.so /usr/java/jre1.6.0_22/lib/i386/libnpjp2.so 20000
 
## Java Browser (Mozilla) Plugin 64-bit ##
alternatives --install /usr/lib64/mozilla/plugins/libjavaplugin.so libjavaplugin.so.x86_64 /usr/java/jre1.6.0_22/lib/amd64/libnpjp2.so 20000

5. Check current java, javac, javaws and libjavaplugin.so versions

java -version
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) Client VM (build 17.1-b03, mixed mode, sharing)
 
javac -version
javac 1.6.0_22
 
javaws
Java(TM) Web Start 1.6.0_22
[...]
Note: Check libjavaplugin.so with restarting Mozilla Firefox and writing about:plugins on address bar.
Check Sun Java Vrowser Plugin Installed on Firefox

6. Swap between OpenJDK and Sun/Oracle JDK versions

alternatives --config java   # or javac or javaws or libjavaplugin.so
There are 4 programs which provide 'java'.
 
  Selection    Command
-----------------------------------------------
   1           /usr/lib/jvm/jre-1.6.0-openjdk/bin/java
   2           /usr/lib/jvm/jre-1.5.0-gcj/bin/java
*  3           /usr/java/jdk1.6.0_18/jre/bin/java
 + 4           /usr/java/jdk1.6.0_22/jre/bin/java
 
Enter to keep the current selection[+], or type selection number:
Note: java with [+] is currently on use

Post-Installation Setup

Add JAVA_HOME environment variable to /etc/profile file or $HOME/.bash_profile file
## export JAVA_HOME
export JAVA_HOME="/usr/java/jdk1.6.0_22"

XAMPP for Linux (Installation)

Welcome to the Linux version of XAMPP
(on x86-compatible processors)
By the way: In the past this software was called LAMPP but to avoid misconceptions we renamed it to »XAMPP for Linux«. So if you are seeking for LAMPP you're on the right track. ;)
If you encounter any problems with XAMPP please feel free to get in touch with us. This will help us to improve XAMPP and make it more useful for everybody.

Jump-off point

Pictures of XAMPP for Linux
Installation in 4 Steps
Step 1: Download
Step 2: Installation
Step 3: Start
Step 4: Test
READ ME
A matter of security (A MUST READ!)
Advanced start and stop parameters
What is where?
Stopping XAMPP
Uninstall

* Pictures of XAMPP for Linux

As the old saying goes, a picture is worth a thousand words. Here you can take a look at some screen shots of a XAMPP installation.

Installation in 4 Steps

* Step 1: Download

Simply click on one of the links below. It's a good idea to get the latest version. :)
A complete list of downloads (older versions) is available at SourceForge.

A detailed overview over the changes and contents of all XAMPP releases is available in the RELEASE NOTES.
XAMPP for Linux 1.7.3a, 2010/1/10

Version

Size

Notice
XAMPP Linux 1.7.3a 64 MB Apache 2.2.14, MySQL 5.1.41, PHP 5.3.1 & PEAR + SQLite 2.8.17/3.6.16 + multibyte (mbstring) support, Perl 5.10.1, ProFTPD 1.3.2c, phpMyAdmin 3.2.4, OpenSSL 0.9.8l, GD 2.0.1, Freetype2 2.1.7, libjpeg 6b, libpng 1.2.12, gdbm 1.8.0, zlib 1.2.3, expat 1.2, Sablotron 1.0, libxml 2.7.6, Ming 0.4.2, Webalizer 2.21-02, pdf class 009e, ncurses 5.3, mod_perl 2.0.4, FreeTDS 0.63, gettext 0.17, IMAP C-Client 2007e, OpenLDAP (client) 2.3.11, mcrypt 2.5.7, mhash 0.8.18, eAccelerator 0.9.5.3, cURL 7.19.6, libxslt 1.1.26, libapreq 2.12, FPDF 1.6, XAMPP Control Panel 0.8, bzip 1.0.5, PBXT 1.0.09-rc, PBMS 0.5.08-alpha, ICU4C Library 4.2.1
MD5 checsum: 89c13779cf6f0925d5c1c400d31a1cc3
Upgrade 1.7.2 to 1.7.3a 53 MB Upgrade package. How to upgrade?
MD5 checksum: 51580b88cabace20394114016fba5b82
Upgrade 1.7.3 to 1.7.3a 0 MB Upgrade package. How to upgrade?.
MD5 checksum: 36d2cb29eed7510808faa9b74102fd1e
Development package 33 MB The development package contains all files you need if you want to compile other software packages for XAMPP by yourself and the Unix manual pages. Install this package like the normal XAMPP distribution:
tar xvfz xampp-linux-devel-1.7.3a.tar.gz -C /opt
MD5 checksum: 28bd139595be7fd307851680bebdacb4
Attention: If you download these files on a Windows system and you're running McAfee virus scanner you may get a false positive virus warning. This is a problem with McAfee and gzip-compressed files, it should be ignored.

* Step 2: Installation

After downloading simply type in the following commands:
  1. Go to a Linux shell and login as the system administrator root: su
  2. Extract the downloaded archive file to /opt: tar xvfz xampp-linux-1.7.3a.tar.gz -C /opt
    Warning: Please use only this command to install XAMPP. DON'T use any Microsoft Windows tools to extract the archive, it won't work.
    Warning 2: already installed XAMPP versions get overwritten by this command.
That's all. XAMPP is now installed below the /opt/lampp directory.

* Step 3: Start

To start XAMPP simply call this command: /opt/lampp/lampp start
You should now see something like this on your screen:
Starting XAMPP 1.7.3a...
LAMPP: Starting Apache...
LAMPP: Starting MySQL...
LAMPP started.

Ready. Apache and MySQL are running.
If you get any error messages please take a look at the Linux FAQ.

* Step 4: Test

OK, that was easy but how can you check that everything really works? Just type in the following URL at your favourite web browser:
http://localhost
Now you should see the start page of XAMPP containing some links to check the status of the installed software and some small programming examples.

The Instant Art example: A small PHP/GD program (since 0.9.6pre1 also a flashy PHP/Ming example, see screenshot). Thanks to Anke Arnold for her font »AnkeCalligraph«.

READ ME

* A matter of security (A MUST READ!)

As mentioned before, XAMPP is not meant for production use but only for developers in a development environment. The way XAMPP is configured is to be open as possible and allowing the developer anything he/she wants. For development environments this is great but in a production environment it could be fatal.
Here a list of missing security in XAMPP:

  1. The MySQL administrator (root) has no password.
  2. The MySQL daemon is accessible via network.
  3. ProFTPD uses the password "lampp" for user "nobody".
  4. PhpMyAdmin is accessible via network.
  5. Examples are accessible via network.
  6. MySQL and Apache running under the same user (nobody).
To fix most of the security weaknesses simply call the following command:
/opt/lampp/lampp security
It starts a small security check and makes your XAMPP installation quite secure. For example this protects the XAMPP demo pages by a username ('lampp') and password combination. See also our XAMPP for Linux FAQ.

* Advanced start and stop parameters

Until version 0.9.4 /opt/lampp/lampp could only start and stop XAMPP. Since version 0.9.5 it learned a lot of new things to do.
START AND STOP PARAMETERS
Parameter Description
start Starts XAMPP.
stop Stops XAMPP.
restart Stops and starts XAMPP.
startapache Starts only the Apache.
startssl Starts the Apache SSL support. This command activates the SSL support permanently, e.g. if you restarts XAMPP in the future SSL will stay activated.
startmysql Starts only the MySQL database.
startftp Starts the ProFTPD server. Via FTP you can upload files for your web server (user "nobody", password "lampp"). This command activates the ProFTPD permanently, e.g. if you restarts XAMPP in the future FTP will stay activated.
stopapache Stops the Apache.
stopssl Stops the Apache SSL support. This command deactivates the SSL support permanently, e.g. if you restarts XAMPP in the future SSL will stay deactivated.
stopmysql Stops the MySQL database.
stopftp Stops the ProFTPD server. This command deactivates the ProFTPD permanently, e.g. if you restarts XAMPP in the future FTP will stay deactivated.
security Starts a small security check programm.
For example: To start Apache with SSL support simply type in the following command (as root):
/opt/lampp/lampp startssl
You can also access your Apache server via SSL under https://localhost.

* What is where?

What is where? A big question of our existens, here are some answers! ;)
IMPORTANT FILES AND DIRECTORIES
File/Directory Purpose
/opt/lampp/bin/ The XAMPP commands home. /opt/lampp/bin/mysql calls for example the MySQL monitor.
/opt/lampp/htdocs/ The Apache DocumentRoot directory.
/opt/lampp/etc/httpd.conf The Apache configuration file.
/opt/lampp/etc/my.cnf The MySQL configuration file.
/opt/lampp/etc/php.ini The PHP configuration file.
/opt/lampp/etc/proftpd.conf The ProFTPD configuration file. (since 0.9.5)
/opt/lampp/phpmyadmin/config.inc.php The phpMyAdmin configuration file.

* Stopping XAMPP

To stop XAMPP simply call this command: /opt/lampp/lampp stop
You should now see:
Stopping LAMPP 1.7.3a...
LAMPP: Stopping Apache...
LAMPP: Stopping MySQL...
LAMPP stopped.

And XAMPP for Linux is stopped.

* Uninstall

To uninstall XAMPP just type in this command:
rm -rf /opt/lampp
The end.