How to install a Debian LAMP Server
The combination of Linux + Apache + MySQL + PHP setup is known as LAMP
We will be using:
Debian Linux - Operating System
Debian is an opensource operating system, which uses the popular Linux kernel. It is a good choice for servers as it is stable and has an easy to use package manager
Apache - Web server
Apache is one of the most famous web servers and with just few simple commands, you can configure apache to play nicely with PHP.
Note: You put your content /var/www.
MySQL 5 - Database Server
The MySQL database is renownd for its excellent performance, high reliability and ease of use.
PHP5 - Scripting Language
PHP is a common scripting language that is especially suited for Web development and can be easialy embedded into HTML pages and works well with other technogies such as the MySQL database and Apache webserver.
phpMyAdmin - Web-based database administration software.
PhpMyAdmin is an excellent web based database administration tool. Managing databases and tables couldnt any simpler.
First, lets ensure that the system meets the minimum requirements for Debian and that it has at least 256MB of RAM available. If your machine has less than 256MB ram then it can cause lot of problems and MySQL will give you the error "cannot connect to mysql.sock".
Debian linux is my favourite for servers as it has the command "apt-get".
This command makes it easy for a beginner to install packages as you dont need to worry about package dependencies or manually creating configuration files.
I will assume that you have already installed debian and have it up and running (very easy). I personally love to use the netinstall cd and install just a base system then use apt-get.
If you wish to access the server remotely through SSH from a windows PC then please download a tool called PuTTY
Ok, now type (in this order, hit enter at the end of the line) and wait for it to complete. Reboot once all the software is installed
apt-get install apache2 php5 libapache2-mod-php5 mysql-server mysql-client php5-mysql phpmyadmin ssh
By default the mysql root (superuser) account does not have a password. Set one like this:
mysql -u root
mysql> USE mysql;
mysql> UPDATE user SET Password=PASSWORD('new-password') WHERE user='root';
mysql> FLUSH PRIVILEGES;
You are now ready to roll!