Home > Web development > How to install xampp/lampp on centos (linux)

How to install xampp/lampp on centos (linux)

How to install xampp/lampp on centos (linux)

The installation procedure here is based on CentOS 6.x workstation default installation. Follow these steps
1. Log in linux terminal

2. Change user to root. Write below command and press enter and enter root user password.


3. The default installation of CentOS lacks some of the libraries that XAMPP needs to run, including 32 bit compatibility libraries.
To get them you su to root then use this yum command.

#yum -y install glibc* libstd* ld-linux.so.2

4. Download and install the latest verions from the XAMPP, from the XAMPP download page. Upload this file to server /opt/ directory.

5. Unpack tar file

#tar zxvf xampp-linux-1.8.1.tar.gz /opt/

6. Change the ownership of all the xampp files to be nobody:root.

#chown nobody:root /opt/lampp/ -R

7. 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
# ;;

8. Open /opt/lampp/etc/etc/extra/httpd-xampp.conf in an editor. Replace the “Deny from all” statement with “Require all grant” in the stanza. You can also comment out the “Allow from…” line if you don’t want to accept connections from any external system.

Order deny, allow
# Deny from all
Require all granted
# Allow from ::1 \
# fc00::/7
# fe80::/10
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var

9. Start up xampp
#/opt/lampp/lampp start

10. To fix most of the security weaknesses in xampp simply call the following command

#/opt/lampp/lampp security

It will ask you to change password. Set all pasword.

11. Open http://localhost in a browser. You should a get a browser window with the XAMPP for Linux startup screen.

12. Open /opt/lampp/lampp/phpmyadmin/config.inc.php in your editor of choice

13. Change the authentication type as follows:

$cfg[‘Servers’][$i][‘auth_type’] = ‘cookie’

14. Add the following lines in the config.inc.php file.

$cfg[‘Servers’][$i][‘table_uiprefs’] = ‘pma_table_uiprefs’;
$cfg[‘Servers’][$i][‘recent’] = ‘pma_recent’;

15. Close your browser then restart Apache and MySQL in the XAMPP Control Panel.

#/opt/lampp/lampp restart

17. At this point most of the setup work for XAMPP is done. However, if you plan to use phpyMyAdmin you’ll have to do a little further configuration to get it to work properly. XAMPP does not create all the tables that phpmyadmin needs so you have to do this with an SQL script that is enclosed with the package. To do this click on the Import tab in phpmyadmin. Choose the create_tables.sql script in /opt/lampp/lampp/phpmyadmin/examples directory and press go button.

18. If website is not open. Then check port 80 on centOs. dport port 80 by following command.

# sudo iptables -I INPUT -p tcp –dport 80 -j ACCEPT
# sudo service iptables save

19. For ftp dport 21 port

# sudo iptables -I INPUT -p tcp –dport 80 -j ACCEPT
# sudo service iptables save

20. [optional] Block brute force attack. Please read this http://kvz.io/blog/2007/07/28/block-brute-force-attacks-with-iptables/

Follow me on facebook

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: