Linux menu

Wednesday, September 17, 2014

How to install XAMPP In Linux

In this tutorial we will learn,how to install XAMPP in CentOS/RHEL 6.5.We will install XAMPP version 1.8.3. XAMPP is a open source cross platform software stack package mainly used for web server solution. XAMPP is available for Windows,MAC OSX,Solaris and Linux(WAMP, MAMP, SAMP, LAMP).
XAMPP stands for –
X = Cross Platform (Windows,MAC OSX,Solaris and Linux)
A = Apache
M = MySQL
P = PHP
P = Perl
NOTE: SELINUX is in Enforcing mode

Install XAMPP on CentOS/RHEL

Follow the given below steps to install XAMPP on CentOS/RHEL 6.5
Step 1: Download the XAMPP
We suggest you to download latest stable XAMPP package for Linux.You can download the XAMPP from this URL.
We have downloaded the XAMPP package version 1.8.3-3
You can download the XAMPP package from sourceforge.net
Step 2: Transfer the file to Server
After downloading the XAMPP package into your system,transfer the file by using scp command
Alternatively, directly in Server terminal,you can use wget command to download the package if you have downloading URL address.
Example:
Step 3 : Give executable permission to downloaded XAMPP script
Give executable permission to downloaded XAMPP script.In our case, we have downloaded the file xampp-linux-x64-1.8.3-3-installer.run (The file name may be different in your case depends upon latest package and architecture of Operating system)
#chmod +x /xampp-linux-x64-1.8.3-3-installer.run
Step 4: Run XAMPP installer script
Run the XAMPP installer script.While script is running,it will ask some question.Give the answer as per your requirement. The script will install the XAMPP stack in /opt/lamppdirectory. You can change this path at the time of installation.

Step 4: Allow ALL network to access XAMPP Server
I did troubleshooting after installing XAMPP,hence directly writing solution in this step.You can read about the Error and its solution from this post.
Edit the last section of file called httpd-xampp.conf.Add new line Require all grantedand comment the line Require local by using # sign
Step 5 : Restart all services by using lampp script
Restart all the services by using below given command
Below given is the reference from my system
Step 6: Now open the XAMPP in Web browser
Now open the web browser and type the URL or ip-address in address bar
The XAMPP dashboard will be open
Install XAMPP
Step 7: Open phpmyadmin
To open phpmyadmin of XAMPP,simply type URL of server with /phpmyadmin in address bar
Example : Replace 192.168.56.102 with your XAMPP server ip address(run ifconfig command to get your server ip)
http://192.168.56.102/phpmyadmin
xampp phpmyadmin

Other Way:-



Steps to Install Xampp/Lampp on CENTOS 6.x / RHEL / FEDORA





Steps to Install Xampp/Lampp on CENTOS 6.x


1. Update your CentOS

                 # yum update
2. Install glibc libraries required for XAMPP.
#yum –y install glibc.i686
3. Download the xampp 1.8.1

                 # wget http://www.apachefriends.org/download.php?xampp-linux-1.8.1.tar.gz

4. Extract the downloaded archive file to /opt:

                # tar xvfz xampp-linux-1.8.1.tar.gz -C /opt

5. XAMPP was designed to run on 32 bit operating systems. The start up script will prevent xampp from starting up if you are running on a 64 bit system which isn’t necessary since you installed 32 bit compatibility libraries in step 1. To get around this restriction, open /opt/lampp/lampp in an editor and comment out the following lines.

# XAMPP is currently 32 bit only
#case `uname -m` in
# *_64)
#   if /opt/lampp/bin/php -v > /dev/null 2>&1
#   then
#      :
#   else
#      $de && echo "XAMPP gibt es zur Zeit nur als 32-Bit Applikation.
#      Bitte verwende eine 32-Bit Kompatibilitaetsbibliothek fuer Dein
#      System."
#
#      $de || echo "XAMPP is currently only availably as 32 bit
#      application. Please use a 32 bit compatibility library for
#      your system."
#
#   exit
#   fi
#   ;;
#esac
5. Now start lampp

                # /opt/lampp/lampp start

6. Now type http://localhost in browser and hit enter. Now we will see "XAMPP" welcome page.

7.  For accessing website from outside/external network we have set port forwarding to our local server IP. For example, our Server (XAMPP) IP is listening on Port no.92. Now we have to edit our Xampp httpd.conf file configuration.

Go to line no.52 of /opt/lampp/etc/httpd.conf and change "Listen 80" to "Listen 92".

8. For opening port 92 in firewall we have to type the following commands:
                /* Open or create  file /etc/sysconfig/iptables */
                # vi /etc/sysconfig/iptables
                /* Append firewall rule  in iptable as follows */
                -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 92 -j ACCEPT
                /* Save & close the file. Restart iptables */
                # /etc/init.d/iptables restart

Now we can access XAMPP from remote PC's.

9. Edit /opt/lampp/etc/extra/httpd-xampp.conf and adding Require all granted line at bottom of  block<Directory "/opt/lampp/phpmyadmin"> to have the following code:
<Directory "/opt/lampp/phpmyadmin">
  AllowOverride AuthConfig Limit
  Order allow,deny
  Allow from all
  Require all granted
</Directory>

And also edit “New XAMPP security concept” <LocationMatch> block and change “Deny from all” to “Allow from all”   


10. Now we will add password to the /xampp/,Phpmyadmin,mysql and FTP for security purpose.

                # /opt/lampp/lampp security


11. Now we will move our website pages under “/opt/lampp/htdocs” directory and edit “/opt/lampp/htdocs/index.php” page.
Go to line no. 8 of /opt/lamp/htdocs/index.php and change the following
 header (‘Location:  ‘.$uri.’/YOUR WEBSITE FOLDER LOCATION/’);


12.  Add the following line in “/opt/lampp/etc/my.cnf” file for increasing maximum number of connection pool to MySQL server.  Also change the “user” parameter of [mysqld] from “nobody” to “root”.
               
             max_connections = 1000


13. Restart XAMPP/LAMPP server
                # /opt/lampp/lampp restart

No comments: