LAMP used to refer to Linux, Apache, MySQL, and PHP but nowadays the trend is transitioning from MySQL to MySQL's drop-in replacement MariaDB. The Slackware project switched the default database to MariaDB back in March 2013 for the version 14.1 and forward.
I was a little concerned about this change and wasn't sure if my web sites would work with Mhttp://blog.ataboydesign.com/wp-admin/post.php?post=959&action=editariaDB. However, my worry was trivial. MariaDB uses the same files as MySQL so this makes migration a lot easier.
So it's natural for me to try MariaDB on my new Debian Wheezy (7.5) system.
The information in this site is the result of my researches in the Internet and of my experiences. It is solely used for my purpose and may not be suitable for others. I will NOT take any responsibility of end result after following these steps (although I will try to help if you send me your questions/problems).
Firts, make sure the system is up-to-date:
# apt-get update && apt-get upgrade -y
Then, install apache2:
# apt-get install apache2
Add apache2 to system start up and start it up now:
# update-rc.d apache2 enable
update-rc.d: using depndency based boot sequencing
# service apache2 start
[ ok ] Starting web server: apache2.
If you open a web browser and point it to http://localhost, you'll see the message It works!
Next, install php5 along with the apache php5 module, MySQL(MariaDB) php module, and other modules:
# apt-get install php5-curl php5-xmlrpc php5-gd php5-intl libapache2-mod-php5 php5 php5-common php5-dev php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-mysql php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy
Restart the web server:
# apache2 restart
Test the php support by creating a php file (phpinfo.php) in the default document root, /var/www:
# vim /var/www/phpinfo.php
< ?php phpinfo(); ?>
With successful installation/configuration, below page should be loaded:
To properly install and configure MariaDB, I need to know the version/codename of this Debian. I already know its Wheezy but to check, type the following command:
# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 7.5 (wheezy)
Now, open a web browser and go to MariaDB's download page to get the repository information for MariaDB:
Above selection produces below repository info:
Create a file called mariadb.list under /etc/apt/sources.list.d and copy & paste the repository info:
# vim /etc/apt/sources.list.d/mariadb.list
# MariaDB 10.0 repository list - created 2014-05-10 06:44 UTC
deb http://mirror.jmu.edu/pub/mariadb/repo/10.0/debian wheezy main
deb-src http://mirror.jmu.edu/pub/mariadb/repo/10.0/debian wheezy main
Add MariaDB to the system:
# apt-get install python-software-properties
# apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db
# apt-get update
# apt-get install mariadb-server
Follow the on-screen instructions to set up a root password for MariaDB server.
Let's see if MariaDB server was successfully installed:
# mysql -u root -p
Welcome to the MariaDB monitor. Command end with ; or \g.
Your MariaDB connection id is 38
Server version: 10.0.10-MariaDB-1~wheezy mariadb.org binary distribution
Copyright (c) 2000, 2014 Oracle, SkySQL Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
Voilà! With above steps, I have successfully installed LAMP stack on my Debian Wheezy server.
If you are interested, take a look at my post on VirtualHost: Name-Based Web Sites on a Single IP Address