How to set up LAMP (Linux, Apache, MariaDB, PHP) stack on Debian Wheezy

how-to-set-up-lamp-linux-apache-mariadb-php-stack-on-debian-wheezyLAMP usually refers to a full featured stack containing the Apache web server, the popular database server MySQL and the well known web programming language – PHP, set up on a Linux Operating System.

But, as of lately we’ve seen a lot of open-source communities and some of the largest internet giants as Google switched to the use of MySQL’s open source drop-in replacement – the MariaDB database server, which is what are we going to install today instead of MySQL.

In the following step-by-step set up manual we will explain how to install a LAMP (Linux, Apache, MariaDB, PHP) stack on your Debian Wheezy VPS. Let’s begin:

First, we need to make sure the system is up-to-date:

# apt-get update

# apt-get upgrade -y

Now we can begin isntalling the necessary packages. We will start by installing the webserver:

# apt-get install apache2

add it to system startup and start it up:

# update-rc.d apache2 enable

# service apache2 start

Now, the Apache webserver is installed and started. Its default page is accessible at http://yourdomain.tld

Next, type the following command to install PHP5 along with the Apache PHP5 module and the MySQL php module:

# apt-get install php5 libapache2-mod-php5 php5-mysql

and

# service apache2 restart

to restart the Apache service.

Test the php support by creating an index.php file inside the webserver’s default  document root – the  ‘/var/www/‘ – directory with the following contents:

<?php
phpinfo();
?>

After a successful verification that php is installed and working, in our next step we will add the required repository and after that install and configure the MariaDB database server.

# apt-get install python-software-properties
# apt-key adv –recv-keys –keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db
# add-apt-repository ‘deb http://mirror.stshosting.co.uk/mariadb/repo/10.0/debian wheezy main’
# apt-get update
# apt-get install mariadb-server

Follow the on-screen instructions to set up a root password for the Mariadb server.

With all of these steps we have successfully installed a LAMP stack on your Wheezy server.

In order to provide easier access and managing of your Mariadb databases we will additionally install phpMyadmin:

# apt-get install phpmyadmin

and answer the questions as follows:

1. Web server to reconfigure automatically: answer ‘apache2’.
2. Configure database for phpmyadmin with dbconfig-common? – answer ‘NO’.

And that’s it. You have successfully installed a full LAMP stack with Mariadb and phpMyadmin. Now you can visit http://yourdomain.tld/phpmyadmin/ and login using ‘root‘ as username and the previously set root password.

Of course, you don’t have to do any of this if you use one of our Linux VPS Hosting services, in which case you can simply ask our expert Linux admins to install this for you. They are available 24×7 and will take care of your request immediately. For updates, you can refer to How to Install LAMP (Linux, Apache, MySQL, PHP) on Debian 9.

PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

2 thoughts on “How to set up LAMP (Linux, Apache, MariaDB, PHP) stack on Debian Wheezy”

Leave a Comment