Search This Blog

Tuesday, April 16, 2013

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:

Post a Comment