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:  http://www.debian.org/devel/debian-installer/

Download Link for VirtualBox : https://www.virtualbox.org/wiki/Downloads

To confirm this 🙂 here is the first picture

42

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

or

/etc/init.d/ntp restart

or

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

DHCP-to-STATIC

vi /etc/network/interfaces

Selection_003

restart network int – invoke-rc.d networking restart

See if you can ping google
ping http://www.google.com
dig google.com

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

Selection_001

Selection_002

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 )

56

If you happen to recieve this kind of warning “Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 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

<?php
phpinfo();
?>

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

65

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

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

Advertisements

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:

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: