User Tools

Site Tools


tutorials:web_development:lamp_with_debian

LAMP with Debian

This article is currently incomplete and may be moved when finished. Please don't actually do anything listed here just yet.

Intro

Debian is one of the most widely used linux distros for servers. It is lightweight and uses the debian package management system. This article is going to look at installing an AMP stack in this system. We will not be covering best security practices. I repeat, we will not be covering best security practices. It is very important that you understand setting it up to run and develop from does not mean it is inherently secure. You will need to research security and impliment it on your own. So lets get started.

This article assumes you already have Debian installed and without having chosen the LAMP stack during install.

Installing Apache

  1. Open the terminal via Applications > Accessories > Terminal If you did not install a graphical environment, then you are automatically at a terminal and don't need to follow this step.
  2. Execute $su -c 'apt-get install apache2' it will pull in a few extra packages as well, this is normal.
  3. Once it finishes installing, open your web browser and go to http://localhost and it should show you a page saying “It Works!” on the top of the page. The rest of the content is pretty much irrelevant so ignore it.

Please keep the terminal open, we will continue to use it throught this tutorial.

Now Apache is installed and running. So part one is done. By default it pulls content from /var/www/ but we will do an article explaining how to make virtualhosts and have web pages run from within your home directory to make for easy editing and management.

Installing MySQL

  1. Execute $su -c 'apt-get install mysql-server' to install MySQL and its dependencies.
  2. Once the packages are downloaded and are beginning to install you will be asked to supply a password for the databases root account. As you input the password you will need to use the Tab key and then Enter (carriage return) to submit it, then type it in again to confirm and use the same key combination to submit the confirmation.
  3. Once the password is submitted the database is installed and the service (mysqld) is started.

Now MySQL is installed on your system and ready to be used.

Installing PHP

We will only cover installing PHP 5.x that is already in the Debian repositories. We do not recommend installing PHP 4.x or lower on any system production, testing, development, or otherwise.

  1. Execute the command $su -c 'apt-get install php5' to install PHP5 from the Debian repositories and its dependencies. Side Note: On my system it also uninstalled an apache package, this should be fine since the package manager knows what it is doing.
  2. Once that is finished PHP5 is now installed on your system.

Congradulations

Congradulations, you now have a LAMP Stack that runs on Debian.

tutorials/web_development/lamp_with_debian.txt · Last modified: 2012/07/14 11:05 by garbee