Install XAMPP Stack On Ubuntu 14.04

by
Share this Article: Facebook215Google+3Twitter17LinkedIn1Reddit1StumbleUpon1

XAMPP is a free, open source Apache distribution for GNU/ Linux, Windows, and Mac operating systems. It contains Apache web server, MySQL database, PHP, and Perl. The main goal of XAMPP is to build an easy to install Apache environment for developers. Unlike LAMP, and LEMP stacks, It makes the developers so easy to have all packages installed at once in a couple of minutes. XAMMP is acronym of X(Cross platform), MySQL, PHP, and Perl.

In this handy tutorial, let us setup XAMPP stack on a Ubuntu 14.04 LTS minimal server.

Install XAMPP

Download the latest version from the official download page. At the time writing this article, the latest version was 1.8.3. After downloading the XAMPP package, make it executable as shown below.

sudo chmod +x xampp-linux-1.8.3-4-installer.run

Now, install XAMPP stack as shown below.

sudo ./xampp-linux-1.8.3-4-installer.run

You’ll be asked a couple questions. Press Y to accept the defaults.

----------------------------------------------------------------------------
Welcome to the XAMPP Setup Wizard.

----------------------------------------------------------------------------
Select the components you want to install; clear the components you do not want 
to install. Click Next when you are ready to continue.

XAMPP Core Files : Y (Cannot be edited)

XAMPP Developer Files [Y/n] :y

Is the selection above correct? [Y/n]: y

----------------------------------------------------------------------------
Installation Directory

XAMPP will be installed to /opt/lampp
Press [Enter] to continue :

----------------------------------------------------------------------------
Setup is now ready to begin installing XAMPP on your computer.

Do you want to continue? [Y/n]: y

----------------------------------------------------------------------------
Please wait while Setup installs XAMPP on your computer.

 Installing
 0% ______________ 50% ______________ 100%
 #########################################

----------------------------------------------------------------------------
Setup has finished installing XAMPP on your computer.

Starting/Stopping XAMPP Server

XAMPP will be installed in /opt/lampp directory. After installing XAMPP, you can start it using the following command.

sudo /opt/lampp/lampp start

Sample output:

Starting XAMPP for Linux 1.8.3-4...
XAMPP: Starting Apache...already running.
XAMPP: Starting MySQL...ok.
XAMPP: Starting ProFTPD...ok.

Like wise, you can stop the service as shown below.

sudo /opt/lampp/lampp stop

Sample output:

Stopping XAMPP for Linux 1.8.3-4...
XAMPP: Stopping Apache...ok.
XAMPP: Stopping MySQL...ok.
XAMPP: Stopping ProFTPD...ok.

Test XAMPP

To check if everything is OK, open up your web browser, and navigate to http://ip-address/xampp.

You may get the following error. This is because, the XAMPP test page is not accessible from the remote clients.

Access forbidden! - Mozilla Firefox_005

To resolve this error, edit file /opt/lampp/etc/extra/httpd-xampp.conf,

sudo nano /opt/lampp/etc/extra/httpd-xampp.conf

Find the following line:

[...]
Require local
[...]

And, comment it out:

[...]
#Require local
[...]

For more details, refer the XAMPP forum.

Restart XAMPP service.

sudo /opt/lampp/lampp restart

Now, you’ll be able to access the XAMPP test page.

XAMPP for Linux 1.8.3-4 - Mozilla Firefox_006

Access phpMyAdmin

phpMyAdmin is a graphical management tool for MySQL. Using this tool, you can create/delete/modify mysql databases graphically via a web browser.

To access phpMyAdmin, navigate to http://ip-address/phpmyadmin.

192.168.1.250 - localhost | phpMyAdmin 4.1.12 - Mozilla Firefox_007

Viewing Statistics of the XAMPP server

XAMPP comes with pre-installed webalizer application which is a fast, free web server log file analysis program. It displays the web server usage reports in HTML format with a web browser. 

To access webalizer, go to URL: http://ip-address/webalizer.

Usage Statistics for server - Summary by Month - Mozilla Firefox_008

Security Issues of XAMPP

Don’t attempt to use XAMPP in production environments. It is not meant for production use, but only for development purpose. The way XAMPP is configured is to be open as possible to allow the developers anything they want. For development environments this is great but in a production environment, it could be fatal.

Here a list of missing security in XAMPP:

  • The MySQL administrator (root) has no password.
  • The MySQL daemon is accessible via network.
  • ProFTPD uses the password “lampp” for user “daemon”.
  • PhpMyAdmin is accessible via network.
  • Examples are accessible via network.

To fix the above security holes, enter the following command:

sudo /opt/lampp/lampp security

You’ll be asked a couple of questions to secure the XAMPP installation. Answer the questions accordingly.

XAMPP:  Quick security check...
XAMPP:  Your XAMPP pages are NOT secured by a password. 
XAMPP: Do you want to set a password? [yes] 
XAMPP: Password: 
XAMPP: Password (again): 
XAMPP:  Password protection active. Please use 'xampp' as user name!
XAMPP:  MySQL is accessable via network. 
XAMPP: Normaly that's not recommended. Do you want me to turn it off? [yes] 
XAMPP:  Turned off.
XAMPP: Stopping MySQL...ok.
XAMPP: Starting MySQL...ok.
XAMPP:  MySQL has to run before I can check the security.
XAMPP:  MySQL has to run before I can check the security.
XAMPP:  MySQL has a root passwort set. Fine! :)
XAMPP:  The FTP password for user 'daemon' is still set to 'xampp'. 
XAMPP: Do you want to change the password? [yes] 
XAMPP: Password: 
XAMPP: Password (again): 
XAMPP: Reload ProFTPD...ok.
XAMPP:  Done.

That’s it. Now your XAMPP server is bit secure than before.

Cheers!

Reference Links:

For questions please refer to our Q/A forum at : http://ask.unixmen.com/

Share this Article: Facebook215Google+3Twitter17LinkedIn1Reddit1StumbleUpon1