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

Express setup for worlds most advanced PostgreSQL 9.3 server on a CentOS-6.5 x64 instance

Setup a PostgreSQL 9.3 database on CentOS 6.5 Server

postgresql

Worlds most advanced database is a killer punchline though.

Assuming you are a root user and looking for just the command that will get you through the installation.
Pre-Requisites
  - CentOS 6.5 x64 ISO minimal installation 
    Download Link: https://www.centos.org/download 
  - I prefer to install most of the dev dependencies beforehand via 
    $ sudo yum groupinstall 'Development Tools'

1. Create a User
   $ adduser postgres
   $ passwd postgres

2. Add this user to the sudoers list
   $ vim /etc/sudoers
   postgres ALL=(ALL)    ALL
 
3. Get the postgres repo for installation
   $ yum localinstall http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-1.noarch.rpm
     yum localinstall https://yum.postgresql.org/9.3/redhat/rhel-7-x86_64/pgdg-redhat93-9.3-3.noarch.rpm
   $ yum list postgres*
   $ yum install postgresql93-server

4. Data folder is at the location
   $ ls /var/lib/pgsql/9.3/
  
5. Make this run as a service 
   $ service postgresql-9.3 initdb
     OR
     /usr/pgsql-9.3/bin/pg_ctl init -D /var/lib/pgsql/9.3/data/ -o --pwprompt -U postgres
     OR
     /usr/pgsql-9.3/bin/initdb --pgdata=/var/lib/pgsql/9.3/data/ -W -U postgres
   $ chkconfig postgresql-9.3 on
  
6. Control commands for the server
   $ service postgresql-9.3 start
     /usr/pgsql-9.3/bin/pg_ctl -D /var/lib/pgsql/9.3/data -l logfile start
   $ service postgresql-9.3 stop
     /usr/pgsql-9.3/bin/pg_ctl -D /var/lib/pgsql/9.3/data -l logfile stop
   $ service postgresql-9.3 restart
  
7. Change to user postgres for accessing the database through psql client
   $ su postgres
   $ psql

8. Modify the IPv4 access to this machine,
   by editing "/var/lib/pgsql/9.3/data/pg_hba.conf"

   host    all             all             127.0.0.1/32            md5
   host    all             all             192.168.1.0/24          md5
   host    all             all             0.0.0.0/0               ident

9. Modify the service host to listen for all external clients
   by editing "/var/lib/pgsql/9.3/data/postgresql.conf"

   listen_addresses = '*'

10. Update the iptables policy for database server access
   $ vim /etc/sysconfig/iptables
     -A INPUT -m state --state NEW -m tcp -p tcp --dport 5432 -j ACCEPT
   $ service iptables restart
   $ service iptables restart 
   
   Diagnostics for port forwarding. The DB server is unreachable hence switching the firewall OFF
   $ netstat -nlp | grep 5432
   $ sudo service iptables save
   $ sudo service iptables stop
   $ chkconfig iptables off

11. Update the password of the default user postgres. 
   This is done by logging in via the localhost psql client as above via default postgres user. 
   postgres# GRANT ALL privileges ON database postgres TO postgres; 
   postgres# ALTER USER postgres WITH password 'postgres'; 

   This will allow password based authentication via user postgres. 
   Verification can be done by attempting access as below: 
   $ psql -h 127.0.0.1 -U postgres -d postgres

Direct Reference : https://wiki.postgresql.org/wiki/YUM_Installation

Universal Database Manager: http://dbeaver.jkiss.org

In case the YUM repository is not set properly use the relevant EPEL repo 

## RHEL/CentOS 7 64-Bit ##
# wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm
# rpm -ivh epel-release-7-5.noarch.rpm
## RHEL/CentOS 6 64-Bit ##
# wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm

 

_______________________________________________________________

 

A quick way to have a portable version running on windows locally is mentioned below,

Donwload: http://www.enterprisedb.com/products-services-training/pgbindownload

Extract the archive into a folder at “C:/Dev/pgsql”

Init: "C:/Dev/pgsql/bin\pg_ctl" -D  "C:/Dev/pgsql/data" initdb
Start: "C:/Dev/pgsql/bin\pg_ctl" -D "C:/Dev/pgsql/data" -l logfile start
Stop: "C:/Dev/pgsql/bin\pg_ctl" -D "C:/Dev/pgsql/data" -l logfile stop
Connect: "C:/Dev/pgsql/bin\psql" -U postgres

You can initially connect to database postgres, and later use the following to have a new user created with privilege on a db

CREATE USER postgres WITH PASSWORD 'postgres';
CREATE DATABASE sample;
GRANT ALL PRIVILEGES ON DATABASE "sample" to postgres;