banner
Previous Page
PCLinuxOS Magazine
PCLinuxOS
Article List
Disclaimer
Next Page

Installing A Web Server: XAMPP vs task-lamp

by YouCanToo

I have noticed lately all the talk about using XAMPP to install a web server on your local computer. This has me wondering why one would choose to go outside the normal repository to install XAMPP when we have a program that will do most the same things with task-lamp. Not to mention that task-lamp is in the Synaptic Repository.

Now for the warnings.... It is recommended not to install programs from outside the official PCLinuxOS repositories. This can cause problems with your machine. You could end up not being able to get support from the forum when you're in need of support the most!

To be fair in comparing XAMPP and task-lamp, I will install them on their own hard drives.

The first thing I will do is start out by comparing the software that will be installed by both XAMPP and task-lamp.

XAMPP				Synaptic task-lamp

Apache 2.4.4			Apache 2.2.24-1 installed by task-lamp
MySQL 5.5.32			MySQL 5.1.55-2
PHP 5.4.19			PHP 5.3.25-1
PEAR				PEAR not installed
Webmin - not installed		Webmin 1.650-1 - not installed **
Python - not installed		mod_Python 3.3.1-5 installed by task-lamp
SQLite 2.8.17/3.7.17		SQLite 3.717-1 - installed by task-lamp
multibyte (mbstring) Support	mbstring 5.3.25-1 - installed by task-lamp
Perl 5.16.3			Perl 5.10.1
ProFTPD 1.3.4c			ProFTPD 1.3.4d - not installed **
phpMyAdmin 4.0.4		phpmyadmin 4.0.6-1 - installed by task-lamp
OpenSSL 1.0.1e			OpenSSL 1.0.1d, 1.0.1e and 1.0.1j
GD 2.0.35			GD 2.0.35-5 - installed by task-lamp
Freetype2 2.4.8			Freetype2 2-2.0
libjpeg 8d			libjpeg 6b

** Can be installed using Synaptic


XAMPP				task-lamp

libpng 1.5.9			libpng 3.5.0
gdbm 1.8.3			gdbm 3.0.0
zlib 1.2.3			zlib - 1.2.8-2
expat 2.0.1			expat 1.6.0
Sablotron 1.0.3			** Developer support has been dropped **
libxml 2.8.0			libxml 2.7.8
Ming 0.4.5			Ming 0.4.3-2 - not installed **
Webalizer 2.23-05		replaced by awffull 3.5.1-5 - not installed **
pdf class 0.11.7		pdf class - not installed
ncurses 5.9			ncurses 5.9-1
mod_perl 2.0.8			mod_perl 2.0.5-1 
FreeTDS 0.91			FreeTDS 0.82-1 - not installed **
gettext 0.18.1.1		gettext 0.18.2
IMAP C-Client 2007e		IMAP 2004g-4 - installed by task-lamp
OpenLDAP (client) 2.4.21	OpenLADP 2.4.33-1
mcrypt 2.5.8			php-mcrypt 5.325-1 - installed by task-lamp
mhash 0.9.9.9			mhash 2.0.1 
eAccelerator 0.9.6.1		eAccelerator0.9.6.1-1 - installed by task-lamp
cURL 7.30.0			cURL 4.3.0
libxslt 1.1.28			libxslt 1.1.26
libapreq 2.12			libapreq - not installed
FPDF 1.7			libpdflib-lite 7.0.5-3 - not installed **
bzip 1.0.6			bzip2 1.0.6
ICU4C Library 4.8.1		ICU4C data Library 51.2-1
APR (1.4.6)			APR 1.4.1-1 - not installed **
APR-utils (1.5.1)		APR-utils 1.4.1-1 - not installed **

** Can be installed using Synaptic

I installed task-lamp to begin with.


Just what is task-lamp you ask ?

According to Synaptic it is a Metapackage for the Linux, Apache, MySQL, Proftp, PHP and Perl serveX.

This package is a meta-package, meaning that its purpose is to contain dependencies for running LAMP-server, allowing easy installation of a comprehensive LAMP testing/development setup. For a production server, you may prefer to install a subset of the dependencies.


What does LAMP mean?

That depends on just who you ask, but one thing we can say for sure is it stands for

L - Linux it runs on our favorite operating System.
A - Apache, the workhorse of all web servers.
M - MySQL database
P - Perl and PHP -- some even say Python.

The first thing to do is open the Synaptic package manager, refresh it and then check task-lamp for installation. It may take you sometime to install task-lamp with its dependencies.

After installing task-lamp, I opened a console window as root and started the two major services.

apache - mysqld, using the following commands:

service httpd start
service mysqld start

You should see something like this after entering each command.




Now opening my favorite web browser I entered the following URL: http://localhost

Yes, my web server is alive and answering http requests.




The next thing I want to do is check that phpmyadmin is working, and that the MySQL database is accessible. So browse to http://localhost/phpmyadmin.

The normal password for phpmyadmin is:

username: root
password: blank

What's this?




Now what are we going to do? We have two options at this point. The first is opening an editor as root and changing the /etc/my.cnf file, or doing the changes via the command line. I am going to opt out for changing the /etc/my.cnf file. I am going to be using the nano editor.

In the console window as root I type in the following command

nano /etc/my.cnf

This magically opens the the my.cnf file. All I just have to find the variable called “AllowNoPassword” . The Ctrl + w key lets me search. I enter AllowNoPassword and press return.






Now we want to change the highlighted line to read like this

$cfg['Servers'][$i]['AllowNoPassword'] = true;

We want to change the variable from “false” to “true”. Now we need to save the file so we press the Ctrl + x key and we are asked if we want to save the modified buffer. Press Y. Now nano will display the name of the file to write to, just press the Enter key. Nano will now save your file and close. While we are at the console wind we want to make sure that php re-reads its configuration file. Enter the following command:

service httpd restart

You should see something like this:

[root@localhost phpmyadmin]# service httpd restart
Shutting down httpd:             [ OK ]
Starting httpd:                  [ OK ]
[root@localhost phpmyadmin]#

Now lets go back to our web browser and try accessing phpmyadmin again: http://localhost/phpmyadmin.




Enter root as the username and leave the password box empty and then press go. If all works as planned we should see something like this.




If you made it this far, pat yourself on the back. We now have an operational web server - mysql database server - with phpmyadmin.

Lets make sure that httpd (apache) and the MySQL database starts each time you turn on your computer.

Open a console window as root, and enter the following commands:

chkconfig mysqld on
chkconfig httpd on

You will see something like the following images. Don't be alarmed by the warnings that will be displayed.






Now every time that you boot your computer both the httpd service (web server) and your MySQL database will be started. If you find you need or want a ftp server, all you have to do is open Synaptic and choose which one you want to use. The major ones are pure-ftpd - vsftpd and pro-ftpd. I have written recent articles in the PCLinuxOS Magazine about installing and configuring each of these ftp servers.

I do suggest that no matter which route you go to install your web server be it XAMMP or task-lamp that you consider installing webmin to administrate your new web server. If you use webmin with XAMMP you will have to change all the configuration paths for each module in webmin to work, since XAMPP stores its files and configurations in non standard places.

NOTE: running your database without a root password is very, very insecure. Before doing anything else you should add a password to your MySQL database. It only takes a few moments of your time and will save you a lot of headaches down the road. NOTE: in the time it took you to read this NOTICE you could have already changed your database password. I can not state this enough, PLEASE ADD A PASSWORD to your database.


Configuration and log files paths

web server root directory /var/www/html
web server configuration /etc/httpd/conf/httpd.conf
mySQL configuration /etc/my.cnf
php configuration /etc/php.ini
phpMyAdmin configuration /etc/phpmyadmin/config.inc.php
web server log files /var/log/httpd

OK, so now, let's have a look at XAMPP

What is XAMPP ?

X - means that the package can run under anyone of the following operating systems.
  • OS X
  • Windows
  • Solaris
  • Linux
A - stands for Apache, Our workhorse web server.
M - stand for the MySQL database
p - stands for perl
P - stands for PHP

You can download the latest version of XAMPP from the apachefriends website. Once you have downloaded and saved XAMPP file it is time to run and install it. I have saved the XAMPP file to my ~/download directory.

I will open a console window as the root user and then change into my Downloads folder. Since this is a installer script we need to give it permission to execute (run). In the console window as root enter the following command:

chmod 755 xampp-linux-1.8.2-2-installer.run

Now we just need to execute the file (run it). Enter the command:

./xampp-linux-1.8.2-2-installer.run

That's it. The program is now going to installing the required files.






Now is the time for a coffee break, as this part takes a bit of time. Ahh, it is finally complete.




Now we just click on finish and let's see what we get. Well, not a lot, except the window closes. It did have the Launch XAMPP box checked.

We will go the /opt/lampp directory and start it using the following command:

/opt/lampp/lampp start




Ahh, now this is better. Looks like things are up and running. Let's open our favorite web browser and go to http://localhost and see what happens. Success!!!




A matter of security (A MUST READ!)

XAMPP is not meant for production use but only for developers in a development environment. The way XAMPP is configured is to be open as possible and allowing the developer anything he/she wants. For development environments, this is great, but in a production or home environment, it could be fatal.

Here a list of missing security in XAMPP:

  1. The MySQL administrator (root) has no password.
  2. The MySQL daemon is accessible via network.
  3. ProFTPD uses the password "lampp" for user "daemon".
  4. PhpMyAdmin is accessible via network.
  5. Examples are accessible via network.
  6. MySQL is running under "mysql".
  7. Apache is running under "daemon".

I have found that phpmyadmin has the same problem when it comes to entering the roots password as a blank. This time you will need to edit the conf.inc.php file, but from the /opt/lampp/etc/phpmyadmin folder to make the needed corrections.


Configuration and log files paths

/opt/lampp/bin/				The XAMPP commands home.
/opt/lampp/bin/mysql			calls for example the MySQL monitor.
/opt/lampp/htdocs/			The Apache DocumentRoot directory.
/opt/lampp/etc/httpd.conf		The Apache configuration file.
/opt/lampp/etc/my.cnf			The MySQL configuration file.
/opt/lampp/etc/php.ini			The PHP configuration file.
/opt/lampp/etc/proftpd.conf		The ProFTPD configuration file. (since 0.9.5)
/opt/lampp/phpmyadmin/config.inc.php	The phpMyAdmin configuration file.

Please remember that the document folders and files are not in the standard location when using XAMPP.

To stop XAMPP simply call this command:

/opt/lampp/lampp stop

You should now see:

Stopping LAMPP 1.8.2...
LAMPP: Stopping Apache...
LAMPP: Stopping MySQL...
LAMPP stopped.

And XAMPP for Linux is stopped.

To remove XAMPP from your system simply type in the following command

rm -rf /opt/lampp


So how do I compare XAMPP to task-lamp ?

from a range of 0-5 with 5 being easy and 0 being poor

			      XAMPP          task-lamp

Installation ease		4                4
install time			4                4
document/file locations		1                4
security			1                4
ease of removal			5                2



Previous Page              Top              Next Page
Copyright (c) 2013, The PCLinuxOS Magazine. All Rights Reserved.