Want to setup your own XAMPP installation in a local development VM. Here are the simple steps to do so

Setup XAMPP on Linux workstation

I did this on a Fedora 21 workstation version from (https://getfedora.org/en/workstation/)

Installation is something you can take care of in a VirtualBox environment by providing the right configuration and network access to the instance.

Install XAMPP

   Download : www.sourceforge.net/projects/xampp
   Execute the downloaded binary after making it executable
      sudo ./xampp-linux-x64-5.5.19-0-installer.run
      sudo ln -s /opt/lampp/lampp /etc/init.d/lampp
      sudo chkconfig --levels 235 lampp on
      sudo service lampp start

Install other basic pre-requisites on the instance 

Install a test editor
sudo yum install vim
 
Setup Firewall access
http://docs.fedoraproject.org/en-US/Fedora/19/html/Security_Guide/sec-Disabling_firewalld.html

Finally stop the service
systemctl stop firewalld
systemctl stop iptables

Setup SSH access
http://linuxconfig.org/how-to-install-start-and-connect-to-ssh-server-on-fedora-linux

Make it a service daemon by using the following
chkconfig --level 2345 sshd on

Configure Apache HTTPD for access

Edit the configuration file for apache xampp 
vim /opt/lampp/etc/extra/httpd-xampp.conf
   Add the following in the New security concept error
   <LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
     Order deny,allow
     Deny from all
     Allow from ::1 127.0.0.0/8
     Allow from all
     ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
   </LocationMatch>
Verify access at http://192.168.56.102/xampp/index.php

Configure mysql for access

Edit the mysql xampp configuration file
vim /opt/lampp/etc/my.cnf
 
Add "bind-address=0.0.0.0" in the [mysqld] configuration

Also add the user access privileges:
 CREATE USER 'root'@'%';GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;CREATE DATABASE IF NOT EXISTS `root`;GRANT ALL PRIVILEGES ON `root`.* TO 'root'@'%';GRANT ALL PRIVILEGES ON `root\_%`.* TO 'root'@'%';

I had a requirement of installing PostgreSQL as well so here is another detail around that.

Install Potgresql (https://wiki.postgresql.org/wiki/YUM_Installation)
  sudo yum install postgresql-server
  sudo service postgresql initdb
  sudo service postgresql start
  su postgres
  psql

Exhaustive detail is documented in my post as well 
Advertisements

3 thoughts on “Want to setup your own XAMPP installation in a local development VM. Here are the simple steps to do so

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