Friday, October 15, 2010

Setting up a LAMP VPS - Part 2

In Part 1 the foundation of the LAMP server was created. Now part 2 of this tutorial will help you setup the M and P and at the end you will have a fully function LAMP server.

M - Mysql
MySQL is the database backend that provides an easy to use database compatible with PHP. There are several databases you can use, such as Postgresql or Firebird. If you plan on using MySQL, install it as follows:
apt-get install mysql-server-5.0
On a Debian system you may be asked to provide a password for access to the SQL server.

P - PHP
PHP is a scripting language that is used to create dynamic webpages. Install PHP:
apt-get install php5
Although it says: "Reloading web server config" I had to restart apache for the changes to take effect:
/etc/init.d/apache2 restart
Now create a PHP test page to see if everything is working fine.
echo "<? echo phpinfo(); ?>" > /var/www/test.php
Navigate to your host/test.php and you should see some tables with PHP information! Congratulations the LAMP server is now fully functional!