20 November 2013

This tutorial shows how to prepare a Debian Wheezy web server. This is just a simple setup of basic web server. I myself did it to set up a development environment for myself.

Make sure the system is up-to-date:

Source code viewer
  1. apt-get update && apt-get upgrade -y
Programming Language: Bash

Install Web Server

First install the web server, add it to system start-up and start it up.
Source code viewer
  1. apt-get install apache2
  2. update-rc.d apache2 enable
  3. service apache2 start
Programming Language: Bash
Now, the Apache web server is installed and started. Its default page is accessible at localhost or 127.0.0.1.

PHP5, Apache PHP5 module and MySQL PHP module.

Next, we install PHP5, Apache PHP5 module and MySQL php module. Also restart apache2 so that the fresh installations work.
Source code viewer
  1. apt-get install php5 libapache2-mod-php5 php5-mysql
  2. service apache2 restart
Programming Language: Bash

Test PHP support

Test PHP support by creating an index.php file inside the web servers default document root '/var/www/', with the following contents.
Source code viewer
  1. <?php
Programming Language: PHP

MariaDB

After a successful PHP is installation, our next step is adding mariadb repository and install MariaDB database server.
Source code viewer
  1. apt-get install python-software-properties
  2. apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db
  3. add-apt-repository 'deb http://mirror.stshosting.co.uk/mariadb/repo/10.0/debian wheezy main'
  4. apt-get update
  5. apt-get install mariadb-server
Programming Language: Bash
Follow the on-screen instructions to set up a root password for the Mariadb server.

phpmyadman

Optionally you can install phpmyadman for easy database access.
Source code viewer
  1. apt-get install phpmyadmin
Programming Language: Bash
1. Web server to reconfigure automatically: answer 'apache2'.
2. Configure database for phpmyadmin with dbconfig-common? – answer ‘NO’.