Xampp installation on Ubuntu 14.04

For a 32-bit architecture follow these commands. . .

cd /tmp
wget bit.ly/1cmyrUo -O xampp-32bit.run
chmod 777 xampp-32bit.run
sudo ./xampp-32bit.run


For a 64-bit architecture, these. . .
cd /tmp
wget bit.ly/1cmyrUo -O xampp-64bit.run
chmod 777 xampp-64bit.run
sudo ./xampp-64bit.run

PostScript: Try these commands from the root. You can get into the root mode with sudo su command.


Assuming you already installed an Ubuntu 14.04 desktop edition, you can install the popular web stack by running this command :

From the root account :

# apt-get install apache2 php5 mysql-server libapache2-mod-php5 php5-mysql libapache2-mod-perl2 libapache-session-perl libapache2-authcookie-perl

Or from a sudoer user account :

$ sudo apt-get install apache2 php5 mysql-server libapache2-mod-php5 php5-mysql libapache2-mod-perl2 libapache-session-perl libapache2-authcookie-perl

Note that :

  • # is the symbol of the root command line prompt
  • $ is the symbol of the regular user command line prompt
  • you have not to copy this symbol to run the command, begin your command by apt-get ... or sudo ...

In addition, you could want to install PhpMyAdmin to administrate you MySql database from your web browser :

$ sudo apt-get install phpmyadmin

Then, you may have to create a symbolic link to access to PhpMyAdmin user interface from http://172.0.0.1/phpmyadmin or http://172.0.1.1/phpmyadmin or http://localhost/phpmyadmin (assuming you use the default /var/www folder as DocumentRoot in your apache configuration):

$ sudo ln -s /usr/share/phpmyadmin/ /var/www/phpmyadmin

After installation, the main configuration files for apache2 will be here :

  • /etc/apache2/apache2.conf
  • /etc/apache2/sites-available
  • /etc/apache2/mods-available
  • /etc/apache2/ports.conf

Php configuration file for Apache is there :

/etc/php5/apache2/php.ini

Enabling CGI-perl :

$ sudo a2enmod cgi

Enabling SSL :

$ sudo a2enmod ssl

Enabling URL rewriting module (often required for installing CMS or using MVC PHP frameworks) :

$ sudo a2enmod rewrite

When you change some configurations in /etc files, or enabling modules (a2enmod ...), you must reload or restart your Apache server :

$ sudo service apache2 reload

or $ sudo service apache2 restart

are aliases of

$ sudo /etc/init.d/apache2 reload

and

$ sudo /etc/init.d/apache2 restart

DigitalOcean explains very best way to install LAMP stack

https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-14-04

STEPS:

Install Apache

sudo apt-get update 
sudo apt-get install apache2

Install MySQL

sudo apt-get install mysql-server php5-mysql

need to tell MySQL to create its database directory structure where it will store its information

sudo mysql_install_db

Install PHP

sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt

In most cases, we'll want to modify the way that Apache serves files when a directory is requested. Currently, if a user requests a directory from the server, Apache will first look for a file called index.html. We want to tell our web server to prefer PHP files, so we'll make Apache look for an index.php file first.

To do this, type this command to open the dir.conf file in a text editor with root privileges:

sudo nano /etc/apache2/mods-enabled/dir.conf

It will look like this:

<IfModule mod_dir.c>
    DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
</IfModule>

We want to move the PHP index file highlighted above to the first position after the DirectoryIndex specification, like this:

<IfModule mod_dir.c>
    DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm
</IfModule>

When you are finished, save and close the file by pressing "CTRL-X". You'll have to confirm the save by typing "Y" and then hit "ENTER" to confirm the file save location.

After this, we need to restart the Apache web server in order for our changes to be recognized. You can do this by typing this:

sudo service apache2 restart

Install PHP Modules

apt-cache search php5-

Now you're done installing.

also find how to enable phpmyadmin:

https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-phpmyadmin-on-ubuntu-14-04