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
Aside

Drupal as a CMS with multi site setup

I was lookking for a CMS solution for my web site “rvishwakarma.com” and also wanted another site “luhar.co.in” to be parked in case i had another idea that i wanted to put up in no time. I had to setup a local setup in order to develop these two sites and make it customizable using the power of Drupal.

The documentation at the Drupal site was extensive but still i wanted to cover as one crucial step was missing there regarding the settings.php file copy.

A Youtube link for a Single Site quickstart:

 

Multi-Site Setup Steps :

1. Install “xampp” as above or from the help (http://www.apachefriends.org/en/xampp-windows.html) at ‘C:\xampp‘ (and NOT at ‘C:\Program Files\xampp\‘ or similar!) by unzipping it there.

2. Check for ‘httpd.conf‘ file at ‘C:\xampp\apache\conf‘ and
change

# Virtual hosts
#Include "conf/extra/httpd-vhosts.conf"

to

# Virtual hosts
Include "conf/extra/httpd-vhosts.conf"

only, if the “#” was in that row!

3. Now open ‘httpd-vhosts.conf‘ from ‘C:\xampp\apache\conf\extra‘ and add these lines

<VirtualHost *:80>
 ServerAdmin rahul_37@yahoo.com
 DocumentRoot "C:/xampp/htdocs/drupal"
 ServerName rvishwakarma.localhost
 ServerAlias www.rvishwakarma.localhost
 ErrorLog "logs/rvishwakarma.localhost-error.log"
 CustomLog "logs/rvishwakarma.localhost-access.log" common
</VirtualHost>
<VirtualHost *:80>
 ServerAdmin rahul_37@yahoo.com
 DocumentRoot "C:/xampp/htdocs/drupal"
 ServerName luhar.localhost
 ServerAlias www.luhar.localhost
 ErrorLog "logs/luhar.localhost-error.log"
 CustomLog "logs/luhar.localhost-access.log" common
</VirtualHost>

4. Restart your web server.

5. Now open file ‘%windir%\system32\drivers\etc\hosts‘ and append these 4 lines at end of file

127.0.0.1 rvishwakarma.localhost
127.0.0.1 luhar.localhost
127.0.0.1 www.rvishwakarma.localhost
127.0.0.1 www.luhar.localhost

6. Now download the latest “Drupal 7” recommended release (https://drupal.org/project/drupal),
create a folder name “drupal” inside ‘C:\xampp\htdocs\
and put all content of this drupal release in this folder.

7. Create 2 databases for 2 drupal sites with name rvishwakarma and luhar

 PHP Admin:: http://127.0.0.1/phpmyadmin/

8. Create 2 folder name

a.) rvishwakarma.localhost
and
b.) luhar.localhost
inside of 'C:\xampp\htdocs\drupal\sites\'

9. Copy the file C:\xampp\htdocs\drupal\sites\default\default.settings.php into both the subdirectory you created in the previous step. Rename these new files to settings.php.

10.  Open the following URL and go through the standard settings

a.) http://rvishwakarma.localhost/
and
b.) http://luhar.localhost/
and install them as standard drupal installation process (http://drupal.org/documentation/install).

Now Drupal “multisite installation” is done, visit the above URL to open the web page.