How To Install XAMPP Stack On Ubuntu 15.10

About XAMPP

XAMPP is a free, open source stack that 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),Apache, MySQL, PHP, and Perl.

In this handy tutorial, let us see how to install XAMPP stack on Ubuntu 15.10, and its previous versions such as 15.04, 14.04, and 13.10 etc.

Install XAMPP Stack On Ubuntu 15.10 server

Download the latest version from the official download page. As of writing this article, the latest version was 5.6.14.

After downloading the XAMPP package, make it executable as shown below.

sudo chmod +x xampp-linux-x64-5.6.14-0-installer.run

Now, install XAMPP stack as shown below.

sudo ./xampp-linux-x64-5.6.14-0-installer.run

You’ll be asked to answer a couple questions. Here. I will go with defaults.

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 5.6.14-0...
XAMPP: Starting Apache...already running.
XAMPP: Starting MySQL...ok.
XAMPP: Starting ProFTPD...ok.

Like wise, you can stop the service using command:

sudo /opt/lampp/lampp stop

Sample output:

Stopping XAMPP for Linux 5.6.14-0...
XAMPP: Stopping Apache...ok.
XAMPP: Stopping MySQL...ok.
XAMPP: Stopping ProFTPD...ok.

Now, you can launch the XAMPP dashboard by navigating to http://localhost/ or http://ip-address/ from your web browser.

Install XAMPP in Ubuntu 15.10 Desktop

Download the XAMPP stack from the official download page.

After downloading the XAMPP package, make it executable as shown below.

sudo chmod +x xampp-linux-x64-5.6.14-0-installer.run

Run the following command to start XAMPP stack installation.

sudo ./xampp-linux-x64-5.6.14-0-installer.run

Click Next.

Setup_001

Click Next.

Setup_002

Click Next.

Setup_003

Click Next.

Setup_004

Click Next.

Setup_008

XAMPP installation will start now.

Setup_009

Finally, click Finish.

Setup_010

This is how XAMPP welcome window looks like.

XAMPP 5.6.14-0_011

You can verify the list of currently running services by navigating to the Manage Servers tab next to the XAMPP welcome tab.

XAMPP 5.6.14-0_012

Now, you can launch the XAMPP dashboard either by clicking on the Go to application from XAMPP Welcome tab, Or open up your browser and navigate to http://localhost/ or http://ip-address/.

Test XAMPP

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

Here it is how my XAMPP dashboard looks like.

Welcome to XAMPP dashboard

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, click on the “phpMyAdmin” link on the top right corner of the XAMPP dashboard.

You may encounter with the following error. This is because, the XAMPP/phpmyadmin page will not be accessible from the remote clients using IP address.

Access forbidden! - Google Chrome_004

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 out the above line and add one more line “Require all granted” as shown below.

[...]
#Require local
Require all granted
[...]

For more details, refer the XAMPP forum.

Restart XAMPP service.

sudo /opt/lampp/lampp restart

Then, refresh the webpage. phpMyAdmin page will open now.

This is how my phpMyAdmin dashboard looks.

192.168.1.103 - localhost | phpMyAdmin 4.5.0.2 - Google Chrome_002

Likewise, you can view the phpinfo() page. The phpinfo() will also be accessed from the left pane of the XAMPP Dashboard.

phpinfo() - Google Chrome_003

Security Issues of XAMPP

XAMPP is not meant to be used in production environment. It’s only for development purpose. Don’t attempt to use XAMPP in any production environments.

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): 
/opt/lampp/share/xampp/checkapache: line 41: /opt/lampp/htdocs/xampp/.htaccess: No such file or directory
cp: cannot stat ‘/opt/lampp/htdocs/xampp/.htaccess’: No such file or directory
cp: cannot stat ‘/opt/lampp/htdocs/xampp/.htaccess’: No such file or directory
chmod: cannot access ‘/opt/lampp/htdocs/xampp/.htaccess’: No such file or directory
chmod: cannot access ‘/opt/lampp/htdocs/webalizer/.htaccess’: No such file or directory
chmod: cannot access ‘/opt/lampp/phpmyadmin/.htaccess’: No such file or directory
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: The MySQL/phpMyAdmin user pma has no password set!!! 
XAMPP: Do you want to set a password? [yes] 
XAMPP: Password: 
XAMPP: Password (again): 
XAMPP: Setting new MySQL pma password.
XAMPP: Setting phpMyAdmin's pma password to the new one.
XAMPP: MySQL has no root passwort set!!! 
XAMPP: Do you want to set a password? [yes] 
XAMPP: Write the password somewhere down to make sure you won't forget it!!! 
XAMPP: Password: 
XAMPP: Password (again): 
XAMPP: Setting new MySQL root password.
XAMPP: Change phpMyAdmin's authentication method.
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 secured.

Cheers!

Reference Links:

  • DatoYoro

    Hi Unixmen. That’s great help! Thank you!