Howto Install LAMP in Debian Sqeeze

LAMP (Linux, Apache, MySQL and PHP) is an open source Web development platform that uses Linux as operating system, Apache as the Web server, MySQL as the relational database management system and PHP as the object-oriented scripting language.
In this quick tutorial we will explain you how to install LAMP SERVER on Debian Squeeze (For newbies)

The installation of Lamp server  in  Debian Sqeeze  will be done in 3 steps :

1- Install apache2 + php5

Apache is one of the most famous web server which runs on most linux based servers. With just few commands you can configure apache to run with  PHP 5.

root@unixmen-debian6:~# apt-get install apache2 php5 libapache2-mod-php5

your  normal web folder is located in /var/www/

Now  lets  check if php is corectly  installed

vi /var/www/test.php

and  add

{codecitation}<?php phpinfo(); ?>{/codecitation}
save and exit

Now open browser with http://ip/test.php



2. Installing MySQL Database Server

To install MySQL, as root enter the following command:

apt-get install mysql-server mysql-client php5-mysql

in this  installation you will  get a  windows  to  insert  your root mysql password

– Or  yon can add it manually later  with :

mysql -u root
mysql> USE mysql;
mysql> UPDATE user SET Password=PASSWORD('your-password') WHERE user='root';


3. Install  PhpMyAdmin

Phpmyadmin is   easy webtool  to  manage  you  databases to install  it :

apt-get  install  phpmyadmin

Choose the  webserver that  you want  to use  , in my  case is apache2

Now  open your  browser  with   http://ip/phpmyadmin


Enjoy and  feel  free  to  ask

  • CMD

    I think you could shorten that down a bit just by using ‘tasksel’ then selecting LAMP

  • http://enteryoursiteURL... server

    I think there is no lamp is tasksel of Debian

  • http://enteryoursiteURL... server

    There is no Lamp in tasksel of Debian

  • Mir

    Thanks for simplifying it so well.

  • quixote

    Very good, succinct instructions that worked perfectly, except that initially my php refused to install correctly. I run Linux Mint Debian squeeze, and I gather it may be a bug. The fix [url=]here[/url] worked for me:

    Use synaptic to completely uninstall libapache2-mod-php5 package, which installs libapache2-mod-php5filter.

    Than completely uninstall libapache2-mod-php5filter which installs ibapache2-mod-php5 package. (Yes, installs it again.) Close synaptic.

    Then restart apache using:
    [code]sudo /etc/init.d/apache2 graceful[/code]

  • Paul


    Same problem in Squeeze AMD64 — and this solution worked.

  • Binary Emotions

    For newbies, instead of vi I’d prefer mc.

  • Ronald Wopereis

    thx !
    this article was very helpful when creating a server instance with RackSpace. Excellent!

  • Grooggy

     excelent! helpfull!

  • Pingback: Apache webserver y mysql en Raspberry Pi | |()

  • Renaud

    Thank you

    But to make it works I needed, after installing phpmyadmin, in order to access it via the browser, to add those lines

    echo Include /etc/phpmyadmin/apache.conf >> /etc/apache2/apache2.conf/

    /etc/init.d/apache2 restart

  • Renaud

    correction :

    echo Include /etc/phpmyadmin/apache.conf >> /etc/apache2/apache2.conf

    /etc/init.d/apache2 restart

  • Emerson

    Parabens !!

    Funcionou perfeitamente.

  • farq

    you forgot, configuration, setting up virtual hosts, and hostname…..