Installing LAMP on Debian Wheezy

This tutorial will show you have you can install a LAMP on Debain Wheezy , an setup of Debian that can act as a LAMP server.

LAMP server stands for Linux, Apache, MySQL and PHP

For this tutorial, l have been using Debian Wheezy 7.2 net-install and used minimal installation , so in one words no GUI , and used VirtualBox 4.2

Download Link for Debian:

Download Link for VirtualBox :

To confirm this 🙂 here is the first picture


For this tutorial l use vi editor , but if you prefer other editors such as nano or pico  you can freely use

For those that they want to use vi editor

apt-get install vim-nox

Lets begin first by installing ntp because need our system to have time synchronized

Installing NTP

apt-get install ntp

invoke-rc.d ntp restart – this will restart ntp


/etc/init.d/ntp restart


service ntp restart

l prefer first one 🙂

Now we will change ip address from dhcp to static, because servers always need to have a static ip


vi /etc/network/interfaces


restart network int – invoke-rc.d networking restart

See if you can ping google

Is everything good now – ok lets begine other installation process 🙂

Installing MySQL

apt-get install mysql-server mysql-client

you will be asked to provide a password for MySQL , the password is for root users, see the pic below



Restart MySQL – invoke-rc.d mysql restart

Installing Apache2

apt-get install apache2

Restart apache – invoke-rc.d apache2 restart

Now to check if the apache works , open the browser and give ip of your server , if you get the similar page like this one you see here , this mean that apache is on ( working )


If you happen to recieve this kind of warning “Could not reliably determine the server’s fully qualified domain name, using for ServerName” than follow this steps

vi /etc/apache2/conf.d/httpd.conf and add lines
ServerName localhost

Remember you must always restart apache to apply this changes
invoke-rc.d apache2 restart

Installing PHP5

apt-get install php5 libapache2-mod-php5

The document root of the default web site is /var/www. We will now create a PHP file “info.php” in that directory and try to access it from browser. The file will display of useful details about our PHP installation, such as the installed PHP version.

vi /var/www/info.php – add the following lines


invoke-rc.d apache2 restart

try to access from browser –

” ipaddofserver/info.php ”

To get MySQL support in PHP, we need to  install the php5-mysql package

apt-get install php5-mysql

Install phpMyAdmin – is a web interface through which you can manage your MySQL databases

apt-get install phpmyadmin


that’s it , your server is up and running now ….

You can ask and write comments below , l will be happy to answer you


7 Responses to Installing LAMP on Debian Wheezy

  1. bert0001 says:

    I didn’t see the install of php5-mysql software. Is it installed automatically when installing php5 with mysql already running?

  2. anne0001 says:

    awesome work Lulzim 😉 It’s nice to guide us through your tutorial.

  3. Pingback: I can build Health Care Dot Gov Faster and Cheaper with LAMP | B2B-TechCopy Technology Marketing Blog

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: